File: rules

package info (click to toggle)
python-bsddb3 6.2.9-1
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 1,592 kB
  • sloc: python: 14,884; ansic: 8,168; makefile: 235; sh: 5
file content (121 lines) | stat: -rwxr-xr-x 3,246 bytes parent folder | download
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PY3VERS   := $(shell py3versions -vs)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

p	= python-bsddb3
d	= debian/$(p)
p3	= python3-bsddb3
d3	= debian/$(p3)

build: build-stamp
build-arch: build-stamp
build-indep: build-stamp
build-stamp: $(PY3VERS:%=build3-python%) $(PY3VERS:%=dbg-build3-python%)
	touch $@

build3-python%:
	BERKELEYDB_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	BERKELEYDB_INCDIR=/usr/include \
	python$* setup3.py build $(build_args)
	touch $@

dbg-build3-python%:
	BERKELEYDB_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	BERKELEYDB_INCDIR=/usr/include \
	python$*-dbg setup3.py build $(build_args)
	touch $@

build-stamp-doc:
	: # removed in 6.2.9
	: $(MAKE) -C docs html
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp* build*-python* dbg-build*-python*
	rm -rf build docs/build
	rm -rf build docs/html
	find -name '*.py[co]' | xargs -r rm -f
	dh_clean

install: build install-prereq $(PY3VERS:%=install3-python%) $(PY3VERS:%=dbg-install3-python%)
	find debian -name '*.py[co]' | xargs -r rm -f

install-prereq:
	dh_testdir
	dh_testroot
	dh_prep

install3-python%:
	BERKELEYDB_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	BERKELEYDB_INCDIR=/usr/include \
	python$* setup3.py install \
		--root=$(CURDIR)/$(d3) --install-layout=deb $(build_args)
	rm -rf $(d3)/usr/lib/python$*/*-packages/bsddb3/tests
	mkdir -p $(d3)/usr/include/python$*m
	mv $(d3)/usr/include/python$*/* $(d3)/usr/include/python$*m/.
	rm -rf $(d3)/usr/include/python$*

dbg-install3-python%:
	BERKELEYDB_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	BERKELEYDB_INCDIR=/usr/include \
	python$*-dbg setup3.py install \
		--root=$(CURDIR)/$(d3)-dbg --install-layout=deb $(build_args)
	find debian/python3-*-dbg/usr/lib ! -type d ! -name '*.so' \
		| xargs -r rm -f
	find debian/python3-*-dbg -depth -empty -exec rmdir {} \;
	rm -rf $(d3)-dbg/usr/include/python$*
	mkdir -p $(d3)-dbg/usr/include/python$*dm
	ln -sf ../python$*m/bsddb3 $(d3)-dbg/usr/include/python$*dm/bsddb3


# Build architecture-independent files here.
binary-indep: build-stamp-doc
	dh_testdir
	dh_testroot
	dh_installdocs -i README.txt TODO.txt
	mkdir -p $(d)-doc/usr/share/doc/$(p)
	cp -pr docs/*.rst $(d)-doc/usr/share/doc/$(p)/
ifeq (0,1)
	cp -pr docs/build/html $(d)-doc/usr/share/doc/$(p)/
	dh_sphinxdoc -p$(p)-doc
	ln -sf ../$(p)/html $(d)-doc/usr/share/doc/$(p)-doc
	dh_link -p$(p)-doc \
		/usr/share/javascript/jquery/jquery.js \
		/usr/share/doc/$(p)/html/_static/jquery.js
endif
	dh_installchangelogs -i ChangeLog
	dh_compress -i -X.js -X.json -X.inv
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs -a README.txt TODO.txt
	dh_installchangelogs -a ChangeLog
	dh_python3 -a
	dh_link -a
	dh_strip -p$(p3) --dbg-package=$(p3)-dbg
	rm -rf $(d3)-dbg/usr/share/doc/$(p3)-dbg
	ln -s $(p3) $(d3)-dbg/usr/share/doc/$(p3)-dbg
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install