packpack - f24,f25,el7 confirmed working

This commit is contained in:
Andy Bauer 2017-01-15 15:48:57 -06:00
parent 08d4d0c5c2
commit 49c35d5733
3 changed files with 77 additions and 17 deletions

View File

@ -1,8 +0,0 @@
.PHONY: fedora25_package
.NOTPARALLEL: fedora25_package
fedora25_package: fedora25_bootstrap package
fedora25_bootstrap:
sudo dnf install -y --nogpgcheck build/zmrepo-25-1.fc25.noarch.rpm

View File

@ -0,0 +1,8 @@
.PHONY: redhat_package
.NOTPARALLEL: redhat_package
redhat_package: redhat_bootstrap package
redhat_bootstrap:
sudo yum install -y --nogpgcheck build/zmrepo.noarch.rpm

View File

@ -1,15 +1,75 @@
#!/bin/sh #!/bin/sh
# packpack setup file for ZoneMinder project # packpack setup file for the ZoneMinder project
# Written by Andrew Bauer # Written by Andrew Bauer
# This script is jsut a first start. It will change siginificantly as support # Check to see if this script has access to all the commands it needs
# for more distros is added. for CMD in set echo curl repoquery git ln mkdir patch; do
type $CMD &> /dev/null
ln -s distros/redhat rpm if [ $? -ne 0 ]; then
echo
echo "ERROR: The script cannot find the required command \"${CMD}\"."
echo
exit -1
fi
done
# Verify OS & DIST environment variables have been set before calling this script
if [ -z "${OS}" ] || [ -z "${DIST}" ]; then
echo "ERROR: both OS and DIST environment variables must be set"
exit -1
fi
# Steps common to all builds
mkdir -p build mkdir -p build
curl https://zmrepo.zoneminder.com/f/25/i386/zmrepo-25-1.fc25.noarch.rpm > build/zmrepo-25-1.fc25.noarch.rpm if [ -e "packpack/Makefile" ]; then
curl -L https://github.com/FriendsOfCake/crud/archive/v3.0.10.tar.gz > build/crud-3.0.10.tar.gz echo "Checking packpack github repo for changes..."
git clone https://github.com/packpack/packpack.git packpack git -C packpack pull origin master
patch -p1 < utils/packpack/autosetup.patch else
packpack/packpack -f utils/packpack/fedora25_package.mk fedora25_package echo "Cloning pakcpack github repo..."
git clone https://github.com/packpack/packpack.git packpack
fi
# Steps common to Redhat distros
if [ "${OS}" == "el" ] || [ "${OS}" == "fedora" ]; then
CRUDVER="3.0.10"
echo "Retrieving Crud submodule..."
curl -L https://github.com/FriendsOfCake/crud/archive/v${CRUDVER}.tar.gz > build/crud-${CRUDVER}.tar.gz
if [ $? -ne 0 ]; then
echo "ERROR: Crud tarball retreival failed..."
exit -1
fi
# %autosetup support has been merged upstream. No need to patch
#patch -p1 < utils/packpack/autosetup.patch
ln -sf distros/redhat rpm
if [ "${OS}" == "el" ]; then
zmrepodistro=${OS}
else
zmrepodistro="f"
fi
# Let repoquery determine the full url and filename of the zmrepo rpm we are interested in
result=`repoquery --repofrompath=zmpackpack,https://zmrepo.zoneminder.com/${zmrepodistro}/${DIST}/x86_64/ --repoid=zmpackpack --qf="%{location}" zmrepo 2> /dev/null`
if [ -n "$result" ] && [ $? -eq 0 ]; then
echo "Retrieving ZMREPO rpm..."
curl $result > build/zmrepo.noarch.rpm
else
echo "ERROR: Failed to retrieve zmrepo rpm..."
echo -1
fi
echo "Starting packpack..."
packpack/packpack -f utils/packpack/redhat_package.mk redhat_package
# Steps common the Debian based distros
elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ]; then
echo Do some stuff here
fi