LDAPAccountManager/lam-packaging/buildPackages

142 lines
4.5 KiB
Bash
Executable File

#!/bin/bash
#
# Builds LDAP Account Manager packages from CVS.
if [ $# -lt 1 ]
then
echo -e "Usage: buildPackage <CVS tag>"
exit
fi
cd /daten/projekte/lam/pakete
export CVS_TAG=$1
cvs -z3 -d:ext:gruberroland@lam.cvs.sourceforge.net:/cvsroot/lam export -r $CVS_TAG lam
cvs -z3 -d:ext:gruberroland@lam.cvs.sourceforge.net:/cvsroot/lam export -r $CVS_TAG lam-packaging
cvs -d/daten/projekte/CVSROOT export -r $CVS_TAG lamPro
cp lam-packaging/getVersion ./
export VERSION=`./getVersion`
# remove files which are not in the final release
rm -r lam/po
rm -r lam/tests
find . -name .cvsignore -exec rm {} \;
mv lam ldap-account-manager-$VERSION
# create LAM Pro documentation
cd lamPro/docs/LAMProHowTo-sources
./make.sh
cd ../../..
rm -r lamPro/docs/LAMProHowTo-sources
# create LAM Pro build directory
mkdir LAMPro
cp -a ldap-account-manager-$VERSION LAMPro/ldap-account-manager-$VERSION
cp -a lamPro/* LAMPro/ldap-account-manager-$VERSION
rm -r lamPro
# create PHPdoc
cd LAMPro/ldap-account-manager-$VERSION
./phpdoc.sh
rm phpdoc.sh
cd ../..
cd ldap-account-manager-$VERSION
./phpdoc.sh
rm phpdoc.sh
cd ..
# tar.gz
cp lam-packaging/autoconf/configure.ac ldap-account-manager-$VERSION/
cp lam-packaging/autoconf/Makefile.in ldap-account-manager-$VERSION/
cd ldap-account-manager-$VERSION
touch install.sh
perl -pi -e "s/\\@\\@VERSION\\@\\@/$VERSION/g" configure.ac
autoconf
rm configure.ac
rm -r autom4te.cache
cd ..
tar cfz ldap-account-manager-$VERSION.tar.gz ldap-account-manager-$VERSION
# tar.gz of LAM Pro
cd LAMPro
cp ../lam-packaging/autoconf/configure.ac ldap-account-manager-$VERSION/
cp ../lam-packaging/autoconf/Makefile.in ldap-account-manager-$VERSION/
cd ldap-account-manager-$VERSION
touch install.sh
perl -pi -e "s/\\@\\@VERSION\\@\\@/$VERSION/g" configure.ac
autoconf
rm configure.ac
rm -r autom4te.cache
cd ..
tar cfz ldap-account-manager-$VERSION.tar.gz ldap-account-manager-$VERSION
cd ..
# Debian
mkdir Debian
cp ldap-account-manager-$VERSION.tar.gz Debian/ldap-account-manager_$VERSION.orig.tar.gz
mv ldap-account-manager-$VERSION Debian/
cp -r lam-packaging/debian Debian/ldap-account-manager-$VERSION/
cd Debian/ldap-account-manager-$VERSION
debuild
cd ..
rm -r ldap-account-manager-$VERSION
cd ..
# Debian for LAM Pro
cd LAMPro
mkdir Debian
cp ldap-account-manager-$VERSION.tar.gz Debian/ldap-account-manager_$VERSION.orig.tar.gz
mv ldap-account-manager-$VERSION Debian/
cp -r ../lam-packaging/debian Debian/ldap-account-manager-$VERSION/
cd Debian/ldap-account-manager-$VERSION
debuild
cd ..
rm -r ldap-account-manager-$VERSION
cd ..
cd ..
# RPM
perl -pi -e "s/\\@\\@VERSION\\@\\@/$VERSION/g" lam-packaging/RPM/ldap-account-manager.spec
cp lam-packaging/RPM/ldap-account-manager.spec lam-packaging/RPM/ldap-account-manager-fedora.spec
cp lam-packaging/RPM/ldap-account-manager.spec lam-packaging/RPM/ldap-account-manager-suse.spec
mkdir RPM
mkdir LAMPro/RPM
# Fedora RPM
perl -pi -e "s/\\@\\@DISTRIBUTION\\@\\@/fedora/g" lam-packaging/RPM/ldap-account-manager-fedora.spec
perl -pi -e "s/\\@\\@USER\\@\\@/apache/g" lam-packaging/RPM/ldap-account-manager-fedora.spec
perl -pi -e "s/\\@\\@GROUP\\@\\@/apache/g" lam-packaging/RPM/ldap-account-manager-fedora.spec
cp ldap-account-manager-$VERSION.tar.gz /usr/src/rpm/SOURCES
rpmbuild --sign --clean --rmsource -bb lam-packaging/RPM/ldap-account-manager-fedora.spec
mv /usr/src/rpm/RPMS/noarch/ldap-account-manager*-$VERSION-1*.noarch.rpm RPM/
# Fedora RPM for LAM Pro
cd LAMPro
cp ldap-account-manager-$VERSION.tar.gz /usr/src/rpm/SOURCES/ldap-account-manager-$VERSION.tar.gz
rpmbuild --sign --clean --rmsource -bb ../lam-packaging/RPM/ldap-account-manager-fedora.spec
mv /usr/src/rpm/RPMS/noarch/ldap-account-manager*-$VERSION-1*.noarch.rpm RPM/
cd ..
# Suse RPM
perl -pi -e "s/\\@\\@DISTRIBUTION\\@\\@/suse/g" lam-packaging/RPM/ldap-account-manager-suse.spec
perl -pi -e "s/\\@\\@USER\\@\\@/wwwrun/g" lam-packaging/RPM/ldap-account-manager-suse.spec
perl -pi -e "s/\\@\\@GROUP\\@\\@/www/g" lam-packaging/RPM/ldap-account-manager-suse.spec
cp ldap-account-manager-$VERSION.tar.gz /usr/src/rpm/SOURCES
rpmbuild --sign --clean --rmsource -bb lam-packaging/RPM/ldap-account-manager-suse.spec
mv /usr/src/rpm/RPMS/noarch/ldap-account-manager*-$VERSION-1*.noarch.rpm RPM/
# Suse RPM for LAM Pro
cd LAMPro
cp ldap-account-manager-$VERSION.tar.gz /usr/src/rpm/SOURCES/ldap-account-manager-$VERSION.tar.gz
rpmbuild --sign --clean --rmsource -bb ../lam-packaging/RPM/ldap-account-manager-suse.spec
mv /usr/src/rpm/RPMS/noarch/ldap-account-manager*-$VERSION-1*.noarch.rpm RPM/
cd ..
# clean up
rm -r lam-packaging
rm getVersion
rm buildPackages