From ce721cded470e8ca59e831d29717e1a48eb2b642 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 2 Dec 2008 11:13:24 +0000 Subject: [PATCH] Updated rpm plugin build git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13110 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/redhat/create_gosa_rpm.sh | 45 --------- gosa-core/redhat/{gosa_2_6.spec => gosa.spec} | 4 + gosa-core/redhat/gosa_2_6_plugins.templ | 64 ------------ gosa-core/redhat/rpm-make-gosa | 97 +++++++++++++++++++ 4 files changed, 101 insertions(+), 109 deletions(-) delete mode 100755 gosa-core/redhat/create_gosa_rpm.sh rename gosa-core/redhat/{gosa_2_6.spec => gosa.spec} (98%) delete mode 100644 gosa-core/redhat/gosa_2_6_plugins.templ create mode 100755 gosa-core/redhat/rpm-make-gosa diff --git a/gosa-core/redhat/create_gosa_rpm.sh b/gosa-core/redhat/create_gosa_rpm.sh deleted file mode 100755 index bd9fc4250..000000000 --- a/gosa-core/redhat/create_gosa_rpm.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -x - -templatefile=gosa_2_6_plugins.templ -configfile=gosa-plugin-${1}.spec - -echo "Getting plugin parameter..." - -name=`awk /name/ $1/plugin.dsc | awk '{ print $3 }'` -description=`awk /description/ $1/plugin.dsc | awk -F '"' '{ print $2 }'` -version=`awk /version/ $1/plugin.dsc | awk '{ print $3 }'` -author=`awk /author/ $1/plugin.dsc | awk -F '"' '{ print $2 }'` -homepage=`awk /homepage/ $1/plugin.dsc | awk '{ print $3 }'` -depends=`awk /depends/ $1/plugin.dsc | awk '{ print $3 }'` -conflicts=`awk /conflicts/ $1/plugin.dsc | awk '{ print $3 }'` -provides=`awk /provides/ $1/plugin.dsc | awk '{ print $3 }'` -release=0 - -cp -f $templatefile $configfile - -echo "Creating Spec file..." - -sed -i "s/@@NAME@@/$name/g" $configfile -sed -i "s/@@DESCRIPTION@@/$description/g" $configfile -sed -i "s/@@VERSION@@/$version/g" $configfile -sed -i "s/@@AUTHOR@@/$author/g" $configfile -sed -i "s/@@HOMEPAGE@@/"$homepage"/g" $configfile -sed -i "s/@@DEPENDS@@/$depends/g" $configfile -sed -i "s/@@CONFLICTS@@/$conflicts/g" $configfile -sed -i "s/@@PROVIDES@@/$provides/g" $configfile -sed -i "s/@@RELEASE@@/$release/g" $configfile - -# Leere Zeilen wegräumen -sed -i "s/@@.*@@/not_defined/g" $configfile - -mkdir -p /usr/src/redhat/SOURCES -mkdir -p /usr/src/redhat/SPECS - -mv $configfile /usr/src/redhat/SPECS -cp -r ./$1 /tmp/$1-${version} -cd /tmp/ -mv $1-${version} gosa-plugin-${1}-${version} -tar cvjf gosa-plugin-${1}-${version}.tar.bz2 ./gosa-plugin-${1}-${version} -mv -f gosa-plugin-${1}-${version}.tar.bz2 /usr/src/redhat/SOURCES - - diff --git a/gosa-core/redhat/gosa_2_6.spec b/gosa-core/redhat/gosa.spec similarity index 98% rename from gosa-core/redhat/gosa_2_6.spec rename to gosa-core/redhat/gosa.spec index 72521df9e..f93faaa5d 100644 --- a/gosa-core/redhat/gosa_2_6.spec +++ b/gosa-core/redhat/gosa.spec @@ -179,6 +179,7 @@ mkdir -p %{buildroot}/usr/share/gosa for i in compile config cache; do \ mkdir -p %{buildroot}/var/spool/gosa/$i ; \ done +mkdir -p %{buildroot}/var/cache/gosa # Copy DIRS="doc ihtml plugins html include locale setup" @@ -193,6 +194,7 @@ mkdir -p %{buildroot}/etc/gosa mkdir -p %{buildroot}/usr/share/doc/gosa mkdir -p %{buildroot}/etc/httpd/conf.d +touch %{buildroot}/etc/gosa/gosa.secrets mv contrib/gosa.conf %{buildroot}/usr/share/doc/gosa mv update-gosa %{buildroot}/usr/sbin mv bin/gosa-encrypt-passwords %{buildroot}/usr/sbin @@ -308,6 +310,8 @@ rm -rf %{buildroot} %attr(0755, root,root) /usr/share/gosa/plugins %attr(0755, root,root) /usr/share/gosa/setup %attr(0755, root,root) /usr/share/gosa/doc/core/guide.xml +%attr(0755, root,root) /var/cache/gosa +%attr(0700, root,root) /etc/gosa/gosa.secrets ######################## diff --git a/gosa-core/redhat/gosa_2_6_plugins.templ b/gosa-core/redhat/gosa_2_6_plugins.templ deleted file mode 100644 index 584398f71..000000000 --- a/gosa-core/redhat/gosa_2_6_plugins.templ +++ /dev/null @@ -1,64 +0,0 @@ -# Some sort of "detection" of suse -%{?suse_version:%define suse 1} -%{!?suse_version:%define suse 0} - -# Define Packagename, e.g.: -# rpmbuild --rebuild --define 'sourcename gosa' gosa.srpm -%{!?sourcename:%define sourcename %{name}-%{version}} - -# -# Distribution -# -Summary: @@DESCRIPTION@@ -Name: gosa-plugin-@@NAME@@ -Version: @@VERSION@@ -Release: @@RELEASE@@ -License: GPL -Source: ftp://oss.GONICUS.de/pub/gosa/%{sourcename}.tar.bz2 -URL: @@HOMEPAGE@@ -Group: System/Administration -Vendor: GONICUS GmbH -Packager: @@AUTHOR@@ -Buildarch: noarch -%if %{suse} -Requires: gosa >= 2.6.0 @@DEPENDS@@ -%else -Requires: gosa >= 2.6.0 @@DEPENDS@@ -%endif -BuildRoot: %{_tmppath}/%{name}-%{version}-root -BuildArch: noarch - -%define confdir /etc/%{name} - -%if %{suse} - %{echo:Building SuSE rpm} - %define docdir /usr/share/doc/packages/gosa -%else - %{echo:Building other rpm} - %define webconf /etc/httpd/conf.d/ - %define docdir /usr/share/doc/gosa-%{version} -%endif - -%description -@@DESCRIPTION@@ - -%prep -%setup -q -n %{sourcename} - -%build - -%install -# Create buildroot -mkdir -p %{buildroot}/usr/share/gosa/plugins/%{name} -mv ./* %{buildroot}/usr/share/gosa/plugins/%{name} -#cp -ua ./@@NAME@@* %{buildroot}/usr/share/gosa/plugins/@@NAME@@ - -%post -/usr/sbin/update-gosa - -%clean -rm -rf %{buildroot} - -%files -%defattr(-,root,root) -%attr (-,root,root) /usr/share/gosa/plugins/%{name} diff --git a/gosa-core/redhat/rpm-make-gosa b/gosa-core/redhat/rpm-make-gosa new file mode 100755 index 000000000..43c6e4fd1 --- /dev/null +++ b/gosa-core/redhat/rpm-make-gosa @@ -0,0 +1,97 @@ +#!/bin/sh + +configfile=gosa-plugin-${1}.spec + +echo "Reading plugin parameters..." + +name=$(awk /name/ $1/plugin.dsc | awk '{ print $3 }') +description=$(awk /description/ $1/plugin.dsc | awk -F '"' '{ print $2 }') +version=$(awk /version/ $1/plugin.dsc | awk '{ print $3 }') +author=$(awk /author/ $1/plugin.dsc | awk -F '"' '{ print $2 }') +homepage=$(awk /homepage/ $1/plugin.dsc | awk '{ print $3 }') +depends=$(sed -n 's/^depends\s*=\s*//p' $1/plugin.dsc | sed 's/^/ /;s/,/ /g;s/\s\s*/ /g;s/ / gosa-plugin-/g;s/^ //;s/ /,/') +conflicts=$(awk /conflicts/ $1/plugin.dsc | awk '{ print $3 }') +provides=$(awk /provides/ $1/plugin.dsc | awk '{ print $3 }') +release=0 + +echo "Creating Spec file..." +cat << EOF | sed -e "s/@@NAME@@/$name/g" -e "s/@@DESCRIPTION@@/$description/g" -e "s/@@VERSION@@/$version/g" -e "s/@@AUTHOR@@/$author/g" -e "s#@@HOMEPAGE@@#$homepage#g" -e "s/@@DEPENDS@@/$depends/g" -e "s/@@CONFLICTS@@/$conflicts/g" -e "s/@@PROVIDES@@/$provides/g" -e "s/@@RELEASE@@/$release/g" -e "s/@@.*@@/not_defined/g" > $configfile +# Some sort of "detection" of suse +%{?suse_version:%define suse 1} +%{!?suse_version:%define suse 0} + +# Define Packagename, e.g.: +# rpmbuild --rebuild --define 'sourcename gosa' gosa.srpm +%{!?sourcename:%define sourcename %{name}-%{version}} + +# +# Distribution +# +Summary: @@DESCRIPTION@@ +Name: gosa-plugin-@@NAME@@ +Version: @@VERSION@@ +Release: @@RELEASE@@ +License: GPL +Source: ftp://oss.GONICUS.de/pub/gosa/%{sourcename}.tar.bz2 +URL: @@HOMEPAGE@@ +Group: System/Administration +Vendor: GONICUS GmbH +Packager: @@AUTHOR@@ +Buildarch: noarch +%if %{suse} +Requires: gosa >= 2.6.0, @@DEPENDS@@ +%else +Requires: gosa >= 2.6.0, @@DEPENDS@@ +%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-root +BuildArch: noarch + +%define confdir /etc/%{name} + +%if %{suse} + %{echo:Building SuSE rpm} + %define docdir /usr/share/doc/packages/gosa +%else + %{echo:Building other rpm} + %define webconf /etc/httpd/conf.d/ + %define docdir /usr/share/doc/gosa-%{version} +%endif + +%description +@@DESCRIPTION@@ + +%prep +%setup -q -n %{sourcename} + +%build + +%install +# Create buildroot +mkdir -p %{buildroot}/usr/share/gosa/plugins/%{name} +mv ./* %{buildroot}/usr/share/gosa/plugins/%{name} +#cp -ua ./@@NAME@@* %{buildroot}/usr/share/gosa/plugins/@@NAME@@ + +%post +/usr/sbin/update-gosa + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%attr (-,root,root) /usr/share/gosa/plugins/%{name} +EOF + +# Create eventually missing directories +[ ! -d /usr/src/redhat/SOURCES ] && mkdir -p /usr/src/redhat/SOURCES +[ ! -d /usr/src/redhat/SPECS ] && mkdir -p /usr/src/redhat/SPECS + +mv $configfile /usr/src/redhat/SPECS +cp -r ./$1 /tmp/$1-${version} +cd /tmp/ +mv $1-${version} gosa-plugin-${1}-${version} +tar cjf gosa-plugin-${1}-${version}.tar.bz2 ./gosa-plugin-${1}-${version} +rm -rf $1-${version} gosa-plugin-${1}-${version} +mv -f gosa-plugin-${1}-${version}.tar.bz2 /usr/src/redhat/SOURCES + +echo "Done." -- 2.30.2