Code

Updated redhat build script
[gosa.git] / gosa-core / redhat / make-gosa-package
1 #!/bin/sh
3 if [ $# -ne 1 ]; then
4         echo "Usage: make-all trunk"
5         exit 1
6 fi
8 what=$1
9 NOT_RELEASED="heimdal dak dfs glpi opsi apache2 ssh"
11 svn export https://oss.gonicus.de/repositories/gosa/tags/$what/gosa-core
12 svn export https://oss.gonicus.de/repositories/gosa/tags/$what/gosa-plugins 
14 VERSION=$(cat gosa-core/debian/changelog | head -n 1 | sed -n -e 's/.*(\([^-]*\).*/\1/p')
16 #redhat
17 rm -rf /usr/src/redhat/RPMS/noarch/gosa*
18 rm -rf /usr/src/redhat/SPECS/gosa.spec
19 rm -rf /usr/src/redhat/SOURCES/*
20 rm -rf /usr/src/redhat/SPECS/*
22 #suse
23 rm -rf /usr/src/packages/RPMS/noarch/gosa*
24 rm -rf /usr/src/packages/SPECS/gosa.spec
25 rm -rf /usr/src/packages/SOURCES/*
26 rm -rf /usr/src/packages/SPECS/*
28 cp -a gosa-core gosa-$VERSION
29 tar cfj /usr/src/redhat/SOURCES/gosa-$VERSION.tar.bz2 gosa-$VERSION
30 cp gosa-$VERSION/redhat/0* /usr/src/redhat/SOURCES/
31 sed "s/^Version:.*$/Version:            $VERSION/" gosa-$VERSION/redhat/gosa.spec > /usr/src/redhat/SPECS/gosa.spec
33 #suse fallback 
34 mkdir -p /usr/src/packages/SOURCES/
35 ln -s /usr/src/redhat/SPECS/gosa.spec /usr/src/packages/SOURCES/gosa.spec
37 rpmbuild -bb /usr/src/redhat/SPECS/gosa.spec
39 MAKE_PLUGINS=$(ls -1 gosa-plugins/*/plugin.dsc | sed 's/^.*\/\([^\/]*\)\/plugin.dsc$/\1/')
40 for i in $NOT_RELEASED; do
41         MAKE_PLUGINS=$(echo -n $MAKE_PLUGINS | sed "s/$i//")
42 done
44 cd gosa-plugins
45 for plugin in $MAKE_PLUGINS; do
46         ../gosa-core/redhat/rpm-make-gosa $plugin
47         rpmbuild -bb /usr/src/redhat/SPECS/gosa-plugin-$plugin.spec
48 done
50 #rm -rf gosa-core
51 rm -rf gosa-$VERSION
52 rm -rf gosa-plugins