File: rules

package info (click to toggle)
python-reportlab 3.3.0-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 7,124 kB
  • ctags: 9,979
  • sloc: python: 71,841; ansic: 19,093; xml: 1,494; makefile: 416; java: 193; sh: 100
file content (251 lines) | stat: -rwxr-xr-x 9,703 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#!/usr/bin/make -f

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

# all versions
PYVERS	:= $(shell pyversions -vs)
VER	:= $(shell /usr/bin/python -c 'import sys; print sys.version[:3]')

PY3VERS	:= $(shell py3versions -vs)
VER3	:= $(shell /usr/bin/python3 -c 'import sys; print(sys.version[:3])')

PY_INTERPRETER = /usr/bin/python

include /usr/share/python/python.mk

setup_options = --no-download-t1-files

build-arch: build
build-indep: build
build: build-stamp
build-stamp: $(PYVERS:%=build-python%) $(PYVERS:%=dbg-build-python%) \
  $(PY3VERS:%=build3-python%) $(PY3VERS:%=dbg-build3-python%)
	touch $@
build-python%:
	python$* setup.py build $(setup_options)
	touch $@
dbg-build-python%:
	python$*-dbg setup.py build $(setup_options)
	touch $@
build3-python%:
	python$* setup.py build $(setup_options)
	touch $@
dbg-build3-python%:
	python$*-dbg setup.py build $(setup_options)
	touch $@

# needs installed python-imaging, python-renderpm
build-doc-stamp:
	set -x; \
	cd docs \
	  && PYTHONPATH=$(wildcard $(CURDIR)/build/lib.*-*-$(VER)) python genAll.py
	$(MAKE) -C docs html PAPER=a4
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f *-stamp build-python* dbg-build-python* build3-python* dbg-build3-python*
	rm -rf compile build debian/tmp-dbg
	find -name '*.py[co]' -exec rm -f {} \;
	rm -rf *.log *.pdf # test runs ...
	rm -rf docs/build docs/*.pdf
	dh_clean

install: build-stamp install-prereq \
  $(PYVERS:%=install-python%) $(PYVERS:%=install-dbg-python%) \
  $(PY3VERS:%=install3-python%) $(PY3VERS:%=install3-dbg-python%)

install-prereq: build-stamp
	dh_testdir
	dh_testroot
	dh_prep

install-python%: install-prereq
	python$* setup.py install \
		$(setup_options) \
		--root $(CURDIR)/debian/python-reportlab \
		--install-layout=deb
	find debian/python-reportlab -name '*.ttf' | xargs -r rm -f
	find debian/python-reportlab -name '*.py[co]' | xargs -r rm -f

	mkdir -p debian/python-renderpm/$(call py_libdir,$*)/reportlab/graphics
	mv debian/python-reportlab/$(call py_libdir,$*)/reportlab/graphics/_renderPM.so \
		debian/python-renderpm/$(call py_libdir,$*)/reportlab/graphics/

	mkdir -p debian/python-reportlab-accel/$(call py_libdir,$*)/reportlab/lib
	mv debian/python-reportlab/$(call py_libdir,$*)/reportlab/lib/*.so \
		debian/python-reportlab-accel/$(call py_libdir,$*)/reportlab/lib/

	install -d debian/python-reportlab-doc/usr/share/doc/python-reportlab

	: # remove test, docs and demo files
	rm -rf debian/python-reportlab/usr/lib/python$*/*-packages/reportlab/demos
	rm -rf debian/python-reportlab/usr/lib/python$*/*-packages/reportlab/tools/pythonpoint/demos
	rm -rf debian/python-reportlab/usr/lib/python$*/*-packages/reportlab/docs
	rm -rf debian/python-reportlab/usr/lib/python$*/*-packages/reportlab/test
	rm -rf debian/python-reportlab/usr/lib/python$*/*-packages/reportlab/fonts

	rm -f debian/python-reportlab/usr/lib/python$*/*-packages/reportlab/README.txt
	rm -f debian/python-reportlab/usr/lib/python$*/*-packages/reportlab/CHANGES.txt

#	-find debian -name '*.so' | xargs rm -f

	: # Replace all '#!' calls to python with $(PY_INTERPRETER)
	: # and make them executable
	for i in `find debian/python-reportlab -type f`; do \
	  sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)\1,' \
		$$i > $$i.temp; \
	  if cmp --quiet $$i $$i.temp; then \
	    rm -f $$i.temp; \
	  else \
	    mv -f $$i.temp $$i; \
	    chmod 755 $$i; \
	    echo "fixed interpreter: $$i"; \
	  fi; \
	done

install-dbg-python%: install-prereq
	python$*-dbg setup.py install \
		$(setup_options) \
		--root $(CURDIR)/debian/python-reportlab-accel-dbg \
		--install-layout=deb
	find debian/python-reportlab-accel-dbg ! -type d ! -name '*_d.so' | xargs rm -f
	find debian/python-reportlab-accel-dbg -depth -empty -exec rmdir {} \;
	mkdir -p debian/python-renderpm-dbg/$(call py_libdir,$*)/reportlab/graphics
	mv debian/python-reportlab-accel-dbg/$(call py_libdir,$*)/reportlab/graphics/_renderPM_d.so \
		debian/python-renderpm-dbg/$(call py_libdir,$*)/reportlab/graphics

install3-python%: install-prereq
	python$* setup.py install \
		$(setup_options) \
		--root $(CURDIR)/debian/python3-reportlab \
		--install-layout=deb
	find debian/python3-reportlab -name '*.ttf' | xargs -r rm -f
	find debian/python3-reportlab -name '*.py[co]' | xargs -r rm -f

	find debian/python3-reportlab -name '__pycache__' | xargs -r rm -rf

	mkdir -p debian/python3-renderpm/$(call py_libdir,$*)/reportlab/graphics
	abitag=.$$(python$* -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \
	mv debian/python3-reportlab/$(call py_libdir,$*)/reportlab/graphics/_renderPM$$abitag*.so \
		debian/python3-renderpm/$(call py_libdir,$*)/reportlab/graphics/

	mkdir -p debian/python3-reportlab-accel/$(call py_libdir,$*)/reportlab/lib
	abitag=.$$(python$* -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \
	mv debian/python3-reportlab/$(call py_libdir,$*)/reportlab/lib/*$$abitag*.so \
		debian/python3-reportlab-accel/$(call py_libdir,$*)/reportlab/lib/

	: # remove test, docs and demo files
	rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/demos
	rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/tools/pythonpoint/demos
	rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/docs
	rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/test
	rm -rf debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/fonts

	rm -f debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/README.txt
	rm -f debian/python3-reportlab/usr/lib/python3/*-packages/reportlab/CHANGES.txt

#	-find debian -name '*.so' | xargs rm -f

	: # Replace all '#!' calls to python with $(PY_INTERPRETER)3
	: # and make them executable
	for i in `find debian/python3-reportlab -type f`; do \
	  sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)3\1,' \
		$$i > $$i.temp; \
	  if cmp --quiet $$i $$i.temp; then \
	    rm -f $$i.temp; \
	  else \
	    mv -f $$i.temp $$i; \
	    chmod 755 $$i; \
	    echo "fixed interpreter: $$i"; \
	  fi; \
	done

install3-dbg-python%: install-prereq
	python$*-dbg setup.py install \
		$(setup_options) \
		--root $(CURDIR)/debian/python3-reportlab-accel-dbg \
		--install-layout=deb
	find debian/python3-reportlab-accel-dbg ! -type d ! -name '*3?dm-*.so' | xargs rm -f
	find debian/python3-reportlab -name '__pycache__' | xargs -r rm -rf
	find debian/python3-reportlab-accel-dbg -depth -empty -exec rmdir {} \;
	mkdir -p debian/python3-renderpm-dbg/$(call py_libdir,$*)/reportlab/graphics
	abitag=.$$(python$*-dbg -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \
	mv debian/python3-reportlab-accel-dbg/$(call py_libdir,$*)/reportlab/graphics/_renderPM$$abitag*.so \
		debian/python3-renderpm-dbg/$(call py_libdir,$*)/reportlab/graphics

# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build build-doc-stamp install
	dh_testdir
	dh_testroot
	dh_installdocs -i README.txt
	dh_installdocs -ppython-reportlab-doc -X.buildinfo docs/*.pdf docs/build/html
	dh_sphinxdoc -i
	dh_installexamples -ppython-reportlab-doc demos/*
	rm -rf debian/python-reportlab-doc/usr/share/doc/python-reportlab-doc/examples/tests
	cp -p debian/testdemos.py debian/python-reportlab-doc/usr/share/doc/python-reportlab-doc/examples/.
	cp -rp tools/pythonpoint/demos debian/python-reportlab-doc/usr/share/doc/python-reportlab-doc/pythonpoint-demos
	: # Replace all '#!' calls to python with $(PY_INTERPRETER)
	: # and make them executable
	for i in `find debian/python-reportlab-doc -mindepth 3 -type f`; do \
	  sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)\1,' \
		$$i > $$i.temp; \
	  if cmp --quiet $$i $$i.temp; then \
	    rm -f $$i.temp; \
	  else \
	    mv -f $$i.temp $$i; \
	    chmod 755 $$i; \
	    echo "fixed interpreter: $$i"; \
	  fi; \
	done
	dh_installchangelogs -i
	dh_link -i
	dh_compress -i -X.py -X.pdf -X.js -Xodyssey.txt -X.xml
	dh_fixperms -i
	dh_python2 -ppython-reportlab
	dh_python3 -ppython3-reportlab
	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
	dh_installchangelogs -a

	rm -rf debian/python-renderpm-dbg/usr/share/doc/python-renderpm-dbg
	ln -s python-renderpm debian/python-renderpm-dbg/usr/share/doc/python-renderpm-dbg
	rm -rf debian/python-reportlab-accel-dbg/usr/share/doc/python-reportlab-accel-dbg
	ln -s python-reportlab-accel debian/python-reportlab-accel-dbg/usr/share/doc/python-reportlab-accel-dbg

	rm -rf debian/python3-renderpm-dbg/usr/share/doc/python3-renderpm-dbg
	ln -s python3-renderpm debian/python3-renderpm-dbg/usr/share/doc/python3-renderpm-dbg
	rm -rf debian/python3-reportlab-accel-dbg/usr/share/doc/python3-reportlab-accel-dbg
	ln -s python3-reportlab-accel debian/python3-reportlab-accel-dbg/usr/share/doc/python3-reportlab-accel-dbg

	dh_compress -a -X.py -X.pdf -Xodyssey.txt -X.xml
	dh_fixperms -a
	dh_python2 \
		-ppython-renderpm -ppython-reportlab-accel \
		-ppython-renderpm-dbg -ppython-reportlab-accel-dbg
	dh_python3 \
		-ppython3-renderpm -ppython3-reportlab-accel \
		-ppython3-renderpm-dbg -ppython3-reportlab-accel-dbg
	dh_strip -ppython-renderpm --dbg-package=python-renderpm-dbg
	dh_strip -ppython-reportlab-accel --dbg-package=python-reportlab-accel-dbg
	dh_strip -ppython3-renderpm --dbg-package=python3-renderpm-dbg
	dh_strip -ppython3-reportlab-accel --dbg-package=python3-reportlab-accel-dbg
	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 configure