Merge branch 'update_do_debian_release' into storageareas
This commit is contained in:
commit
01e75a746d
|
@ -12,44 +12,78 @@ fi
|
||||||
DATE=`date -R`
|
DATE=`date -R`
|
||||||
DISTRO=$1
|
DISTRO=$1
|
||||||
SNAPSHOT=$2
|
SNAPSHOT=$2
|
||||||
if [ "$SNAPSHOT" == "stable" ]; then
|
|
||||||
SNAPSHOT="";
|
|
||||||
fi;
|
|
||||||
|
|
||||||
|
|
||||||
TYPE=$3
|
TYPE=$3
|
||||||
if [ "$TYPE" == "" ]; then
|
if [ "$TYPE" == "" ]; then
|
||||||
TYPE="source";
|
echo "Defaulting to source build"
|
||||||
|
TYPE="source";
|
||||||
fi;
|
fi;
|
||||||
BRANCH=$4
|
BRANCH=$4
|
||||||
|
GITHUB_FORK=$5
|
||||||
|
if [ "$GITHUB_FORK" == "" ]; then
|
||||||
if [ ! -d 'zoneminder_release' ]; then
|
echo "Defaulting to ZoneMinder upstream git"
|
||||||
git clone https://github.com/ZoneMinder/ZoneMinder.git zoneminder_release
|
GITHUB_FORK="ZoneMinder"
|
||||||
fi;
|
fi;
|
||||||
if [ "$BRANCH" != "" ]; then
|
|
||||||
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
|
if [ "$SNAPSHOT" == "stable" ]; then
|
||||||
git checkout $BRANCH
|
if [ "$BRANCH" == "" ]; then
|
||||||
cd ../
|
BRANCH=$(git describe --tags $(git rev-list --tags --max-count=1));
|
||||||
|
echo "Latest stable branch is $BRANCH";
|
||||||
|
fi;
|
||||||
|
else
|
||||||
|
if [ "$BRANCH" == "" ]; then
|
||||||
|
echo "Defaulting to master branch";
|
||||||
|
BRANCH="master";
|
||||||
|
fi;
|
||||||
fi;
|
fi;
|
||||||
VERSION=`cat zoneminder_release/version`
|
|
||||||
|
# Instead of cloning from github each time, if we have a fork lying around, update it and pull from there instead.
|
||||||
|
if [ ! -d "${GITHUB_FORK}_zoneminder_release" ]; then
|
||||||
|
if [ -d "${GITHUB_FORK}_ZoneMinder.git" ]; then
|
||||||
|
echo "Using local clone ${GITHUB_FORK}_ZoneMinder.git to pull from."
|
||||||
|
cd "${GITHUB_FORK}_ZoneMinder.git"
|
||||||
|
echo "git checkout $BRANCH"
|
||||||
|
git checkout $BRANCH
|
||||||
|
echo "git pull..."
|
||||||
|
git pull
|
||||||
|
cd ../
|
||||||
|
echo "git clone ${GITHUB_FORK}_ZoneMinder.git ${GITHUB_FORK}_zoneminder_release"
|
||||||
|
git clone "${GITHUB_FORK}_ZoneMinder.git" "${GITHUB_FORK}_zoneminder_release"
|
||||||
|
else
|
||||||
|
echo "git clone https://github.com/$GITHUB_FORK/ZoneMinder.git ${GITHUB_FORK}_zoneminder_release"
|
||||||
|
git clone "https://github.com/$GITHUB_FORK/ZoneMinder.git" "${GITHUB_FORK}_zoneminder_release"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "release dir already exists. Please remove it."
|
||||||
|
exit 0;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
cd "${GITHUB_FORK}_zoneminder_release"
|
||||||
|
git checkout $BRANCH
|
||||||
|
cd ../
|
||||||
|
|
||||||
|
VERSION=`cat ${GITHUB_FORK}_zoneminder_release/version`
|
||||||
if [ $VERSION == "" ]; then
|
if [ $VERSION == "" ]; then
|
||||||
exit 1;
|
exit 1;
|
||||||
fi;
|
fi;
|
||||||
echo "Doing $TYPE release zoneminder_$VERSION-$DISTRO-$SNAPSHOT";
|
DIRECTORY="zoneminder_$VERSION-$DISTRO";
|
||||||
mv zoneminder_release zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig
|
if [ "$SNAPSHOT" != "stable" ] && [ "$SNAPSHOT" != "" ]; then
|
||||||
cd zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig
|
DIRECTORY="$DIRECTORY-$SNAPSHOT";
|
||||||
|
fi;
|
||||||
|
echo "Doing $TYPE release $DIRECTORY";
|
||||||
|
mv "${GITHUB_FORK}_zoneminder_release" "$DIRECTORY.orig";
|
||||||
|
cd "$DIRECTORY.orig";
|
||||||
|
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
if [ $DISTRO == "trusty" ]; then
|
if [ $DISTRO == "trusty" ] || [ $DISTRO == "precise" ]; then
|
||||||
ln -sf distros/ubuntu1204 debian
|
ln -sf distros/ubuntu1204 debian
|
||||||
else
|
else
|
||||||
ln -sf distros/ubuntu1604 debian
|
if [ $DISTRO == "wheezy" ]; then
|
||||||
|
ln -sf distros/debian debian
|
||||||
|
else
|
||||||
|
ln -sf distros/ubuntu1604 debian
|
||||||
|
fi;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
# Auto-install all ZoneMinder's depedencies using the Debian control file
|
# Auto-install all ZoneMinder's depedencies using the Debian control file
|
||||||
|
@ -62,14 +96,25 @@ else
|
||||||
AUTHOR="`getent passwd $USER | cut -d ':' -f 5 | cut -d ',' -f 1` <`whoami`@`hostname`>"
|
AUTHOR="`getent passwd $USER | cut -d ':' -f 5 | cut -d ',' -f 1` <`whoami`@`hostname`>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$SNAPSHOT" == "stable" ]; then
|
||||||
|
cat <<EOF > debian/changelog
|
||||||
|
zoneminder ($VERSION-$DISTRO) $DISTRO; urgency=medium
|
||||||
|
|
||||||
|
* Release $VERSION
|
||||||
|
|
||||||
|
-- $AUTHOR <iconnor@connortechnology.com> $DATE
|
||||||
|
|
||||||
|
EOF
|
||||||
|
else
|
||||||
cat <<EOF > debian/changelog
|
cat <<EOF > debian/changelog
|
||||||
zoneminder ($VERSION-$DISTRO-$SNAPSHOT) $DISTRO; urgency=medium
|
zoneminder ($VERSION-$DISTRO-$SNAPSHOT) $DISTRO; urgency=medium
|
||||||
|
|
||||||
*
|
*
|
||||||
|
|
||||||
-- $AUTHOR $DATE
|
-- $AUTHOR <iconnor@connortechnology.com> $DATE
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
fi;
|
||||||
#rm -rf .git
|
#rm -rf .git
|
||||||
#rm .gitignore
|
#rm .gitignore
|
||||||
#cd ../
|
#cd ../
|
||||||
|
@ -78,18 +123,44 @@ EOF
|
||||||
if [ $TYPE == "binary" ]; then
|
if [ $TYPE == "binary" ]; then
|
||||||
debuild
|
debuild
|
||||||
else
|
else
|
||||||
if [ $TYPE == "local" ]; then
|
if [ $TYPE == "local" ]; then
|
||||||
debuild -i -us -uc -b
|
debuild -i -us -uc -b
|
||||||
else
|
else
|
||||||
debuild -S -sa
|
debuild -S -sa
|
||||||
fi;
|
fi;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
cd ../
|
cd ../
|
||||||
|
|
||||||
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 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"; }
|
[[ $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"; }
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|
||||||
|
if [ $TYPE == "binary" ]; then
|
||||||
|
echo "Not doing dput since it's a binary release. Do you want to install it? (Y/N)"
|
||||||
|
read install
|
||||||
|
if [ "$install" == "Y" ]; then
|
||||||
|
sudo dpkg -i $DIRECTORY*.deb
|
||||||
|
fi;
|
||||||
|
else
|
||||||
|
SC="";
|
||||||
|
PPA="";
|
||||||
|
if [ "$SNAPSHOT" == "stable" ]; then
|
||||||
|
PPA="ppa:iconnor/zoneminder";
|
||||||
|
SC="zoneminder_${VERSION}-${DISTRO}_source.changes";
|
||||||
|
else
|
||||||
|
SC="zoneminder_${VERSION}-${DISTRO}-${SNAPSHOT}_source.changes";
|
||||||
|
if [ "$BRANCH" == "" ]; then
|
||||||
|
PPA="ppa:iconnor/zoneminder-master";
|
||||||
|
else
|
||||||
|
PPA="ppa:iconnor/zoneminder-$BRANCH";
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
echo "Ready to dput $SC to $PPA ? Y/N...";
|
||||||
|
read dput
|
||||||
|
if [ "$dput" == "Y" -o "$dput" == "y" ]; then
|
||||||
|
dput $PPA $SC
|
||||||
|
fi;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue