LDAPAccountManager/lam-packaging/buildPackages

236 lines
7.5 KiB
Plaintext
Raw Normal View History

2006-01-20 16:40:30 +00:00
#!/bin/bash
#
2016-03-25 11:50:28 +00:00
# Builds LDAP Account Manager packages.
2006-01-20 16:40:30 +00:00
if [ $# -lt 1 ]
then
2017-10-15 08:53:07 +00:00
echo -e "Usage: buildPackage <tag>, buildPackage develop, buildPackage -b branch"
2006-01-20 16:40:30 +00:00
exit
fi
2010-02-13 18:02:24 +00:00
set -e
2006-01-20 16:40:30 +00:00
cd /daten/projekte/lam/pakete
2016-03-25 11:50:28 +00:00
if [ "$1" = "develop" ]
2013-01-19 18:53:28 +00:00
then
2016-03-25 11:50:28 +00:00
export REPO_BRANCH="develop"
2017-10-15 08:53:07 +00:00
elif [ "$1" = "-b" ]
then
export REPO_BRANCH="$2"
2013-01-19 18:53:28 +00:00
else
2018-06-20 07:50:45 +00:00
export REPO_BRANCH="$1"
2013-01-19 18:53:28 +00:00
fi
2006-01-20 16:40:30 +00:00
2014-03-08 10:34:47 +00:00
# minifies the JavaScript files
function minify {
local dir="$1"
2014-03-08 13:26:51 +00:00
echo "Minify JS files in $dir"
2017-12-13 15:47:52 +00:00
local outFile=$dir/100_lam.${VERSION}.min.js
2014-03-08 13:26:51 +00:00
local files=`ls $dir/*.js`
2017-12-13 15:47:52 +00:00
local jsFiles=""
2014-03-08 13:26:51 +00:00
for file in $files; do
2018-12-10 16:53:38 +00:00
jsFiles="$jsFiles $file"
2014-03-08 13:26:51 +00:00
done
2018-12-10 16:53:38 +00:00
uglifyjs -o $outFile $jsFiles
2017-12-13 15:47:52 +00:00
rm $files
# add final new line to supress Debian warnings
echo "" >> $outFile
2014-03-08 10:34:47 +00:00
}
2016-08-27 20:28:37 +00:00
# minifies the CSS files
function minifyCSS {
local dir="$1"
echo "Minify CSS files in $dir"
2017-12-13 15:47:52 +00:00
local outFile=$dir/100_lam.${VERSION}.min.css
2016-08-27 20:28:37 +00:00
local files=`ls $dir/*.css`
2019-12-08 17:41:33 +00:00
cat $files | cleancss --skip-rebase -o $outFile
2017-12-13 15:47:52 +00:00
rm $files
# add final new line to supress Debian warnings
echo "" >> $outFile
2016-08-27 20:28:37 +00:00
}
2016-03-25 11:50:28 +00:00
echo "Getting files..."
2020-01-16 19:38:45 +00:00
git clone --depth 1 -b $REPO_BRANCH --single-branch git@github.com:LDAPAccountManager/lam.git github
2016-03-25 11:50:28 +00:00
cd github
mv lam ../
mv lam-packaging ../
cd ..
rm -rf github
2013-05-12 09:13:59 +00:00
2020-01-16 19:38:45 +00:00
git clone --depth 1 -b $REPO_BRANCH --single-branch git@gitlab.com:LDAPAccountManager/lamPro.git lamPro
2016-08-27 10:05:24 +00:00
cd lamPro
rm -rf .git
2019-07-16 10:12:39 +00:00
rm -rf docker
2016-03-25 11:50:28 +00:00
cd ..
2006-01-20 16:40:30 +00:00
cp lam-packaging/getVersion ./
export VERSION=`./getVersion`
# remove files which are not in the final release
rm -r lam/po
rm -r lam/tests
2017-11-27 17:34:20 +00:00
rm lam/lib/3rdParty/tcpdf/fonts/*.ttf
2013-01-19 18:53:28 +00:00
find . -name .svnignore -exec rm {} \;
2016-03-25 11:50:28 +00:00
find . -name .gitignore -exec rm {} \;
2006-01-20 16:40:30 +00:00
mv lam ldap-account-manager-$VERSION
2009-11-07 18:38:19 +00:00
# create LAM manual
cd ldap-account-manager-$VERSION/docs/manual-sources
./make.sh
cd ../../..
rm -r ldap-account-manager-$VERSION/docs/manual-sources
2007-01-14 18:43:19 +00:00
# create LAM Pro build directory
2006-07-30 13:36:18 +00:00
mkdir LAMPro
2008-02-04 22:23:51 +00:00
cp -a ldap-account-manager-$VERSION LAMPro/ldap-account-manager-$VERSION
2007-11-06 17:27:11 +00:00
cp -a lamPro/* LAMPro/ldap-account-manager-$VERSION
rm -r lamPro
2006-07-30 13:36:18 +00:00
2014-03-08 10:34:47 +00:00
# create Debian build dirs
mkdir Debian
mkdir LAMPro/Debian
2013-05-12 09:13:59 +00:00
rm ldap-account-manager-$VERSION/phpdoc.sh
rm LAMPro/ldap-account-manager-$VERSION/phpdoc.sh
2008-02-04 22:23:51 +00:00
2013-07-23 18:29:53 +00:00
# tar.bz2
2006-03-09 19:07:46 +00:00
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
2006-03-09 19:07:46 +00:00
autoconf
rm -r autom4te.cache
2006-03-09 19:07:46 +00:00
cd ..
2017-04-02 13:35:06 +00:00
# Debian gets orig.tar.bz2 with original JS files
2014-03-08 10:34:47 +00:00
tar cfj ldap-account-manager-$VERSION.tar.bz2 --owner=root --group=root --mtime=now ldap-account-manager-$VERSION
mv ldap-account-manager-$VERSION.tar.bz2 Debian/ldap-account-manager_$VERSION.orig.tar.bz2
2014-03-08 13:26:51 +00:00
cp -ar ldap-account-manager-$VERSION Debian/
2014-03-08 10:34:47 +00:00
# build other packages with minified JS files
2014-03-08 13:26:51 +00:00
minify ldap-account-manager-$VERSION/templates/lib
2016-08-27 20:28:37 +00:00
minifyCSS ldap-account-manager-$VERSION/style
2013-07-23 18:29:53 +00:00
tar cfj ldap-account-manager-$VERSION.tar.bz2 --owner=root --group=root --mtime=now ldap-account-manager-$VERSION
2014-03-08 13:26:51 +00:00
rm -r ldap-account-manager-$VERSION
2006-07-30 13:36:18 +00:00
2013-07-23 18:29:53 +00:00
# tar.bz2 of LAM Pro
2006-07-30 13:36:18 +00:00
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 -r autom4te.cache
cd ..
2017-04-02 13:35:06 +00:00
# Debian gets orig.tar.bz2 with original JS files
2014-03-08 10:34:47 +00:00
tar cfj ldap-account-manager-$VERSION.tar.bz2 --owner=root --group=root --mtime=now ldap-account-manager-$VERSION
mv ldap-account-manager-$VERSION.tar.bz2 Debian/ldap-account-manager_$VERSION.orig.tar.bz2
2014-03-08 13:26:51 +00:00
cp -ar ldap-account-manager-$VERSION Debian/
2014-03-08 10:34:47 +00:00
# build other packages with minified JS files
2014-03-08 13:26:51 +00:00
minify ldap-account-manager-$VERSION/templates/lib
2016-08-27 20:28:37 +00:00
minifyCSS ldap-account-manager-$VERSION/style
2013-07-23 18:29:53 +00:00
tar cfj ldap-account-manager-$VERSION.tar.bz2 --owner=root --group=root --mtime=now ldap-account-manager-$VERSION
2014-03-08 13:26:51 +00:00
rm -r ldap-account-manager-$VERSION
2006-07-30 13:36:18 +00:00
cd ..
2006-01-20 16:40:30 +00:00
# Debian
cp -r lam-packaging/debian Debian/ldap-account-manager-$VERSION/
2019-09-29 07:43:16 +00:00
cp -ar Debian Debian-Upload
2006-01-20 16:40:30 +00:00
cd Debian/ldap-account-manager-$VERSION
2020-02-22 12:29:06 +00:00
debuild -k478730308FBD512ADF09D38E7F3D136B2BCD7990
2006-01-20 16:40:30 +00:00
cd ..
rm -r ldap-account-manager-$VERSION
cd ..
2019-09-29 07:43:16 +00:00
cd Debian-Upload/ldap-account-manager-$VERSION
2020-02-22 12:29:06 +00:00
debuild -S -k478730308FBD512ADF09D38E7F3D136B2BCD7990
2019-09-29 07:43:16 +00:00
cd ..
rm -r ldap-account-manager-$VERSION
cd ..
2006-01-20 16:40:30 +00:00
2006-07-30 13:36:18 +00:00
# Debian for LAM Pro
cd LAMPro
cp -r ../lam-packaging/debian Debian/ldap-account-manager-$VERSION/
cd Debian/ldap-account-manager-$VERSION
2020-02-22 12:29:06 +00:00
debuild -k478730308FBD512ADF09D38E7F3D136B2BCD7990
2006-07-30 13:36:18 +00:00
cd ..
rm -r ldap-account-manager-$VERSION
cd ..
cd ..
2006-01-20 16:40:30 +00:00
# RPM
perl -pi -e "s/\\@\\@VERSION\\@\\@/$VERSION/g" lam-packaging/RPM/ldap-account-manager.spec
2008-08-03 19:08:27 +00:00
2008-07-29 18:29:24 +00:00
cp lam-packaging/RPM/ldap-account-manager.spec lam-packaging/RPM/ldap-account-manager-fedora.spec
2008-08-03 18:03:48 +00:00
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
2011-06-08 18:12:50 +00:00
perl -pi -e "s/\\@\\@HTTP_CONF_DIR\\@\\@/\\/etc\\/httpd\\/conf.d/g" lam-packaging/RPM/ldap-account-manager-fedora.spec
2008-08-03 19:08:27 +00:00
2008-07-29 18:29:24 +00:00
cp lam-packaging/RPM/ldap-account-manager.spec lam-packaging/RPM/ldap-account-manager-suse.spec
2008-08-03 18:03:48 +00:00
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
2011-06-08 18:12:50 +00:00
perl -pi -e "s/\\@\\@HTTP_CONF_DIR\\@\\@/\\/etc\\/apache2\\/conf.d/g" lam-packaging/RPM/ldap-account-manager-suse.spec
2008-08-03 19:08:27 +00:00
2008-07-29 18:43:22 +00:00
mkdir RPM
mkdir LAMPro/RPM
2008-07-29 18:29:24 +00:00
2008-08-03 19:08:27 +00:00
2008-07-29 18:29:24 +00:00
# Fedora RPM
2013-07-23 18:29:53 +00:00
cp ldap-account-manager-$VERSION.tar.bz2 ~/rpmbuild/SOURCES
2011-06-11 12:51:01 +00:00
cp lam-packaging/RPM/lam.apache.conf ~/rpmbuild/SOURCES
2014-09-14 19:59:43 +00:00
cp lam-packaging/RPM/lam.nginx.conf ~/rpmbuild/SOURCES
2017-09-28 16:21:10 +00:00
rpmbuild --clean --rmsource -bb lam-packaging/RPM/ldap-account-manager-fedora.spec
2009-08-05 18:01:26 +00:00
mv ~/rpmbuild/RPMS/noarch/ldap-account-manager*-$VERSION-*1.noarch.rpm RPM/
2008-07-29 18:29:24 +00:00
# Fedora RPM for LAM Pro
cd LAMPro
2013-07-23 18:29:53 +00:00
cp ldap-account-manager-$VERSION.tar.bz2 ~/rpmbuild/SOURCES/ldap-account-manager-$VERSION.tar.bz2
2011-06-11 13:51:02 +00:00
cp ../lam-packaging/RPM/lam.apache.conf ~/rpmbuild/SOURCES
2014-09-14 19:59:43 +00:00
cp ../lam-packaging/RPM/lam.nginx.conf ~/rpmbuild/SOURCES
2017-09-28 16:21:10 +00:00
rpmbuild --clean --rmsource -bb ../lam-packaging/RPM/ldap-account-manager-fedora.spec
2009-08-05 18:01:26 +00:00
mv ~/rpmbuild/RPMS/noarch/ldap-account-manager*-$VERSION-*1.noarch.rpm RPM/
2008-07-29 18:29:24 +00:00
cd ..
# Suse RPM
2013-07-23 18:29:53 +00:00
cp ldap-account-manager-$VERSION.tar.bz2 ~/rpmbuild/SOURCES
2011-06-11 12:51:01 +00:00
cp lam-packaging/RPM/lam.apache.conf ~/rpmbuild/SOURCES
2014-09-14 19:59:43 +00:00
cp lam-packaging/RPM/lam.nginx.conf ~/rpmbuild/SOURCES
2017-09-28 16:21:10 +00:00
rpmbuild --clean --rmsource -bb lam-packaging/RPM/ldap-account-manager-suse.spec
2009-08-05 18:01:26 +00:00
mv ~/rpmbuild/RPMS/noarch/ldap-account-manager*-$VERSION-*1.noarch.rpm RPM/
2006-01-20 16:40:30 +00:00
2008-07-29 18:29:24 +00:00
# Suse RPM for LAM Pro
2006-07-30 13:36:18 +00:00
cd LAMPro
2013-07-23 18:29:53 +00:00
cp ldap-account-manager-$VERSION.tar.bz2 ~/rpmbuild/SOURCES/ldap-account-manager-$VERSION.tar.bz2
2011-06-11 13:51:02 +00:00
cp ../lam-packaging/RPM/lam.apache.conf ~/rpmbuild/SOURCES
2014-09-14 19:59:43 +00:00
cp ../lam-packaging/RPM/lam.nginx.conf ~/rpmbuild/SOURCES
2017-09-28 16:21:10 +00:00
rpmbuild --clean --rmsource -bb ../lam-packaging/RPM/ldap-account-manager-suse.spec
2009-08-05 18:01:26 +00:00
mv ~/rpmbuild/RPMS/noarch/ldap-account-manager*-$VERSION-*1.noarch.rpm RPM/
2006-07-30 13:36:18 +00:00
cd ..
2017-09-28 16:21:10 +00:00
rpmsign --addsign RPM/*.rpm LAMPro/RPM/*.rpm
2013-07-23 18:57:46 +00:00
# generate checksum files
sha256sum *.tar.bz2 >> checksums.txt
cd RPM
sha256sum *.rpm >> ../checksums.txt
cd ../Debian
sha256sum *.deb >> ../checksums.txt
cd ..
# generate checksum files for LAM Pro
cd LAMPro
sha256sum *.tar.bz2 >> checksums.txt
cd RPM
sha256sum *.rpm >> ../checksums.txt
cd ../Debian
sha256sum *.deb >> ../checksums.txt
cd ../..
2006-01-20 16:40:30 +00:00
# clean up
rm -r lam-packaging
rm getVersion
2013-09-16 18:17:14 +00:00
rm -f *.log