Merge ../ZoneMinder.connortechnology

This commit is contained in:
Isaac Connor 2017-06-09 10:46:46 -04:00
commit ccfa2da00b
1 changed files with 58 additions and 31 deletions

View File

@ -63,6 +63,8 @@ DATE=`date -R`
if [ "$TYPE" == "" ]; then if [ "$TYPE" == "" ]; then
echo "Defaulting to source build" echo "Defaulting to source build"
TYPE="source"; TYPE="source";
else
echo "Doing $TYPE build"
fi; fi;
if [ "$DISTRO" == "" ]; then if [ "$DISTRO" == "" ]; then
@ -81,6 +83,8 @@ if [ "$RELEASE" != "" ]; then
if [ "$GITHUB_FORK" != "" ] && [ "$GITHUB_FORK" != "ZoneMinder" ]; then if [ "$GITHUB_FORK" != "" ] && [ "$GITHUB_FORK" != "ZoneMinder" ]; then
echo "Releases cannot have a fork ($GITHUB_FORK).... exiting." echo "Releases cannot have a fork ($GITHUB_FORK).... exiting."
exit 0; exit 0;
else
GITHUB_FORK="ZoneMinder";
fi fi
BRANCH="release-$RELEASE" BRANCH="release-$RELEASE"
else else
@ -129,11 +133,7 @@ else
fi; fi;
cd "${GITHUB_FORK}_zoneminder_release" cd "${GITHUB_FORK}_zoneminder_release"
if [ $RELEASE ]; then
git checkout $RELEASE
else
git checkout $BRANCH git checkout $BRANCH
fi;
cd ../ cd ../
VERSION=`cat ${GITHUB_FORK}_zoneminder_release/version` VERSION=`cat ${GITHUB_FORK}_zoneminder_release/version`
@ -148,6 +148,11 @@ fi;
DIRECTORY="zoneminder_$VERSION"; DIRECTORY="zoneminder_$VERSION";
echo "Doing $TYPE release $DIRECTORY"; echo "Doing $TYPE release $DIRECTORY";
mv "${GITHUB_FORK}_zoneminder_release" "$DIRECTORY.orig"; mv "${GITHUB_FORK}_zoneminder_release" "$DIRECTORY.orig";
if [ $? -ne 0 ]; then
echo "Error status code is: $?"
echo "Setting up build dir failed.";
exit $?;
fi;
cd "$DIRECTORY.orig"; cd "$DIRECTORY.orig";
git submodule init git submodule init
@ -185,6 +190,13 @@ zoneminder ($VERSION-$DISTRO${PACKAGE_VERSION}) $DISTRO; urgency=$URGENCY
-- $AUTHOR $DATE -- $AUTHOR $DATE
EOF EOF
cat <<EOF > debian/NEWS
zoneminder ($VERSION-$DISTRO${PACKAGE_VERSION}) $DISTRO; urgency=$URGENCY
* Release $VERSION
-- $AUTHOR $DATE
EOF
else else
cat <<EOF > debian/changelog cat <<EOF > debian/changelog
zoneminder ($VERSION-$DISTRO${PACKAGE_VERSION}) $DISTRO; urgency=$URGENCY zoneminder ($VERSION-$DISTRO${PACKAGE_VERSION}) $DISTRO; urgency=$URGENCY
@ -192,7 +204,13 @@ zoneminder ($VERSION-$DISTRO${PACKAGE_VERSION}) $DISTRO; urgency=$URGENCY
* *
-- $AUTHOR $DATE -- $AUTHOR $DATE
EOF
cat <<EOF > debian/changelog
zoneminder ($VERSION-$DISTRO${PACKAGE_VERSION}) $DISTRO; urgency=$URGENCY
*
-- $AUTHOR $DATE
EOF EOF
fi; fi;
@ -216,6 +234,7 @@ else
echo "Status: $?" echo "Status: $?"
DEBUILD="debuild -i -us -uc -b" DEBUILD="debuild -i -us -uc -b"
else else
# Source build, don't need build depends.
DEBUILD="debuild -S -sa" DEBUILD="debuild -S -sa"
fi; fi;
fi; fi;
@ -232,24 +251,32 @@ fi;
cd ../ cd ../
if [ "$INTERACTIVE" != "no" ]; then if [ "$INTERACTIVE" != "no" ]; then
read -p "Do you want to keep the checked out version of Zoneminder (incase you want to modify it later) [y/N]" read -p "Do you want to keep the checked out version of Zoneminder (incase you want to modify it later) [y/N]"
[[ $REPLY == [yY] ]] && { mv $DIRECTORY zoneminder_release; echo "The checked out copy is preserved in zoneminder_release"; } || { rm -fr $DIRECTORY; echo "The checked out copy has been deleted"; } [[ $REPLY == [yY] ]] && { mv "$DIRECTORY.orig" zoneminder_release; echo "The checked out copy is preserved in zoneminder_release"; } || { rm -fr "$DIRECTORY.orig"; echo "The checked out copy has been deleted"; }
echo "Done!" echo "Done!"
else else
rm -fr $DIRECTORY; echo "The checked out copy has been deleted"; rm -fr "$DIRECTORY.orig"; echo "The checked out copy has been deleted";
fi fi
if [ $TYPE == "binary" ]; then if [ $TYPE == "binary" ]; then
if [ "$INTERACTIVE" != "no" ]; then if [ "$INTERACTIVE" != "no" ]; then
echo "Not doing dput since it's a binary release. Do you want to install it? (Y/N)" read -p "Not doing dput since it's a binary release. Do you want to install it? (Y/N)"
read install if [[ $REPLY == [yY] ]]; then
if [ "$install" == "Y" ]; then
sudo dpkg -i $DIRECTORY*.deb sudo dpkg -i $DIRECTORY*.deb
else
echo $REPLY;
fi; fi;
if [ "$DISTRO" == "jessie" ]; then if [ "$DISTRO" == "jessie" ]; then
echo "Do you want to upload this binary to zmrepo? (y/N)" read -p "Do you want to upload this binary to zmrepo? (y/N)"
read install if [[ $REPLY == [yY] ]]; then
if [ "$install" == "Y" ]; then if [ "$RELEASE" != "" ]; then
scp "zoneminder_*-${VERSION}-${DISTRO}*" "zmrepo@zmrepo.connortechnology.com:debian/${BRANCH}/mini-dinstall/incoming/" scp "zoneminder_${VERSION}-${DISTRO}*" "zmrepo@zmrepo.connortechnology.com:debian/stable/mini-dinstall/incoming/"
else
if [ "$BRANCH" == "" ]; then
scp "zoneminder_${VERSION}-${DISTRO}*" "zmrepo@zmrepo.connortechnology.com:debian/master/mini-dinstall/incoming/"
else
scp "$DIRECTORY-${DISTRO}*" "zmrepo@zmrepo.connortechnology.com:debian/${BRANCH}/mini-dinstall/incoming/"
fi;
fi;
fi; fi;
fi; fi;
fi; fi;
@ -271,7 +298,7 @@ else
echo "Ready to dput $SC to $PPA ? Y/N..."; echo "Ready to dput $SC to $PPA ? Y/N...";
read dput read dput
fi fi
if [ "$dput" == "Y" -o "$dput" == "y" ]; then if [ "$dput" == [Yy] ]; then
dput $PPA $SC dput $PPA $SC
fi; fi;
fi; fi;