File: rules

package info (click to toggle)
python-apt 1.8.4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,964 kB
  • sloc: cpp: 10,126; python: 7,021; makefile: 107; sh: 27
file content (58 lines) | stat: -rwxr-xr-x 1,946 bytes parent folder | download | duplicates (2)
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
# 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 PATH := $(CURDIR)/utils:$(PATH)
export pyversions := $(CURDIR)/utils/pyversions
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie

%:
	dh $@ --with python2,python3,sphinxdoc

override_dh_auto_build:
	dh_auto_build

override_dh_install:
	dh_movefiles
	dh_install

override_dh_sphinxdoc:
	set -e; if [ -z $(filter -a,$(DH_INTERNAL_OPTIONS)) ]; then \
		dh_sphinxdoc; \
	fi

override_dh_installdocs:
	set -e; if [ -z $(filter -a,$(DH_INTERNAL_OPTIONS)) ]; then \
		python3 setup.py build_sphinx; \
		dh_installdirs -ppython-apt-doc usr/share/doc/python-apt; \
	fi
	dh_installdirs -ppython-apt-dev usr/share/doc/python-apt
	dh_installdocs -p python-apt -p python-apt-dbg --link-doc=python-apt
	dh_installdocs -p python3-apt -p python3-apt-dbg --link-doc=python3-apt
	dh_installdocs --remaining-packages

override_dh_strip:
	dh_strip -p python-apt --dbg-package=python-apt-dbg
	dh_strip -p python3-apt --dbg-package=python3-apt-dbg
	
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:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	set -e; for python in $(shell $(pyversions) -r); do \
		$$python tests/test_all.py -q || [ "$(DEB_BUILD_ARCH_OS)" = "hurd" ]; \
	done;
else
	@echo "** tests disabled"
endif

override_dh_python2:
	dh_python2 -N python-apt-common