File: rules

package info (click to toggle)
breezy 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 44,868 kB
  • sloc: python: 260,831; ansic: 1,925; makefile: 361; sh: 282; lisp: 107
file content (106 lines) | stat: -rwxr-xr-x 3,690 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

# Get the default Python version
PY3VERSION = $(shell py3versions -d -v)

export PYBUILD_NAME=breezy

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

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
CONCURRENCY = BRZ_CONCURRENCY=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	[ -d debian/brzhome ] || mkdir debian/brzhome
	$(CONCURRENCY) \
	BRZ_HOME=debian/brzhome \
	BRZ_PLUGIN_PATH=-site:-user \
	LC_ALL=C.UTF-8 \
	PYTHONPATH=$(CURDIR)/.pybuild/cpython3_$(PY3VERSION)_breezy/build \
	$(shell py3versions -d) ./brz -Derror selftest -v \
	-Oselftest.timeout=6000 -x bash_completion \
	-x breezy.tests.test_transport.TestSSHConnections.test_bzr_connect_to_bzr_ssh -x test_export_pot \
	-x breezy.tests.blackbox.test_branch.TestRemoteBranch.test_branch_local_remote \
	-x breezy.tests.blackbox.test_branch.TestRemoteBranch.test_branch_remote_remote
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf debian/brzhome
	rm -f brzlib/*_pyx.c
	# It also doesn't really clean every thing...
	ls doc/en/user-reference/*txt | grep -v readme.txt | xargs rm -rf
	rm -rf doc/developers/make.bat \
		doc/developers/Makefile \
		doc/*/_build/ \
		doc/en/release-notes/index.txt

override_dh_install:
	dh_install
	for py in $(shell py3versions -r); do \
		mkdir -p debian/python3-breezy.tests/usr/lib/$$py/dist-packages/breezy; \
		mv debian/python3-breezy/usr/lib/$$py/dist-packages/breezy/tests \
			debian/python3-breezy.tests/usr/lib/$$py/dist-packages/breezy/tests; \
	done
	# Install the documentation; since html and txt and intermixed
	# under doc/, this is handier than trying to do it from brz-doc.install.
	( cd doc && find -name "*.txt" -not -wholename "*/_build/*" -print0 ) | \
		xargs -r0 -i'{}' -n1 install -D -m 644 'doc/{}' \
		"debian/brz-doc/usr/share/doc/brz/txt/{}"
	rm debian/python3-breezy/usr/man/man1/brz.1 \
		debian/python3-breezy/usr/man/man1/git-remote-bzr.1 \
		debian/python3-breezy/usr/bin/bzr-receive-pack \
		debian/python3-breezy/usr/bin/brz \
		debian/python3-breezy/usr/bin/bzr-upload-pack \
		debian/python3-breezy/usr/bin/git-remote-bzr
	rmdir debian/python3-breezy/usr/man/man1 \
		  debian/python3-breezy/usr/man
	rm debian/python3-breezy-dbg/usr/man/man1/brz.1 \
		debian/python3-breezy-dbg/usr/man/man1/git-remote-bzr.1 \
		debian/python3-breezy-dbg/usr/bin/bzr-receive-pack \
		debian/python3-breezy-dbg/usr/bin/brz \
		debian/python3-breezy-dbg/usr/bin/bzr-upload-pack \
		debian/python3-breezy-dbg/usr/bin/git-remote-bzr
	rmdir debian/python3-breezy-dbg/usr/man/man1 \
		  debian/python3-breezy-dbg/usr/man

override_dh_auto_missing:
	dh_missing --fail-missing

override_dh_auto_build:
	dh_auto_build
	PYTHONHASHSEED=0 $(MAKE) docs-sphinx

override_dh_compress:
	dh_compress -X.xvg -X.pdf

override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip -ppython3-breezy
endif

override_dh_link:
	# symlink identical resources.
	( cd debian/brz-doc/usr/share/doc && fdupes -o name -r1q . | while read s; do \
	      set -- $$(echo $$s | tr ' ' '\n' | sort); \
	      f=$$1; shift; \
	      for d; do \
		  ln -sf /usr/share/doc/"$$d" "$$f"; \
	      done; \
	done )
	dh_link

override_dh_sphinxdoc:
ifneq "$(shell dh_listpackages | grep -- -doc)" ""
	dh_sphinxdoc -X searchtools.js
endif
	# dh_sphinxdoc chokes if we delete the extra licence files before it runs.
	find debian/brz-doc/usr/share/doc/brz -name "licence.txt" -print | xargs rm -f