2013-10-04 01:53:37 +08:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# -*- makefile -*-
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
#export DH_VERBOSE=1
|
|
|
|
|
2016-04-06 20:43:20 +08:00
|
|
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
|
|
|
export DEB_LDFLAGS_MAINT_APPEND += -Wl,--as-needed
|
2013-10-04 01:53:37 +08:00
|
|
|
|
2016-04-06 20:43:20 +08:00
|
|
|
ifeq ($(DEB_BUILD_ARCH_OS),hurd)
|
|
|
|
ARGS:= -DZM_NO_MMAP=ON
|
2013-10-04 01:53:37 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
%:
|
2016-04-06 20:43:20 +08:00
|
|
|
dh $@ --parallel --buildsystem=cmake --builddirectory=dbuild \
|
|
|
|
--with sphinxdoc,apache2,linktree
|
2013-10-04 01:53:37 +08:00
|
|
|
|
|
|
|
override_dh_auto_configure:
|
2016-04-06 20:43:20 +08:00
|
|
|
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"
|
2013-10-04 01:53:37 +08:00
|
|
|
|
|
|
|
override_dh_clean:
|
2016-04-06 20:43:20 +08:00
|
|
|
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, %, $@) $@
|
2013-10-04 01:53:37 +08:00
|
|
|
|
2016-04-06 20:43:20 +08:00
|
|
|
## 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)
|
2013-10-04 01:53:37 +08:00
|
|
|
|
2016-04-06 20:43:20 +08:00
|
|
|
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
|
2013-10-04 01:53:37 +08:00
|
|
|
|
|
|
|
override_dh_fixperms:
|
|
|
|
dh_fixperms
|
2017-03-06 00:37:44 +08:00
|
|
|
#
|
|
|
|
# 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
|
2013-10-04 01:53:37 +08:00
|
|
|
|
2016-04-06 20:43:20 +08:00
|
|
|
override_dh_installinit:
|
|
|
|
dh_installinit --no-start
|
|
|
|
|
|
|
|
override_dh_apache2:
|
|
|
|
dh_apache2 --noenable
|
2013-11-09 00:09:23 +08:00
|
|
|
|
|
|
|
override_dh_strip:
|
2016-04-06 20:43:20 +08:00
|
|
|
[ -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
|