File: rules

package info (click to toggle)
python-bsddb3 6.1.0-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 2,104 kB
  • ctags: 3,450
  • sloc: python: 14,766; ansic: 8,158; makefile: 131; sh: 5
file content (159 lines) | stat: -rwxr-xr-x 4,705 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/usr/bin/make -f

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

PYVERS  := $(shell pyversions -vs)
PYVER   := $(shell pyversions -vd)
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: $(PYVERS:%=build-python%) $(PYVERS:%=dbg-build-python%) $(PY3VERS:%=build3-python%) $(PY3VERS:%=dbg-build3-python%)
	touch $@

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

dbg-build-python%:
	BERKELEYDB_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	BERKELEYDB_INCDIR=/usr/include \
	python$*-dbg setup2.py build $(build_args)
	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:
	$(MAKE) -C docs html
	touch $@

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

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

install-prereq:
	dh_testdir
	dh_testroot
	dh_clean -k

install-python%:
	mkdir -p $(d)/usr/bin
#	mkdir -p $(d)/usr/lib/python$*/site-packages
	BERKELEYDB_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	BERKELEYDB_INCDIR=/usr/include \
	python$* setup2.py install \
		--root=$(CURDIR)/$(d) --install-layout=deb $(build_args)
	rm -rf $(d)/usr/lib/python$*/*-packages/bsddb3/tests

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

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

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$*dmu
	ln -sf ../python$*mu/bsddb3 $(d3)-dbg/usr/include/python$*dmu/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/html $(d)-doc/usr/share/doc/$(p)/
	rm -rf $(d)-doc/usr/share/doc/python-bsddb3/html/static/jquery.js
	dh_link -p$(p)-doc \
		/usr/share/javascript/jquery/jquery.js \
		/usr/share/doc/python-bsddb3/html/static/jquery.js
	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
	dh_installchangelogs -i ChangeLog
	dh_python2 -i
	dh_python3 -i
	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_python2 -a
	dh_python3 -a
	dh_link -a
	dh_strip -p$(p) --dbg-package=$(p)-dbg
	dh_strip -p$(p3) --dbg-package=$(p3)-dbg
	rm -rf $(d)-dbg/usr/share/doc/$(p)-dbg
	ln -s $(p) $(d)-dbg/usr/share/doc/$(p)-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-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install