2017-01-16 22:36:46 +08:00
|
|
|
#!/bin/bash
|
2020-08-25 03:34:28 +08:00
|
|
|
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-01-16 05:48:57 +08:00
|
|
|
# packpack setup file for the ZoneMinder project
|
2017-01-15 04:14:41 +08:00
|
|
|
# Written by Andrew Bauer
|
|
|
|
|
2017-03-05 00:16:05 +08:00
|
|
|
###############
|
|
|
|
# SUBROUTINES #
|
|
|
|
###############
|
|
|
|
|
|
|
|
# General sanity checks
|
|
|
|
checksanity () {
|
|
|
|
# Check to see if this script has access to all the commands it needs
|
2020-01-06 04:30:33 +08:00
|
|
|
for CMD in set echo curl git ln mkdir rmdir cat patch sed; do
|
2017-03-05 00:16:05 +08:00
|
|
|
type $CMD 2>&1 > /dev/null
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo
|
|
|
|
echo "ERROR: The script cannot find the required command \"${CMD}\"."
|
|
|
|
echo
|
2017-03-04 23:44:42 +08:00
|
|
|
exit 1
|
2017-03-05 00:16:05 +08:00
|
|
|
fi
|
|
|
|
done
|
2019-09-24 01:10:14 +08:00
|
|
|
|
2017-03-05 00:16:05 +08:00
|
|
|
# Verify OS & DIST environment variables have been set before calling this script
|
2017-03-07 08:56:44 +08:00
|
|
|
if [ -z "${OS}" ] || [ -z "${DIST}" ]; then
|
2017-03-05 00:16:05 +08:00
|
|
|
echo "ERROR: both OS and DIST environment variables must be set"
|
|
|
|
exit 1
|
2017-02-17 21:07:17 +08:00
|
|
|
fi
|
2017-03-08 04:24:06 +08:00
|
|
|
|
|
|
|
if [ -z "${ARCH}" ]; then
|
|
|
|
ARCH="x86_64"
|
|
|
|
fi
|
|
|
|
|
2020-01-05 05:30:32 +08:00
|
|
|
if [[ "${ARCH}" != "x86_64" && "${ARCH}" != "i386" && "${ARCH}" != "armhf" && "${ARCH}" != "aarch64" ]]; then
|
2017-03-08 04:24:06 +08:00
|
|
|
echo
|
|
|
|
echo "ERROR: Unsupported architecture specified \"${ARCH}\"."
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-06-06 01:04:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Create key variables used to assemble the package name
|
|
|
|
createvars () {
|
|
|
|
# We need today's date in year/month/day format
|
|
|
|
thedate=$(date +%Y%m%d)
|
|
|
|
|
|
|
|
# We need the (short) commit hash of the latest commit (rpm packaging only)
|
|
|
|
shorthash=$(git describe --long --always | awk -F - '{print $3}')
|
|
|
|
|
|
|
|
# Grab the ZoneMinder version from the contents of the version file
|
|
|
|
versionfile=$(cat version)
|
|
|
|
|
|
|
|
# git the latest (short) commit hash of the version file
|
|
|
|
versionhash=$(git log -n1 --pretty=format:%h version)
|
2017-03-08 04:24:06 +08:00
|
|
|
|
2017-06-06 01:04:29 +08:00
|
|
|
# Number of commits since the version file was last changed
|
|
|
|
numcommits=$(git rev-list ${versionhash}..HEAD --count)
|
2017-03-05 00:16:05 +08:00
|
|
|
}
|
2017-02-17 21:07:17 +08:00
|
|
|
|
2017-06-02 01:30:32 +08:00
|
|
|
# Check key variables before calling packpack
|
|
|
|
checkvars () {
|
|
|
|
|
2017-06-06 01:04:29 +08:00
|
|
|
for var in $thedate $shorthash $versionfile $versionhash $numcommits; do
|
|
|
|
if [ -z ${var} ]; then
|
|
|
|
echo
|
|
|
|
echo "FATAL: This script was unable to determine one or more key variables. Cannot continue."
|
|
|
|
echo
|
|
|
|
echo "VARIABLE DUMP"
|
|
|
|
echo "-------------"
|
|
|
|
echo
|
|
|
|
echo "thedate: ${thedate}"
|
|
|
|
echo "shorthash: ${shorthash}"
|
|
|
|
echo "versionfile: ${versionfile}"
|
|
|
|
echo "versionhash: ${versionhash}"
|
|
|
|
echo "numcommits: ${numcommits}"
|
|
|
|
echo
|
|
|
|
exit 98
|
|
|
|
fi
|
|
|
|
done
|
2017-06-02 01:30:32 +08:00
|
|
|
}
|
|
|
|
|
2017-03-05 00:16:05 +08:00
|
|
|
# Steps common to all builds
|
|
|
|
commonprep () {
|
|
|
|
mkdir -p build
|
|
|
|
if [ -e "packpack/Makefile" ]; then
|
|
|
|
echo "Checking packpack github repo for changes..."
|
|
|
|
git -C packpack pull origin master
|
2017-01-16 05:48:57 +08:00
|
|
|
else
|
2017-06-01 04:28:05 +08:00
|
|
|
echo "Cloning packpack github repo..."
|
2019-09-06 21:31:08 +08:00
|
|
|
git clone https://github.com/zoneminder/packpack.git packpack
|
2017-01-16 05:48:57 +08:00
|
|
|
fi
|
|
|
|
|
2018-04-19 08:21:14 +08:00
|
|
|
# The rpm specfile requires we download each submodule as a tarball then manually move it into place
|
2017-03-05 00:16:05 +08:00
|
|
|
# Might as well do this for Debian as well, rather than git submodule init
|
2020-11-12 22:59:32 +08:00
|
|
|
CRUDVER="3.2.0"
|
2017-03-05 00:16:05 +08:00
|
|
|
if [ -e "build/crud-${CRUDVER}.tar.gz" ]; then
|
|
|
|
echo "Found existing Crud ${CRUDVER} tarball..."
|
2017-01-16 05:48:57 +08:00
|
|
|
else
|
2017-03-05 00:16:05 +08:00
|
|
|
echo "Retrieving Crud ${CRUDVER} submodule..."
|
2020-11-12 22:59:32 +08:00
|
|
|
curl -L https://github.com/FriendsOfCake/crud/archive/v${CRUDVER}.tar.gz > build/crud-${CRUDVER}.tar.gz
|
2018-04-19 08:21:14 +08:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "ERROR: Crud tarball retreival failed..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
CEBVER="1.0-zm"
|
2018-04-20 09:01:31 +08:00
|
|
|
if [ -e "build/cakephp-enum-behavior-${CEBVER}.tar.gz" ]; then
|
2018-04-19 08:21:14 +08:00
|
|
|
echo "Found existing CakePHP-Enum-Behavior ${CEBVER} tarball..."
|
|
|
|
else
|
|
|
|
echo "Retrieving CakePHP-Enum-Behavior ${CEBVER} submodule..."
|
2018-04-20 09:23:17 +08:00
|
|
|
curl -L https://github.com/ZoneMinder/CakePHP-Enum-Behavior/archive/${CEBVER}.tar.gz > build/cakephp-enum-behavior-${CEBVER}.tar.gz
|
2017-03-05 00:16:05 +08:00
|
|
|
if [ $? -ne 0 ]; then
|
2018-04-21 10:12:15 +08:00
|
|
|
echo "ERROR: CakePHP-Enum-Behavior tarball retreival failed..."
|
2017-03-05 00:16:05 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2021-03-19 04:18:21 +08:00
|
|
|
|
2021-05-01 06:39:22 +08:00
|
|
|
RTSPVER="cd7fd49becad6010a1b8466bfebbd93999a39878"
|
2021-04-08 02:10:53 +08:00
|
|
|
if [ -e "build/RtspServer-${RTSPVER}.tar.gz" ]; then
|
2021-04-08 22:05:01 +08:00
|
|
|
echo "Found existing RtspServer ${RTSPVER} tarball..."
|
2021-03-19 04:18:21 +08:00
|
|
|
else
|
2021-04-08 02:10:53 +08:00
|
|
|
echo "Retrieving RTSP ${RTSPVER} submodule..."
|
|
|
|
curl -L https://github.com/ZoneMinder/RtspServer/archive/${RTSPVER}.tar.gz > build/RtspServer-${RTSPVER}.tar.gz
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "ERROR: RtspServer tarball retreival failed..."
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-03-19 04:18:21 +08:00
|
|
|
fi
|
2017-03-05 00:16:05 +08:00
|
|
|
}
|
|
|
|
|
2018-04-19 08:21:14 +08:00
|
|
|
# Uncompress the submodule tarballs and move them into place
|
2017-03-05 00:30:36 +08:00
|
|
|
movecrud () {
|
|
|
|
if [ -e "web/api/app/Plugin/Crud/LICENSE.txt" ]; then
|
|
|
|
echo "Crud plugin already installed..."
|
2019-09-24 01:10:14 +08:00
|
|
|
else
|
2017-03-05 00:30:36 +08:00
|
|
|
echo "Unpacking Crud plugin..."
|
|
|
|
tar -xzf build/crud-${CRUDVER}.tar.gz
|
|
|
|
rmdir web/api/app/Plugin/Crud
|
|
|
|
mv -f crud-${CRUDVER} web/api/app/Plugin/Crud
|
|
|
|
fi
|
2018-04-19 08:21:14 +08:00
|
|
|
if [ -e "web/api/app/Plugin/CakePHP-Enum-Behavior/readme.md" ]; then
|
|
|
|
echo "CakePHP-Enum-Behavior plugin already installed..."
|
2019-09-24 01:10:14 +08:00
|
|
|
else
|
2018-04-19 08:21:14 +08:00
|
|
|
echo "Unpacking CakePHP-Enum-Behavior plugin..."
|
|
|
|
tar -xzf build/cakephp-enum-behavior-${CEBVER}.tar.gz
|
|
|
|
rmdir web/api/app/Plugin/CakePHP-Enum-Behavior
|
2018-09-14 09:13:06 +08:00
|
|
|
mv -f CakePHP-Enum-Behavior-${CEBVER} web/api/app/Plugin/CakePHP-Enum-Behavior
|
2018-04-19 08:21:14 +08:00
|
|
|
fi
|
2021-03-19 04:18:21 +08:00
|
|
|
if [ -e "dep/RtspServer/CMakeLists.txt" ]; then
|
|
|
|
echo "RtspServer already installed..."
|
|
|
|
else
|
2021-04-08 02:10:53 +08:00
|
|
|
echo "Unpacking RtspServer..."
|
|
|
|
tar -xzf build/RtspServer-${RTSPVER}.tar.gz
|
|
|
|
rmdir dep/RtspServer
|
|
|
|
mv -f RtspServer-${RTSPVER} dep/RtspServer
|
2021-03-19 04:18:21 +08:00
|
|
|
fi
|
2017-03-05 00:30:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# previsouly part of installzm.sh
|
2019-11-19 03:35:26 +08:00
|
|
|
# install the xenial deb and test zoneminder
|
2019-09-13 20:21:19 +08:00
|
|
|
install_deb () {
|
2017-03-05 23:06:57 +08:00
|
|
|
|
|
|
|
# Check we've got gdebi installed
|
|
|
|
type gdebi 2>&1 > /dev/null
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo
|
|
|
|
echo "ERROR: The script cannot find the required command \"gdebi\"."
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-25 22:41:53 +08:00
|
|
|
# Install and test the zoneminder package (only) for Ubuntu Xenial
|
2017-03-06 20:50:59 +08:00
|
|
|
pkgname="build/zoneminder_${VERSION}-${RELEASE}_amd64.deb"
|
|
|
|
|
|
|
|
if [ -e $pkgname ]; then
|
2017-06-15 01:28:56 +08:00
|
|
|
sudo gdebi --quiet --non-interactive $pkgname
|
2019-09-06 23:25:21 +08:00
|
|
|
echo "Return code from installing $?"
|
2017-03-06 20:50:59 +08:00
|
|
|
mysql -uzmuser -pzmpass zm < db/test.monitor.sql
|
2019-09-06 23:25:21 +08:00
|
|
|
echo "Return code from adding test monitor $?"
|
2017-03-06 20:50:59 +08:00
|
|
|
sudo /usr/bin/zmpkg.pl start
|
2019-09-06 23:25:21 +08:00
|
|
|
echo "Return code from starting $?"
|
|
|
|
sudo /usr/bin/zmfilter.pl --filter=purgewhenfull
|
|
|
|
echo "Return code from running purgewhenfull $?"
|
2017-03-06 20:50:59 +08:00
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo "ERROR: The script cannot find the package $pkgname"
|
|
|
|
echo "Check the Travis log for a build failure."
|
|
|
|
echo
|
|
|
|
exit 99
|
|
|
|
fi
|
2017-03-05 00:30:36 +08:00
|
|
|
}
|
|
|
|
|
2017-06-06 01:04:29 +08:00
|
|
|
# This sets the naming convention for the rpm packages
|
|
|
|
setrpmpkgname () {
|
|
|
|
|
|
|
|
createvars
|
|
|
|
|
|
|
|
# Set VERSION to the contents of the version file e.g. 1.31.0
|
|
|
|
# Set RELEASE to 1.{number of commits}.{today's date}git{short hash of HEAD} e.g. 1.82.20170605gitg7ae0b4a
|
|
|
|
export VERSION="$versionfile"
|
|
|
|
export RELEASE="1.${numcommits}.${thedate}git${shorthash}"
|
|
|
|
|
|
|
|
checkvars
|
2019-09-24 01:10:14 +08:00
|
|
|
|
2017-06-06 01:04:29 +08:00
|
|
|
echo
|
|
|
|
echo "Packpack VERSION has been set to: ${VERSION}"
|
|
|
|
echo "Packpack RELEASE has been set to: ${RELEASE}"
|
|
|
|
echo
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
# This sets the naming convention for the deb packages
|
|
|
|
setdebpkgname () {
|
|
|
|
|
|
|
|
createvars
|
|
|
|
|
|
|
|
# Set VERSION to {zm version}~{today's date}.{number of commits} e.g. 1.31.0~20170605.82
|
|
|
|
# Set RELEASE to the packpack DIST variable e.g. Trusty
|
2021-04-15 00:59:17 +08:00
|
|
|
if [ "" == "$VERSION" ]; then
|
|
|
|
export VERSION="${versionfile}~${thedate}.${numcommits}"
|
|
|
|
fi
|
2017-03-07 08:54:55 +08:00
|
|
|
export RELEASE="${DIST}"
|
|
|
|
|
2017-06-02 01:30:32 +08:00
|
|
|
checkvars
|
2019-09-24 01:10:14 +08:00
|
|
|
|
2017-03-07 08:54:55 +08:00
|
|
|
echo
|
|
|
|
echo "Packpack VERSION has been set to: ${VERSION}"
|
|
|
|
echo "Packpack RELEASE has been set to: ${RELEASE}"
|
|
|
|
echo
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-06-06 01:04:29 +08:00
|
|
|
# This adds an entry to the rpm specfile changelog
|
|
|
|
setrpmchangelog () {
|
|
|
|
|
|
|
|
export CHANGELOG_NAME="Andrew Bauer"
|
|
|
|
export CHANGELOG_EMAIL="zonexpertconsulting@outlook.com"
|
|
|
|
export CHANGELOG_TEXT="Automated, development snapshot of git ${shorthash}"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-03 10:01:59 +08:00
|
|
|
# This adds an entry to the debian changelog
|
|
|
|
setdebchangelog () {
|
|
|
|
DATE=`date -R`
|
|
|
|
cat <<EOF > debian/changelog
|
2019-09-06 23:25:21 +08:00
|
|
|
zoneminder ($VERSION-${DIST}) ${DIST}; urgency=low
|
2019-09-24 01:10:14 +08:00
|
|
|
*
|
2019-09-06 21:31:08 +08:00
|
|
|
-- Isaac Connor <isaac@zoneminder.com> $DATE
|
2017-06-03 10:01:59 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2017-08-20 06:17:18 +08:00
|
|
|
# start packpack, filter the output if we are running in travis
|
|
|
|
execpackpack () {
|
2017-08-20 06:47:06 +08:00
|
|
|
|
|
|
|
if [ "${OS}" == "el" ] || [ "${OS}" == "fedora" ]; then
|
|
|
|
parms="-f utils/packpack/redhat_package.mk redhat_package"
|
|
|
|
else
|
|
|
|
parms=""
|
|
|
|
fi
|
|
|
|
|
2017-08-20 06:17:18 +08:00
|
|
|
if [ "${TRAVIS}" == "true" ]; then
|
2018-06-14 04:44:31 +08:00
|
|
|
# Travis will fail the build if the output gets too long
|
|
|
|
# To mitigate that, use grep to filter out some of the noise
|
2018-06-14 20:16:14 +08:00
|
|
|
if [ "${ARCH}" != "armhf" ]; then
|
|
|
|
packpack/packpack $parms | grep -Ev '^(-- Installing:|-- Up-to-date:|Skip blib|Manifying|Installing /build|cp lib|writing output...|copying images...|reading sources...|[Working])'
|
|
|
|
else
|
|
|
|
# Travis never ceases to amaze. For the case of arm emulation, Travis fails the build due to too little output over a 10 minute period. Facepalm.
|
2018-07-12 20:59:27 +08:00
|
|
|
packpack/packpack $parms | grep -Ev '^(-- Installing:|Skip blib|Manifying|Installing /build|cp lib|writing output...|copying images...|reading sources...|[Working])'
|
2018-06-14 20:16:14 +08:00
|
|
|
fi
|
2017-08-20 06:17:18 +08:00
|
|
|
else
|
2017-08-20 06:47:06 +08:00
|
|
|
packpack/packpack $parms
|
2017-08-20 06:17:18 +08:00
|
|
|
fi
|
2020-08-25 03:34:28 +08:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo
|
|
|
|
echo "ERROR: An error occurred while executing packpack."
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-08-20 06:17:18 +08:00
|
|
|
}
|
|
|
|
|
2018-04-21 21:37:27 +08:00
|
|
|
# Check for connectivity with the deploy target host
|
|
|
|
checkdeploytarget () {
|
|
|
|
echo
|
|
|
|
echo "Checking Internet connectivity with the deploy host ${DEPLOYTARGET}"
|
|
|
|
echo
|
|
|
|
|
|
|
|
ping -c 1 ${DEPLOYTARGET}
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo
|
|
|
|
echo "*** WARNING: THERE WAS A PROBLEM CONNECTING TO THE DEPLOY HOST ***"
|
|
|
|
echo
|
|
|
|
echo "Printing additional diagnostic information..."
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "*** NSLOOKUP ***"
|
|
|
|
echo
|
|
|
|
nslookup ${DEPLOYTARGET}
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "*** TRACEROUTE ***"
|
|
|
|
echo
|
|
|
|
traceroute -w 2 -m 15 ${DEPLOYTARGET}
|
2019-12-25 22:41:53 +08:00
|
|
|
|
2019-12-25 22:45:10 +08:00
|
|
|
exit 97
|
|
|
|
fi
|
2018-04-21 21:37:27 +08:00
|
|
|
}
|
|
|
|
|
2017-03-05 00:16:05 +08:00
|
|
|
################
|
|
|
|
# MAIN PROGRAM #
|
|
|
|
################
|
|
|
|
|
2018-04-21 21:37:27 +08:00
|
|
|
# Set the hostname we will deploy packages to
|
|
|
|
DEPLOYTARGET="zmrepo.zoneminder.com"
|
|
|
|
|
|
|
|
# If we are running inside Travis then verify we can connect to the target host machine
|
|
|
|
if [ "${TRAVIS}" == "true" ]; then
|
|
|
|
checkdeploytarget
|
|
|
|
fi
|
2017-03-05 00:16:05 +08:00
|
|
|
checksanity
|
|
|
|
|
2019-09-24 01:10:14 +08:00
|
|
|
# Steps common to Redhat distros
|
|
|
|
if [ "${OS}" == "el" ] || [ "${OS}" == "fedora" ]; then
|
2019-12-27 09:36:33 +08:00
|
|
|
commonprep
|
|
|
|
echo "Begin Redhat build..."
|
2017-03-05 00:16:05 +08:00
|
|
|
|
2020-01-06 04:30:33 +08:00
|
|
|
# Newer Redhat distros use dnf package manager rather than yum
|
|
|
|
if [ "${DIST}" -gt "7" ]; then
|
|
|
|
sed -i 's\yum\dnf\' utils/packpack/redhat_package.mk
|
|
|
|
fi
|
|
|
|
|
2019-12-27 09:36:33 +08:00
|
|
|
setrpmpkgname
|
2017-06-06 01:04:29 +08:00
|
|
|
|
2019-12-27 09:36:33 +08:00
|
|
|
ln -sfT distros/redhat rpm
|
2017-03-05 00:16:05 +08:00
|
|
|
|
2019-12-27 09:36:33 +08:00
|
|
|
# The rpm specfile requires the Crud submodule folder to be empty
|
|
|
|
rm -rf web/api/app/Plugin/Crud
|
|
|
|
mkdir web/api/app/Plugin/Crud
|
2017-03-07 08:27:45 +08:00
|
|
|
|
2019-12-27 09:36:33 +08:00
|
|
|
reporpm="rpmfusion-free-release"
|
|
|
|
dlurl="https://download1.rpmfusion.org/free/${OS}/${reporpm}-${DIST}.noarch.rpm"
|
2017-03-05 00:16:05 +08:00
|
|
|
|
2019-12-27 09:36:33 +08:00
|
|
|
# Give our downloaded repo rpm a common name so redhat_package.mk can find it
|
|
|
|
if [ -n "$dlurl" ] && [ $? -eq 0 ]; then
|
|
|
|
echo "Retrieving ${reporpm} repo rpm..."
|
|
|
|
curl $dlurl > build/external-repo.noarch.rpm
|
|
|
|
else
|
|
|
|
echo "ERROR: Failed to retrieve ${reporpm} repo rpm..."
|
|
|
|
echo "Download url was: $dlurl"
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-01-16 05:48:57 +08:00
|
|
|
|
2019-12-27 09:36:33 +08:00
|
|
|
setrpmchangelog
|
2017-03-07 08:41:48 +08:00
|
|
|
|
2019-12-27 09:36:33 +08:00
|
|
|
echo "Starting packpack..."
|
|
|
|
execpackpack
|
2019-12-25 22:41:53 +08:00
|
|
|
|
|
|
|
# Steps common to Debian based distros
|
2019-09-24 01:10:14 +08:00
|
|
|
elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ] || [ "${OS}" == "raspbian" ]; then
|
|
|
|
commonprep
|
|
|
|
echo "Begin ${OS} ${DIST} build..."
|
|
|
|
|
|
|
|
setdebpkgname
|
|
|
|
movecrud
|
2017-03-06 01:37:22 +08:00
|
|
|
|
2021-09-04 22:17:41 +08:00
|
|
|
if [ "${DIST}" == "bionic" ] || [ "${DIST}" == "focal" ] || [ "${DIST}" == "hirsute" ] || [ "${DIST}" == "impish" ] || [ "${DIST}" == "buster" ] || [ "${DIST}" == "bullseye" ]; then
|
2020-08-25 06:06:14 +08:00
|
|
|
ln -sfT distros/ubuntu2004 debian
|
|
|
|
elif [ "${DIST}" == "beowulf" ]; then
|
|
|
|
ln -sfT distros/beowulf debian
|
2019-09-24 01:10:14 +08:00
|
|
|
else
|
|
|
|
ln -sfT distros/ubuntu1604 debian
|
|
|
|
fi
|
2017-03-06 01:37:22 +08:00
|
|
|
|
2019-09-24 01:10:14 +08:00
|
|
|
setdebchangelog
|
|
|
|
|
|
|
|
echo "Starting packpack..."
|
|
|
|
execpackpack
|
2017-03-05 00:30:36 +08:00
|
|
|
|
2019-12-25 22:41:53 +08:00
|
|
|
# Try to install and run the newly built zoneminder package
|
2020-09-17 03:09:19 +08:00
|
|
|
if [ "${OS}" == "ubuntu" ] && [ "${DIST}" == "bionic" ] && [ "${ARCH}" == "x86_64" ] && [ "${TRAVIS}" == "true" ]; then
|
2019-12-25 22:41:53 +08:00
|
|
|
echo "Begin Deb package installation..."
|
2019-09-24 01:10:14 +08:00
|
|
|
install_deb
|
|
|
|
fi
|
2017-03-06 04:02:02 +08:00
|
|
|
|
2019-12-25 22:41:53 +08:00
|
|
|
# Steps common to eslint checks
|
|
|
|
elif [ "${OS}" == "eslint" ] || [ "${DIST}" == "eslint" ]; then
|
|
|
|
|
|
|
|
# Check we've got npm installed
|
|
|
|
type npm 2>&1 > /dev/null
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo
|
|
|
|
echo "ERROR: The script cannot find the required command \"npm\"."
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
npm install -g eslint@5.12.0 eslint-config-google@0.11.0 eslint-plugin-html@5.0.0 eslint-plugin-php-markup@0.2.5
|
|
|
|
echo "Begin eslint checks..."
|
|
|
|
eslint --ext .php,.js .
|
|
|
|
fi
|
2017-03-06 04:02:02 +08:00
|
|
|
|