summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: 10ce354d52007834e18873823cda3bd61b75179b (plain)
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
#!/usr/bin/make -f
# Should be include-links, but that somehow fails.
export DEBVER=$(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
export DATETIME:=$(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p')
export DATE_CMD:=env TZ=UTC LC_ALL=C.UTF-8 date
export DATE:=$(shell $(DATE_CMD) --date="$(DATETIME)" "+%b %_d %Y")
export TIME:=$(shell $(DATE_CMD) --date="$(DATETIME)" "+%H:%M:%S")
export DEB_CFLAGS_MAINT_APPEND=-Wno-write-strings \
                               -DDATE=\""$(DATE)"\" \
                               -DTIME=\""$(TIME)"\"
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export PYBUILD_NAME=apt

BUILDDIR3 := $(shell pybuild --print build_dir --interpreter python3)

%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=$(BUILDDIR3) sphinx-build doc/source build/sphinx/html

# this is nasty. instead of installing the files to one dir, overriding
# common ones, and then us picking out the files we want, we have to move some
# files from python3-apt to python-apt-common and then delete it from other
# packages.
override_dh_auto_install:
	dh_auto_install
	mkdir -p debian/python-apt-common/usr/share/
	mv debian/python3-apt/usr/share/locale debian/python-apt-common/usr/share/
	mv debian/python3-apt/usr/share/python-apt debian/python-apt-common/usr/share/
	rmdir debian/python3-apt/usr/share

override_dh_installdocs:
	dh_installdocs -p python3-apt --link-doc=python3-apt
	dh_installdocs --remaining-packages

override_dh_strip:
	dh_strip -p python3-apt
	
override_dh_compress:
	dh_compress -X.js -X_static/* -X _sources/* -X_sources/*/* -X.inv

# We ignore failures on hurd, since its locking is broken
override_dh_auto_test: export PYBUILD_SYSTEM=custom
override_dh_auto_test: export PYBUILD_TEST_ARGS=env PYTHONPATH={build_dir} {interpreter} tests/test_all.py
override_dh_auto_test:
	dh_auto_test || [ "$(DEB_BUILD_ARCH_OS)" = "hurd" ];