Merge pull request #1244 from pliablepixels/do_debian_package-mods

Do debian package mods
This commit is contained in:
Isaac Connor 2016-01-22 09:02:14 -05:00
commit b2c311c306
1 changed files with 23 additions and 3 deletions

View File

@ -1,4 +1,14 @@
#!/bin/bash #!/bin/bash
if [ "$1" == "clean" ]; then
read -p "Do you really want to delete existing packages? [y/N]"
[[ $REPLY == [yY] ]] && { rm -fr zoneminder*.build zoneminder*.changes zoneminder*.deb; echo "Existing package files deleted"; } || { echo "Packages have NOT been deleted"; }
exit;
fi
DATE=`date -R` DATE=`date -R`
DISTRO=$1 DISTRO=$1
SNAPSHOT=$2 SNAPSHOT=$2
@ -6,17 +16,24 @@ if [ "$SNAPSHOT" == "stable" ]; then
SNAPSHOT=""; SNAPSHOT="";
fi; fi;
TYPE=$3 TYPE=$3
if [ "$TYPE" == "" ]; then if [ "$TYPE" == "" ]; then
TYPE="source"; TYPE="source";
fi; fi;
BRANCH=$4 BRANCH=$4
if [ ! -d 'zoneminder_release' ]; then if [ ! -d 'zoneminder_release' ]; then
git clone https://github.com/ZoneMinder/ZoneMinder.git zoneminder_release git clone https://github.com/ZoneMinder/ZoneMinder.git zoneminder_release
fi; fi;
if [ "$BRANCH" != "" ]; then if [ "$BRANCH" != "" ]; then
cd zoneminder_release cd zoneminder_release
if [ "$BRANCH" == "stable" ]; then
BRANCH=$(git describe --tags $(git rev-list --tags --max-count=1));
echo "Latest stable branch is $BRANCH";
fi
git checkout $BRANCH git checkout $BRANCH
cd ../ cd ../
fi; fi;
@ -59,7 +76,10 @@ else
fi; fi;
cd ../ cd ../
echo "about to delete zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig. Hit enter to continue."
read delete read -p "Do you want to keep the checked out version of Zoneminder (incase you want to modify it later) [y/N]"
rm -fr zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig [[ $REPLY == [yY] ]] && { mv zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig zoneminder_release; echo "The checked out copy is preserved in zoneminder_release"; } || { rm -fr zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig; echo "The checked out copy has been deleted"; }
echo "Done!"