Sunil Mohan Adapa 2b525a1930
d/rules: Don't install and enable other systemd service files
Close: #1982.

This eliminates the issue with calibre and wordpress services getting run even
before the app is installed. These services are enabled when the app is
installed. On disadvantage is that services are no longer restarted when a newer
service file is installed.

Users for whom caibre and wordpress have already been enabled. Nothing changes
on upgrade and service will still be enabled. However, the services won't be
attempted to be started without the app's being installed. This is good enough
without having to write custom logic to disable these services.

Tests:

- Install freedombox package on a fresh setup. wordpress and calibre service
files are not enabled.

- When wordpress and calibre apps are installed, these services are enabled and
run as expected.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-09 22:09:03 -04:00

28 lines
1.0 KiB
Makefile
Executable File

#!/usr/bin/make -f
export DH_VERBOSE=1
export PYBUILD_DESTDIR=debian/tmp
%:
dh $@ --with python3 --buildsystem=pybuild
override_dh_auto_install-indep:
dh_auto_install
./run --develop --list-dependencies | sort | tr '\n' ', ' | \
sed -e 's/^/freedombox:Depends=/' >> debian/freedombox.substvars
# pybuild can run pytest. However, when the top level directory is included in
# the path (done using manage.py), it results in import problems.
# https://www.mail-archive.com/debian-python@lists.debian.org/msg17997.html
override_dh_auto_test:
PYBUILD_SYSTEM=custom \
PYBUILD_TEST_ARGS="{interpreter} -m pytest" dh_auto_test
override_dh_installsystemd:
# Do not enable or start any service other than FreedomBox service. Use
# of --tmpdir is a hack to workaround an issue with dh_installsystemd
# (as of debhelper 13.5.2) that still has hardcoded search path of
# /lib/systemd/system for searching systemd services. See #987989 and
# reversion of its changes.
dh_installsystemd --tmpdir=debian/tmp/usr --package=freedombox plinth.service