diff --git a/utils/packpack/packpack-rpm.patch b/utils/packpack/packpack-rpm.patch new file mode 100644 index 000000000..6d6b0e7f3 --- /dev/null +++ b/utils/packpack/packpack-rpm.patch @@ -0,0 +1,10 @@ +--- a/packpack/pack/rpm.mk 2017-05-10 09:53:38.797616947 -0500 ++++ b/packpack/pack/rpm.mk 2017-05-10 09:59:26.744409073 -0500 +@@ -26,7 +26,6 @@ + -e 's/Source0:\([ ]*\).*/Source0: $(TARBALL)/' \ + -e 's/%setup.*/%setup -q -n $(PRODUCT)-$(VERSION)/' \ + -re 's/(%autosetup.*)( -n \S*)(.*)/\1\3/' \ +- -e '0,/%autosetup.*/ s/%autosetup.*/%autosetup -n $(PRODUCT)-$(VERSION)/' \ + -e '/%changelog/a\* $(THEDATE) $(CHANGELOG_NAME) <$(CHANGELOG_EMAIL)> - $(VERSION)-$(RELEASE)\n\- $(CHANGELOG_TEXT)\n' \ + -i $@.tmp + grep -F "Version: $(VERSION)" $@.tmp && \ diff --git a/utils/packpack/startpackpack.sh b/utils/packpack/startpackpack.sh index e2e7df6c2..195121479 100755 --- a/utils/packpack/startpackpack.sh +++ b/utils/packpack/startpackpack.sh @@ -9,7 +9,7 @@ # General sanity checks checksanity () { # Check to see if this script has access to all the commands it needs - for CMD in set echo curl repoquery git ln mkdir rmdir; do + for CMD in set echo curl repoquery git ln mkdir rmdir cat patch; do type $CMD 2>&1 > /dev/null if [ $? -ne 0 ]; then @@ -50,6 +50,12 @@ commonprep () { git clone https://github.com/packpack/packpack.git packpack fi + # Patch packpack + patch --dry-run --silent -f -p1 < utils/packpack/packpack-rpm.patch + if [ $? -eq 0 ]; then + patch -p1 < utils/packpack/packpack-rpm.patch + fi + # The rpm specfile requires we download the tarball and manually move it into place # Might as well do this for Debian as well, rather than git submodule init CRUDVER="3.0.10" @@ -142,10 +148,10 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS}" != "true" ]; then if [ "${OS}" == "el" ] || [ "${OS}" == "fedora" ]; then echo "Begin Redhat build..." - # Set VERSION to x.xx.x e.g. 1.30.2 - # Set RELEASE to x where x is number of commits since release + # Set VERSION to the contents of the version file + # Set RELEASE to x where x is number of commits since the release shown on github # Creates zoneminder packages in the format: zoneminder-{version}-{release} - export VERSION=$(git describe --long --always | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\1/p') + export VERSION=$(cat version) export RELEASE=$(git describe --long --always | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\2/p') echo