zoneminder/utils/do_debian_package.sh

72 lines
1.5 KiB
Bash
Raw Normal View History

2015-08-21 08:35:01 +08:00
#!/bin/bash
DATE=`date -R`
DISTRO=$1
SNAPSHOT=$2
2016-01-05 22:04:04 +08:00
if [ "$SNAPSHOT" == "stable" ]; then
SNAPSHOT="";
fi;
2015-08-21 08:35:01 +08:00
TYPE=$3
if [ "$TYPE" == "" ]; then
TYPE="source";
fi;
2016-01-05 22:04:04 +08:00
BRANCH=$4
2015-08-21 08:35:01 +08:00
if [ ! -d 'zoneminder_release' ]; then
2016-01-05 22:04:04 +08:00
git clone https://github.com/ZoneMinder/ZoneMinder.git zoneminder_release
fi;
if [ "$BRANCH" != "" ]; then
cd zoneminder_release
git checkout $BRANCH
cd ../
2015-08-21 08:35:01 +08:00
fi;
VERSION=`cat zoneminder_release/version`
if [ $VERSION == "" ]; then
2016-01-05 22:04:04 +08:00
exit 1;
2015-08-21 08:35:01 +08:00
fi;
echo "Doing $TYPE release zoneminder_$VERSION-$DISTRO-$SNAPSHOT";
mv zoneminder_release zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig
cd zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig
git submodule init
git submodule update --init --recursive
if [ $DISTRO == "trusty" ]; then
2016-01-05 22:04:04 +08:00
ln -sf distros/ubuntu1204_cmake debian
2015-08-21 08:35:01 +08:00
else
2016-01-05 22:04:04 +08:00
ln -sf distros/ubuntu1504_cmake debian
2015-08-21 08:35:01 +08:00
fi;
if [ $TYPE == "local" ] ; then
AUTHOR="`whoami` <`whoami`@`hostname`.local>"
else
AUTHOR="Isaac Connor <iconnor@connortechnology.com>"
fi
2015-08-21 08:35:01 +08:00
cat <<EOF > debian/changelog
zoneminder ($VERSION-$DISTRO-$SNAPSHOT) $DISTRO; urgency=medium
*
-- $AUTHOR $DATE
2015-08-21 08:35:01 +08:00
EOF
2016-01-05 22:04:04 +08:00
#rm -rf .git
#rm .gitignore
#cd ../
#tar zcf zoneminder_$VERSION-$DISTRO.orig.tar.gz zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig
#cd zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig
2015-08-21 08:35:01 +08:00
if [ $TYPE == "binary" ]; then
2016-01-05 22:04:04 +08:00
debuild
2015-08-21 08:35:01 +08:00
else
2016-01-19 10:39:33 +08:00
if [ $TYPE == "local" ]; then
debuild -i -us -uc -b
else
debuild -S -sa
fi;
2015-08-21 08:35:01 +08:00
fi;
2016-01-05 22:04:04 +08:00
2015-08-21 08:35:01 +08:00
cd ../
2016-01-05 22:04:04 +08:00
echo "about to delete zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig. Hit enter to continue."
read delete
2015-08-21 08:35:01 +08:00
rm -fr zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig
2016-01-05 22:04:04 +08:00