Files
zoneminder/distros/ubuntu2004/rules
T
SteveGilvarryandClaude Opus 4.8 f6f74c496c fix: move temp dir out of system /tmp into ZoneMinder's own tree
ZM_TMPDIR defaulted to /var/tmp/zm, and the Debian-family packaging put
it in shared system temp: distros/ubuntu2004 used /var/tmp/zm and
distros/beowulf used /tmp/zm. ZoneMinder stages regenerable scratch there
(exports, uploads, the video-concat list, detection scratch), so shared
system temp is the wrong, exposed location. Only the RedHat build did it
right, using a ZoneMinder-owned dir.

Move ZM_TMPDIR to /var/cache/zoneminder/temp - a ZoneMinder-owned,
www-data-owned directory - in the CMake default and in the ubuntu2004 and
beowulf packaging. The Debian packaging already creates and chowns
/var/cache/zoneminder/temp (it was provisioned but unused), so no new dir
plumbing is needed. /var/cache is correct here because everything written
to this dir is regenerable.

Also repoint the CakePHP api/app/tmp symlink (cache, sessions, logs) from
shared /var/tmp to the same /var/cache/zoneminder/temp, matching what the
RedHat build already does.

No migration is required: the contents are transient/regenerable, so on
upgrade the new dir is simply used going forward.

This does not cover the official Debian package on salsa (which sets
ZM_TMPDIR=/tmp/zm and ZM_CONTENTDIR=/var/cache/zoneminder); that is
maintained downstream and needs a separate Debian-side change.

refs #2915

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 18:44:51 +10:00

100 lines
3.1 KiB
Makefile
Executable File

#!/usr/bin/make -f
# 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 $@ --buildsystem=cmake --builddirectory=dbuild \
--with sphinxdoc,apache2,linktree
override_dh_auto_configure:
dh_auto_configure -- $(ARGS) \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_MAN=0 \
-DZM_NO_PCRE=ON \
-DZM_CONFIG_DIR="/etc/zm" \
-DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \
-DZM_RUNDIR="/run/zm" \
-DZM_SOCKDIR="/run/zm" \
-DZM_TMPDIR="/var/cache/zoneminder/temp" \
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_PATH_SHUTDOWN="/sbin/shutdown" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
override_dh_clean:
dh_clean $(MANPAGES1)
$(RM) -r docs/_build
override_dh_auto_build-indep:
$(MAKE) -C docs html
dh_auto_build
MANPAGES1 = \
dbuild/scripts/zmupdate.pl.1 \
dbuild/scripts/zmaudit.pl.1 \
dbuild/scripts/zmcamtool.pl.1 \
dbuild/scripts/zmcontrol.pl.1 \
dbuild/scripts/zmdc.pl.1 \
dbuild/scripts/zmfilter.pl.1 \
dbuild/scripts/zmpkg.pl.1 \
dbuild/scripts/zmsystemctl.pl.1 \
dbuild/scripts/zmtelemetry.pl.1 \
dbuild/scripts/zmtrack.pl.1 \
dbuild/scripts/zmtrigger.pl.1 \
dbuild/scripts/zmvideo.pl.1 \
dbuild/scripts/zmwatch.pl.1 \
dbuild/scripts/zmx10.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 --arch --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_installsystemd:
dh_installsystemd --no-enable --no-start
override_dh_apache2:
dh_apache2 --noenable
override_dh_strip:
[ -d "$(CURDIR)/debian/zoneminder-dbg" ] \
&& dh_strip --dbg-package=zoneminder-dbg \
|| dh_strip