1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/usr/bin/make -f
PYTHON=python3
DIST=$(shell dpkg-vendor --query Vendor)
TARGET_DIST=$(shell dpkg-parsechangelog -S Distribution)
%:
dh $@ --with=systemd
override_dh_auto_build:
# copy the right template into place
cp data/50unattended-upgrades.$(DIST) data/50unattended-upgrades
$(PYTHON) setup.py build
override_dh_auto_test:
$(MAKE) -C test
override_dh_auto_install:
$(PYTHON) setup.py install \
--root=$(CURDIR)/debian/unattended-upgrades \
--install-layout=deb
override_dh_installinit:
# We do not want to run the init script in the postinst/prerm, its
# really only useful on shutdown, see Debian bug #645919.
dh_installinit -r --no-start
override_dh_auto_clean:
# Sanity-check before upload.
ifneq ($(TARGET_DIST),UNRELEASED)
for i in $$(md5sum data/50unattended-upgrades.* | grep -v md5sum | cut -d" " -f1); do \
if ! grep -q $$i data/50unattended-upgrades.md5sum ; then \
echo "ERROR: $$i is missing from data/50unattended-upgrades.md5sum"; \
exit 1; \
fi; \
done
endif
if sort data/50unattended-upgrades.md5sum | uniq -c | grep -v " 1 " ; then \
echo "ERROR: ^ duplicate lines in data/50unattended-upgrades.md5sum"; \
exit 1; \
fi
set -e; for f in unattended-upgrade unattended-upgrade-shutdown; do \
ln -nsf $$f $$f.py; \
py3compile $$f.py; \
rm -f $$f.py; \
done
$(PYTHON) setup.py clean -a
rm -rf .coverage \
test/.coverage \
test/.mypy_cache \
test/root.*/var/cache/apt/*.bin \
test/root.*/var/lib/dpkg/lock-frontend \
test/root.*/var/log \
test/root.unused-deps/var/cache/apt/archives/lock \
test/root.unused-deps/var/lib/apt/extended_states \
test/root.unused-deps/var/lib/dpkg/status \
test/root.unused-deps/var/run/unattended-upgrades.progress \
test/u-u.lock
|