Code

Updated rpm plugin build
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 2 Dec 2008 11:13:24 +0000 (11:13 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 2 Dec 2008 11:13:24 +0000 (11:13 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13110 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/redhat/create_gosa_rpm.sh [deleted file]
gosa-core/redhat/gosa.spec [new file with mode: 0644]
gosa-core/redhat/gosa_2_6.spec [deleted file]
gosa-core/redhat/gosa_2_6_plugins.templ [deleted file]
gosa-core/redhat/rpm-make-gosa [new file with mode: 0755]

diff --git a/gosa-core/redhat/create_gosa_rpm.sh b/gosa-core/redhat/create_gosa_rpm.sh
deleted file mode 100755 (executable)
index bd9fc42..0000000
+++ /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.spec b/gosa-core/redhat/gosa.spec
new file mode 100644 (file)
index 0000000..f93faaa
--- /dev/null
@@ -0,0 +1,377 @@
+# 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:               Web Based LDAP Administration Program 
+Name:                  gosa
+Version:               2.6.0
+Release:               1
+License:               GPL
+Source:                ftp://oss.GONICUS.de/pub/gosa/%{sourcename}.tar.bz2
+URL:                   https://oss.GONICUS.de/labs/gosa/
+Group:                         System/Administration
+Vendor:                        GONICUS GmbH
+Packager:              Stefan Japes <japes@GONICUS.de>
+Buildarch:             noarch
+Patch:                 01_fix_template_location.patch
+Patch1:                        02_fix_class_mapping.patch
+Patch2:                        03_fix_locale_location.patch
+Patch3:                        04_fix_online_help_location.patch
+%if %{suse}
+Requires:              apache2,apache2-mod_php5,php5,php5-gd,php5-ldap,php5-mcrypt,php5-mysql,php4-imap,php5-iconv,php5-mbstring,php5-gettext,php5-session,ImageMagick
+%else
+Requires:              httpd,php,php-ldap,php-imap,php-snmp,php-mysql,php-mbstring,ImageMagick,php-mhash,perl-Crypt-SmbHash
+%endif
+BuildRoot:             %{_tmppath}/%{name}-%{version}-root
+BuildArch:             noarch
+
+########################
+
+%define confdir        /etc/%{name}
+
+%if %{suse}
+       %{echo:Building SuSE rpm}
+       %define apacheuser wwwrun
+       %define apachegroup root
+       %define webconf /etc/apache2/conf.d/
+       %define docdir /usr/share/doc/packages/gosa
+%else
+       %{echo:Building other rpm}
+       %define apacheuser apache 
+       %define apachegroup apache 
+       %define webconf /etc/httpd/conf.d/      
+       %define docdir /usr/share/doc/gosa-%{version}
+%endif
+
+%description
+GOsa is a combination of system-administrator and end-user web
+interface, designed to handle LDAP based setups.
+Provided is access to posix, shadow, samba, proxy, fax, and kerberos
+accounts. It is able to manage the postfix/cyrus server combination
+and can write user adapted sieve scripts.
+
+########################
+
+%package dev
+Group:                  System/Administration
+Summary:                GOsa development utiles
+%if %{suse}
+Requires:               lyx
+%else
+Requires:               php-cli,latex2html,lyx
+%endif
+Obsoletes:              gosa-ldap
+
+%description dev
+This package contains a couple of tools to generate
+online help, extract localisations and aid developing.
+
+########################
+
+%package desktop
+Group:                  System/Administration
+Summary:                Desktop integration for GOsa
+%if %{suse}
+Requires:               firefox
+%else
+Requires:               firefox
+%endif
+Obsoletes:              gosa-ldap
+
+%description desktop
+This package includes a menu definition for your
+desktop environment.
+
+########################
+
+%package schema
+Group:                         System/Administration
+Summary:               Schema Definitions for the GOSA package
+%if %{suse}
+Requires:              gosa >= %{version}
+%else
+Requires:              gosa >= %{version}
+%endif
+Obsoletes:             gosa-ldap
+
+%description schema
+Contains the Schema definition files for the GOSA admin package.
+
+########################
+
+%package help-en
+Group:                         System/Administration
+Summary:               English online manual for GOSA package
+Requires:              gosa >= %{version}
+
+%description help-en
+English online manual page for GOSA package
+
+########################
+
+%package help-de
+Group:                         System/Administration
+Summary:               German localized online manual for GOSA package
+Requires:              gosa >= %{version}
+
+%description help-de
+German localized online manual page for GOSA package
+
+########################
+
+%package help-fr
+Group:                         System/Administration
+Summary:               French localized online manual for GOSA package
+Requires:              gosa >= %{version}
+
+%description help-fr
+French localized online manual page for GOSA package
+
+########################
+
+%package help-nl
+Group:                         System/Administration
+Summary:               Dutch localized online manual for GOSA package
+Requires:              gosa >= %{version}
+
+%description help-nl
+Dutch localized online manual page for GOSA package
+
+########################
+
+%package help-es
+Group:                         System/Administration
+Summary:               Spain localized online manual for GOSA package
+Requires:              gosa >= %{version}
+
+%description help-es
+Spain localized online manual page for GOSA package
+
+########################
+
+%prep
+%setup -q -n %{sourcename}
+%patch -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+find . -depth -name CVS -type d | xargs rm -rf
+
+########################
+
+%build
+
+########################
+
+%install
+# Create buildroot
+mkdir -p %{buildroot}/usr/share/gosa
+
+# Create files for temporary stuff
+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"
+echo `pwd`
+for i in $DIRS; do \
+  cp -ua $i %{buildroot}/usr/share/gosa/$i ; \
+done
+
+# Copy files for gosa
+mkdir -p %{buildroot}/usr/sbin
+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
+mv debian/gosa-apache.conf     %{buildroot}/etc/httpd/conf.d
+mv contrib/shells              %{buildroot}/etc/gosa
+mv contrib/encodings           %{buildroot}/etc/gosa
+mv contrib/openldap/slapd.conf         %{buildroot}/usr/share/doc/gosa/slapd.conf-example
+mv -f doc manual
+
+# Cleanup manual dirs
+for i in admin ; do \
+  rm -rf %{buildroot}/usr/share/gosa/doc/$i ; \
+done
+
+# Remove (some) unneeded files
+for i in gen_locale.sh gen_online_help.sh gen_function_list.php update.sh; do \
+ rm -rf %{buildroot}/usr/share/gosa/$i ; \
+done
+
+# Cleanup lyx warnings
+find %{buildroot}/usr/share/gosa -name WARNINGS |xargs rm
+
+# Cleanup guide
+rm -rf %{buildroot}/usr/share/gosa/doc/guide/user/*/lyx-source
+
+# Copy default config
+mkdir -p %{buildroot}%{confdir}
+mkdir -p %{buildroot}%{webconf}
+
+# Copy file for gosa-schema
+mkdir -p %{buildroot}/etc/openldap/schema/gosa
+
+mv contrib/openldap/*.schema %{buildroot}/etc/openldap/schema/gosa
+
+# Copy files for gosa-dev
+mkdir -p %{buildroot}/usr/bin
+mv update-locale %{buildroot}/usr/bin
+mv update-online-help %{buildroot}/usr/bin
+mv update-pdf-help %{buildroot}/usr/bin
+mv dh-make-gosa %{buildroot}/usr/bin
+
+# Copy files for desktop
+mkdir -p %{buildroot}/etc/gosa
+mkdir -p %{buildroot}/usr/bin
+mkdir -p %{buildroot}/usr/sbin
+mkdir -p %{buildroot}/usr/share/pixmaps
+mkdir -p %{buildroot}/usr/share/applications
+mkdir -p %{buildroot}/usr/share/man/man1/
+
+mv contrib/desktoprc           %{buildroot}/etc/gosa
+mv contrib/gosa                %{buildroot}/usr/bin
+mv debian/gosa.xpm             %{buildroot}/usr/share/pixmaps
+mv debian/gosa-16.xpm          %{buildroot}/usr/share/pixmaps
+mv debian/gosa-desktop.desktop         %{buildroot}/usr/share/applications
+
+# Gzip manpages from source
+for x in update-gosa.1 dh-make-gosa.1 update-locale.1 update-online-help.1 update-pdf-help.1
+do
+       gzip $x
+done
+
+# Copy manpages
+mv ./*.1.gz                    %{buildroot}/usr/share/man/man1/
+gzip -c contrib/gosa.1 > contrib/gosa.1.gz
+mv contrib/gosa.1.gz           %{buildroot}/usr/share/man/man1/
+
+mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
+rm -rf %{buildroot}/usr/share/gosa/contrib
+
+########################
+
+%clean
+rm -rf %{buildroot}
+
+########################
+
+%post
+/usr/sbin/update-gosa
+
+########################
+
+%pre
+# Cleanup compile dir on updates, always exit cleanly even on errors
+[ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
+
+########################
+
+%postun
+# Remove temporary files, just to be sure
+[ -d /var/spool/gosa ] && rm -rf /var/spool/gosa ; exit 0
+[ -d /usr/share/gosa ] && rm -rf /usr/share/gosa ; exit 0
+
+########################
+
+%files
+%defattr(-,root,root)
+%doc %attr(-,root,root) AUTHORS README README.safemode Changelog COPYING INSTALL FAQ CODING
+%config %attr(-,root,root) /usr/share/doc/gosa/gosa.conf
+#%attr(-,root,root) /contrib/openldap
+%config %attr(-,root,root) /usr/share/doc/gosa/slapd.conf-example
+%attr(755,root,root) /usr/sbin/update-gosa
+%attr(755,root,root) /usr/share/man/man1/update-gosa.1.gz
+%attr(644,root,root) /etc/gosa/shells
+%attr(644,root,root) /etc/gosa/encodings
+%attr(755,root,root) /usr/sbin/gosa-encrypt-passwords
+%config(noreplace) %attr(0644,root,root) %{webconf}/gosa-apache.conf
+%attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
+%attr(0755, root,root) /usr/share/gosa
+%attr(0755, root,root) /usr/share/gosa/html
+%attr(0755, root,root) /usr/share/gosa/ihtml
+%attr(0755, root,root) /usr/share/gosa/include
+%attr(0755, root,root) /usr/share/gosa/locale
+%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
+
+########################
+
+%files dev
+%defattr(-,root,root)
+/usr/bin
+%attr(755,root,root) /usr/share/man/man1/dh-make-gosa.1.gz
+%attr(755,root,root) /usr/share/man/man1/update-locale.1.gz
+%attr(755,root,root) /usr/share/man/man1/update-online-help.1.gz
+%attr(755,root,root) /usr/share/man/man1/update-pdf-help.1.gz
+
+########################
+
+%files desktop
+%defattr(-,root,root)
+/etc/gosa
+/usr/bin
+/usr/share/pixmaps
+/usr/share/applications
+%attr(755,root,root) /usr/share/man/man1/gosa.1.gz
+
+########################
+
+%files schema
+%defattr(-,root,root)
+%doc COPYING AUTHORS README contrib/openldap
+/etc/openldap/schema/gosa
+
+########################
+
+%files help-en
+%defattr(-,root,root)
+/usr/share/gosa/doc/core/en
+
+########################
+
+%files help-de
+%defattr(-,root,root)
+/usr/share/gosa/doc/core/de
+
+########################
+
+%files help-fr
+%defattr(-,root,root)
+/usr/share/gosa/doc/core/fr
+
+########################
+
+%files help-nl
+%defattr(-,root,root)
+/usr/share/gosa/doc/core/nl
+
+########################
+
+%files help-es
+%defattr(-,root,root)
+/usr/share/gosa/doc/core/es
+
+########################
+
+%changelog
+* Fri Nov 17 2008 Stefan Japes <japes@GONICUS.de>
+- First build of GOsa 2.6 as an RPM, should work on SuSE and RedHat
diff --git a/gosa-core/redhat/gosa_2_6.spec b/gosa-core/redhat/gosa_2_6.spec
deleted file mode 100644 (file)
index 72521df..0000000
+++ /dev/null
@@ -1,373 +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:               Web Based LDAP Administration Program 
-Name:                  gosa
-Version:               2.6.0
-Release:               1
-License:               GPL
-Source:                ftp://oss.GONICUS.de/pub/gosa/%{sourcename}.tar.bz2
-URL:                   https://oss.GONICUS.de/labs/gosa/
-Group:                         System/Administration
-Vendor:                        GONICUS GmbH
-Packager:              Stefan Japes <japes@GONICUS.de>
-Buildarch:             noarch
-Patch:                 01_fix_template_location.patch
-Patch1:                        02_fix_class_mapping.patch
-Patch2:                        03_fix_locale_location.patch
-Patch3:                        04_fix_online_help_location.patch
-%if %{suse}
-Requires:              apache2,apache2-mod_php5,php5,php5-gd,php5-ldap,php5-mcrypt,php5-mysql,php4-imap,php5-iconv,php5-mbstring,php5-gettext,php5-session,ImageMagick
-%else
-Requires:              httpd,php,php-ldap,php-imap,php-snmp,php-mysql,php-mbstring,ImageMagick,php-mhash,perl-Crypt-SmbHash
-%endif
-BuildRoot:             %{_tmppath}/%{name}-%{version}-root
-BuildArch:             noarch
-
-########################
-
-%define confdir        /etc/%{name}
-
-%if %{suse}
-       %{echo:Building SuSE rpm}
-       %define apacheuser wwwrun
-       %define apachegroup root
-       %define webconf /etc/apache2/conf.d/
-       %define docdir /usr/share/doc/packages/gosa
-%else
-       %{echo:Building other rpm}
-       %define apacheuser apache 
-       %define apachegroup apache 
-       %define webconf /etc/httpd/conf.d/      
-       %define docdir /usr/share/doc/gosa-%{version}
-%endif
-
-%description
-GOsa is a combination of system-administrator and end-user web
-interface, designed to handle LDAP based setups.
-Provided is access to posix, shadow, samba, proxy, fax, and kerberos
-accounts. It is able to manage the postfix/cyrus server combination
-and can write user adapted sieve scripts.
-
-########################
-
-%package dev
-Group:                  System/Administration
-Summary:                GOsa development utiles
-%if %{suse}
-Requires:               lyx
-%else
-Requires:               php-cli,latex2html,lyx
-%endif
-Obsoletes:              gosa-ldap
-
-%description dev
-This package contains a couple of tools to generate
-online help, extract localisations and aid developing.
-
-########################
-
-%package desktop
-Group:                  System/Administration
-Summary:                Desktop integration for GOsa
-%if %{suse}
-Requires:               firefox
-%else
-Requires:               firefox
-%endif
-Obsoletes:              gosa-ldap
-
-%description desktop
-This package includes a menu definition for your
-desktop environment.
-
-########################
-
-%package schema
-Group:                         System/Administration
-Summary:               Schema Definitions for the GOSA package
-%if %{suse}
-Requires:              gosa >= %{version}
-%else
-Requires:              gosa >= %{version}
-%endif
-Obsoletes:             gosa-ldap
-
-%description schema
-Contains the Schema definition files for the GOSA admin package.
-
-########################
-
-%package help-en
-Group:                         System/Administration
-Summary:               English online manual for GOSA package
-Requires:              gosa >= %{version}
-
-%description help-en
-English online manual page for GOSA package
-
-########################
-
-%package help-de
-Group:                         System/Administration
-Summary:               German localized online manual for GOSA package
-Requires:              gosa >= %{version}
-
-%description help-de
-German localized online manual page for GOSA package
-
-########################
-
-%package help-fr
-Group:                         System/Administration
-Summary:               French localized online manual for GOSA package
-Requires:              gosa >= %{version}
-
-%description help-fr
-French localized online manual page for GOSA package
-
-########################
-
-%package help-nl
-Group:                         System/Administration
-Summary:               Dutch localized online manual for GOSA package
-Requires:              gosa >= %{version}
-
-%description help-nl
-Dutch localized online manual page for GOSA package
-
-########################
-
-%package help-es
-Group:                         System/Administration
-Summary:               Spain localized online manual for GOSA package
-Requires:              gosa >= %{version}
-
-%description help-es
-Spain localized online manual page for GOSA package
-
-########################
-
-%prep
-%setup -q -n %{sourcename}
-%patch -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-
-find . -depth -name CVS -type d | xargs rm -rf
-
-########################
-
-%build
-
-########################
-
-%install
-# Create buildroot
-mkdir -p %{buildroot}/usr/share/gosa
-
-# Create files for temporary stuff
-for i in compile config cache; do \
-  mkdir -p %{buildroot}/var/spool/gosa/$i ; \
-done
-
-# Copy
-DIRS="doc ihtml plugins html include locale setup"
-echo `pwd`
-for i in $DIRS; do \
-  cp -ua $i %{buildroot}/usr/share/gosa/$i ; \
-done
-
-# Copy files for gosa
-mkdir -p %{buildroot}/usr/sbin
-mkdir -p %{buildroot}/etc/gosa
-mkdir -p %{buildroot}/usr/share/doc/gosa
-mkdir -p %{buildroot}/etc/httpd/conf.d
-
-mv contrib/gosa.conf           %{buildroot}/usr/share/doc/gosa
-mv update-gosa                         %{buildroot}/usr/sbin
-mv bin/gosa-encrypt-passwords  %{buildroot}/usr/sbin
-mv debian/gosa-apache.conf     %{buildroot}/etc/httpd/conf.d
-mv contrib/shells              %{buildroot}/etc/gosa
-mv contrib/encodings           %{buildroot}/etc/gosa
-mv contrib/openldap/slapd.conf         %{buildroot}/usr/share/doc/gosa/slapd.conf-example
-mv -f doc manual
-
-# Cleanup manual dirs
-for i in admin ; do \
-  rm -rf %{buildroot}/usr/share/gosa/doc/$i ; \
-done
-
-# Remove (some) unneeded files
-for i in gen_locale.sh gen_online_help.sh gen_function_list.php update.sh; do \
- rm -rf %{buildroot}/usr/share/gosa/$i ; \
-done
-
-# Cleanup lyx warnings
-find %{buildroot}/usr/share/gosa -name WARNINGS |xargs rm
-
-# Cleanup guide
-rm -rf %{buildroot}/usr/share/gosa/doc/guide/user/*/lyx-source
-
-# Copy default config
-mkdir -p %{buildroot}%{confdir}
-mkdir -p %{buildroot}%{webconf}
-
-# Copy file for gosa-schema
-mkdir -p %{buildroot}/etc/openldap/schema/gosa
-
-mv contrib/openldap/*.schema %{buildroot}/etc/openldap/schema/gosa
-
-# Copy files for gosa-dev
-mkdir -p %{buildroot}/usr/bin
-mv update-locale %{buildroot}/usr/bin
-mv update-online-help %{buildroot}/usr/bin
-mv update-pdf-help %{buildroot}/usr/bin
-mv dh-make-gosa %{buildroot}/usr/bin
-
-# Copy files for desktop
-mkdir -p %{buildroot}/etc/gosa
-mkdir -p %{buildroot}/usr/bin
-mkdir -p %{buildroot}/usr/sbin
-mkdir -p %{buildroot}/usr/share/pixmaps
-mkdir -p %{buildroot}/usr/share/applications
-mkdir -p %{buildroot}/usr/share/man/man1/
-
-mv contrib/desktoprc           %{buildroot}/etc/gosa
-mv contrib/gosa                %{buildroot}/usr/bin
-mv debian/gosa.xpm             %{buildroot}/usr/share/pixmaps
-mv debian/gosa-16.xpm          %{buildroot}/usr/share/pixmaps
-mv debian/gosa-desktop.desktop         %{buildroot}/usr/share/applications
-
-# Gzip manpages from source
-for x in update-gosa.1 dh-make-gosa.1 update-locale.1 update-online-help.1 update-pdf-help.1
-do
-       gzip $x
-done
-
-# Copy manpages
-mv ./*.1.gz                    %{buildroot}/usr/share/man/man1/
-gzip -c contrib/gosa.1 > contrib/gosa.1.gz
-mv contrib/gosa.1.gz           %{buildroot}/usr/share/man/man1/
-
-mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
-rm -rf %{buildroot}/usr/share/gosa/contrib
-
-########################
-
-%clean
-rm -rf %{buildroot}
-
-########################
-
-%post
-/usr/sbin/update-gosa
-
-########################
-
-%pre
-# Cleanup compile dir on updates, always exit cleanly even on errors
-[ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
-
-########################
-
-%postun
-# Remove temporary files, just to be sure
-[ -d /var/spool/gosa ] && rm -rf /var/spool/gosa ; exit 0
-[ -d /usr/share/gosa ] && rm -rf /usr/share/gosa ; exit 0
-
-########################
-
-%files
-%defattr(-,root,root)
-%doc %attr(-,root,root) AUTHORS README README.safemode Changelog COPYING INSTALL FAQ CODING
-%config %attr(-,root,root) /usr/share/doc/gosa/gosa.conf
-#%attr(-,root,root) /contrib/openldap
-%config %attr(-,root,root) /usr/share/doc/gosa/slapd.conf-example
-%attr(755,root,root) /usr/sbin/update-gosa
-%attr(755,root,root) /usr/share/man/man1/update-gosa.1.gz
-%attr(644,root,root) /etc/gosa/shells
-%attr(644,root,root) /etc/gosa/encodings
-%attr(755,root,root) /usr/sbin/gosa-encrypt-passwords
-%config(noreplace) %attr(0644,root,root) %{webconf}/gosa-apache.conf
-%attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
-%attr(0755, root,root) /usr/share/gosa
-%attr(0755, root,root) /usr/share/gosa/html
-%attr(0755, root,root) /usr/share/gosa/ihtml
-%attr(0755, root,root) /usr/share/gosa/include
-%attr(0755, root,root) /usr/share/gosa/locale
-%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
-
-########################
-
-%files dev
-%defattr(-,root,root)
-/usr/bin
-%attr(755,root,root) /usr/share/man/man1/dh-make-gosa.1.gz
-%attr(755,root,root) /usr/share/man/man1/update-locale.1.gz
-%attr(755,root,root) /usr/share/man/man1/update-online-help.1.gz
-%attr(755,root,root) /usr/share/man/man1/update-pdf-help.1.gz
-
-########################
-
-%files desktop
-%defattr(-,root,root)
-/etc/gosa
-/usr/bin
-/usr/share/pixmaps
-/usr/share/applications
-%attr(755,root,root) /usr/share/man/man1/gosa.1.gz
-
-########################
-
-%files schema
-%defattr(-,root,root)
-%doc COPYING AUTHORS README contrib/openldap
-/etc/openldap/schema/gosa
-
-########################
-
-%files help-en
-%defattr(-,root,root)
-/usr/share/gosa/doc/core/en
-
-########################
-
-%files help-de
-%defattr(-,root,root)
-/usr/share/gosa/doc/core/de
-
-########################
-
-%files help-fr
-%defattr(-,root,root)
-/usr/share/gosa/doc/core/fr
-
-########################
-
-%files help-nl
-%defattr(-,root,root)
-/usr/share/gosa/doc/core/nl
-
-########################
-
-%files help-es
-%defattr(-,root,root)
-/usr/share/gosa/doc/core/es
-
-########################
-
-%changelog
-* Fri Nov 17 2008 Stefan Japes <japes@GONICUS.de>
-- First build of GOsa 2.6 as an RPM, should work on SuSE and RedHat
diff --git a/gosa-core/redhat/gosa_2_6_plugins.templ b/gosa-core/redhat/gosa_2_6_plugins.templ
deleted file mode 100644 (file)
index 584398f..0000000
+++ /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 (executable)
index 0000000..43c6e4f
--- /dev/null
@@ -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."