From c6fc6cb0cad71f86242316ca138e3b1bfdbf3c2a Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Sun, 5 Mar 2017 11:46:45 -0600 Subject: [PATCH] change patch method --- distros/ubuntu1204/rules.orig | 89 ++++++++++++++++++++++++++++++ distros/ubuntu1204/rules.rej | 28 ++++++++++ distros/ubuntu1604/rules.orig | 95 +++++++++++++++++++++++++++++++++ distros/ubuntu1604/rules.rej | 28 ++++++++++ utils/packpack/startpackpack.sh | 26 ++++----- 5 files changed, 250 insertions(+), 16 deletions(-) create mode 100755 distros/ubuntu1204/rules.orig create mode 100644 distros/ubuntu1204/rules.rej create mode 100755 distros/ubuntu1604/rules.orig create mode 100644 distros/ubuntu1604/rules.rej diff --git a/distros/ubuntu1204/rules.orig b/distros/ubuntu1204/rules.orig new file mode 100755 index 000000000..2b54a2131 --- /dev/null +++ b/distros/ubuntu1204/rules.orig @@ -0,0 +1,89 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_LDFLAGS_MAINT_APPEND += -Wl,--as-needed + +ifeq ($(DEB_BUILD_ARCH_OS),hurd) +ARGS:= -DZM_NO_MMAP=ON +endif + +%: + dh $@ --parallel --buildsystem=cmake --builddirectory=dbuild \ + --with sphinxdoc,apache2,linktree + +override_dh_auto_configure: + dh_auto_configure -- $(ARGS) \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DZM_CONFIG_DIR="/etc/zm" \ + -DZM_RUNDIR="/var/run/zm" \ + -DZM_SOCKDIR="/var/run/zm" \ + -DZM_TMPDIR="/tmp/zm" \ + -DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \ + -DZM_CONTENTDIR="/var/cache/zoneminder" + +override_dh_clean: + dh_clean $(MANPAGES1) + $(RM) -r docs/_build docs/installationguide + +build-indep: + #$(MAKE) -C docs text + $(MAKE) -C docs html + +MANPAGES1 = dbuild/scripts/zmupdate.pl.1 +$(MANPAGES1): + # generate man page(s): + pod2man -s1 --stderr --utf8 $(patsubst %.1, %, $@) $@ + +## reproducible build: +LAST_CHANGE=$(shell dpkg-parsechangelog -S Date) +BUILD_DATE=$(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)") +override_dh_installman: $(MANPAGES1) + $(MAKE) -C docs man SPHINXOPTS="-D today=\"$(BUILD_DATE)\"" + dh_installman --language=C $(MANPAGES1) + +override_dh_auto_install: + dh_auto_install --destdir=$(CURDIR)/debian/tmp + # remove worthless files: + $(RM) -v $(CURDIR)/debian/tmp/usr/share/perl5/*/*/*/.packlist + $(RM) -v $(CURDIR)/debian/tmp/usr/share/perl5/*/*.in + # remove empty directories: + find $(CURDIR)/debian/tmp/usr -type d -empty -delete -printf 'removed %p\n' + # remove extra-license-file: + $(RM) -v $(CURDIR)/debian/tmp/usr/share/zoneminder/www/api/lib/Cake/LICENSE.txt + +override_dh_fixperms: + dh_fixperms + # + # As requested by the Debian Webapps Policy Manual §3.2.1 + chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf + chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf + +override_dh_installinit: + dh_installinit --no-start + +override_dh_apache2: + dh_apache2 --noenable + +override_dh_strip: + [ -d "$(CURDIR)/debian/zoneminder-dbg" ] \ + && dh_strip --dbg-package=zoneminder-dbg \ + || dh_strip + +#%: +# dh $@ --parallel --buildsystem=autoconf --with autoreconf +# +#override_dh_auto_configure: +# dh_auto_configure -- \ +# --sysconfdir=/etc/zm \ +# --with-mysql=/usr \ +# --with-webdir=/usr/share/zoneminder \ +# --with-ffmpeg=/usr \ +# --with-cgidir=/usr/lib/cgi-bin \ +# --with-webuser=www-data \ +# --with-webgroup=www-data \ +# --enable-mmap=yes diff --git a/distros/ubuntu1204/rules.rej b/distros/ubuntu1204/rules.rej new file mode 100644 index 000000000..8d88eb471 --- /dev/null +++ b/distros/ubuntu1204/rules.rej @@ -0,0 +1,28 @@ +--- distros/ubuntu1204/rules ++++ distros/ubuntu1204/rules +@@ -58,8 +58,10 @@ override_dh_auto_install: + + override_dh_fixperms: + dh_fixperms +- ## 637685 +- chmod -c o-r $(CURDIR)/debian/zoneminder/etc/zm/zm.conf ++ # ++ # As requested by the Debian Webapps Policy Manual §3.2.1 ++ chown root:www-data debian/zoneminder-core/etc/zm/zm.conf ++ chmod 640 debian/zoneminder-core/etc/zm/zm.conf + + override_dh_installinit: + dh_installinit --no-start +--- distros/ubuntu1204/rules ++++ distros/ubuntu1204/rules +@@ -60,8 +60,8 @@ override_dh_fixperms: + dh_fixperms + # + # As requested by the Debian Webapps Policy Manual §3.2.1 +- chown root:www-data debian/zoneminder-core/etc/zm/zm.conf +- chmod 640 debian/zoneminder-core/etc/zm/zm.conf ++ chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf ++ chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf + + override_dh_installinit: + dh_installinit --no-start diff --git a/distros/ubuntu1604/rules.orig b/distros/ubuntu1604/rules.orig new file mode 100755 index 000000000..c7fb00198 --- /dev/null +++ b/distros/ubuntu1604/rules.orig @@ -0,0 +1,95 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_LDFLAGS_MAINT_APPEND += -Wl,--as-needed + +ifeq ($(DEB_BUILD_ARCH_OS),hurd) +ARGS:= -DZM_NO_MMAP=ON +endif + +%: + dh $@ --parallel --buildsystem=cmake --builddirectory=dbuild \ + --with systemd,sphinxdoc,apache2,linktree + +override_dh_auto_configure: + dh_auto_configure -- $(ARGS) \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DZM_CONFIG_DIR="/etc/zm" \ + -DZM_RUNDIR="/var/run/zm" \ + -DZM_SOCKDIR="/var/run/zm" \ + -DZM_TMPDIR="/tmp/zm" \ + -DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \ + -DZM_CONTENTDIR="/var/cache/zoneminder" + +override_dh_clean: + dh_clean $(MANPAGES1) + $(RM) -r docs/_build docs/installationguide + +build-indep: + #$(MAKE) -C docs text + $(MAKE) -C docs html + +MANPAGES1 = dbuild/scripts/zmupdate.pl.1 +$(MANPAGES1): + # generate man page(s): + pod2man -s1 --stderr --utf8 $(patsubst %.1, %, $@) $@ + +## reproducible build: +LAST_CHANGE=$(shell dpkg-parsechangelog -S Date) +BUILD_DATE=$(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)") +override_dh_installman: $(MANPAGES1) + $(MAKE) -C docs man SPHINXOPTS="-D today=\"$(BUILD_DATE)\"" + dh_installman --language=C $(MANPAGES1) + +override_dh_auto_install: + dh_auto_install --destdir=$(CURDIR)/debian/tmp + # remove worthless files: + $(RM) -v $(CURDIR)/debian/tmp/usr/share/perl5/*/*/*/.packlist + $(RM) -v $(CURDIR)/debian/tmp/usr/share/perl5/*/*.in + # remove empty directories: + find $(CURDIR)/debian/tmp/usr -type d -empty -delete -printf 'removed %p\n' + # remove extra-license-file: + $(RM) -v $(CURDIR)/debian/tmp/usr/share/zoneminder/www/api/lib/Cake/LICENSE.txt + +override_dh_fixperms: + dh_fixperms + # + # As requested by the Debian Webapps Policy Manual §3.2.1 + chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf + chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf + +override_dh_installinit: + dh_installinit --no-start + +override_dh_systemd_start: + dh_systemd_start --no-start + +override_dh_systemd_enable: + dh_systemd_enable --no-enable + +override_dh_apache2: + dh_apache2 --noenable + +override_dh_strip: + [ -d "$(CURDIR)/debian/zoneminder-dbg" ] \ + && dh_strip --dbg-package=zoneminder-dbg \ + || dh_strip + +#%: +# dh $@ --parallel --buildsystem=autoconf --with autoreconf +# +#override_dh_auto_configure: +# dh_auto_configure -- \ +# --sysconfdir=/etc/zm \ +# --with-mysql=/usr \ +# --with-webdir=/usr/share/zoneminder \ +# --with-ffmpeg=/usr \ +# --with-cgidir=/usr/lib/cgi-bin \ +# --with-webuser=www-data \ +# --with-webgroup=www-data \ +# --enable-mmap=yes diff --git a/distros/ubuntu1604/rules.rej b/distros/ubuntu1604/rules.rej new file mode 100644 index 000000000..65ad1a163 --- /dev/null +++ b/distros/ubuntu1604/rules.rej @@ -0,0 +1,28 @@ +--- distros/ubuntu1604/rules ++++ distros/ubuntu1604/rules +@@ -58,8 +58,10 @@ override_dh_auto_install: + + override_dh_fixperms: + dh_fixperms +- ## 637685 +- chmod -c o-r $(CURDIR)/debian/zoneminder/etc/zm/zm.conf ++ # ++ # As requested by the Debian Webapps Policy Manual §3.2.1 ++ chown root:www-data debian/zoneminder-core/etc/zm/zm.conf ++ chmod 640 debian/zoneminder-core/etc/zm/zm.conf + + override_dh_installinit: + dh_installinit --no-start +--- distros/ubuntu1604/rules ++++ distros/ubuntu1604/rules +@@ -60,8 +60,8 @@ override_dh_fixperms: + dh_fixperms + # + # As requested by the Debian Webapps Policy Manual §3.2.1 +- chown root:www-data debian/zoneminder-core/etc/zm/zm.conf +- chmod 640 debian/zoneminder-core/etc/zm/zm.conf ++ chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf ++ chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf + + override_dh_installinit: + dh_installinit --no-start diff --git a/utils/packpack/startpackpack.sh b/utils/packpack/startpackpack.sh index 974eccb98..d12cb6a0c 100755 --- a/utils/packpack/startpackpack.sh +++ b/utils/packpack/startpackpack.sh @@ -149,6 +149,11 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS}" != "true" ]; then elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ]; then echo "Begin Debian build..." + # patch debian build scripts to apply correct permissions to zm.conf + set +e + patch --silent -f -p1 < utils/packpack/fixdebperms.patch 2>/dev/null + set -e + movecrud if [ "${DIST}" == "trusty" ] || [ "${DIST}" == "precise" ]; then @@ -159,14 +164,6 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS}" != "true" ]; then ln -sf distros/ubuntu1604 debian fi - # patch debian build scripts to apply correct permissions to zm.conf - set +e - patch --dry-run --silent -f -p1 < utils/packpack/fixdebperms.patch 2>/dev/null - if [ $? -eq 0 ]; then - patch -p1 < utils/packpack/fixdebperms.patch - fi - set -e - echo "Starting packpack..." packpack/packpack @@ -179,19 +176,16 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS}" != "true" ]; then elif [ "${OS}" == "ubuntu" ] && [ "${DIST}" == "trusty" ]; then echo "Begin Ubuntu Trusty build..." + # patch debian build scripts to apply correct permissions to zm.conf + set +e + patch --silent -f -p1 < utils/packpack/fixdebperms.patch 2>/dev/null + set -e + commonprep movecrud ln -sf distros/ubuntu1204 debian - # patch debian build scripts to apply correct permissions to zm.conf - set +e - patch --dry-run --silent -f -p1 < utils/packpack/fixdebperms.patch 2>/dev/null - if [ $? -eq 0 ]; then - patch -p1 < utils/packpack/fixdebperms.patch - fi - set -e - echo "Starting packpack..." packpack/packpack