File: rules

package info (click to toggle)
python-reportlab 4.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,708 kB
  • sloc: python: 99,020; xml: 1,494; makefile: 143; sh: 12
file content (88 lines) | stat: -rwxr-xr-x 3,129 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
#!/usr/bin/make -f

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

export PYBUILD_DESTDIR_python3=debian/python3-reportlab/
setup_options = --no-download-t1-files

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

override_dh_auto_build:
	python3 setup.py build $(setup_options)
	set -x; cd docs && PYTHONPATH=$(CURDIR)/build/lib python3 genAll.py
	PYTHONPATH=$(CURDIR)/build/lib $(MAKE) -C docs html PAPER=a4

override_dh_auto_clean:
	rm -rf .pybuild build
	find -name '*.py[co]' -exec rm -f {} \;
	rm -rf *.log *.pdf # test runs ...
	rm -rf docs/build docs/*.pdf
	rm -rf src/reportlab.egg-info
	dh_clean

DOCDIR = debian/python-reportlab-doc/usr/share/doc/python-reportlab-doc
override_dh_auto_install:
	python3 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

	: # 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

	: # copy tests, then remove useless contents
	target_dir=debian/python3-reportlab/usr/share/doc/python3-reportlab; \
	mkdir -p $${target_dir}; cp -a tests $${target_dir}; \
	rm -f $${target_dir}/tests/*-out/*

	: # Replace all '#!' calls to python with python3
	: # and make them executable
	for i in `find debian/python3-reportlab -type f`; do \
	  sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python3\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_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
	if [ -d $(DOCDIR)/examples ]; then \
	 cp -p debian/testdemos.py $(DOCDIR)/examples/. ;\
	 cp -rp tools/pythonpoint/demos $(DOCDIR)/pythonpoint-demos; \
	fi
	: # Replace all '#!' calls to python with python3
	: # and make them executable
	for i in `find debian/python-reportlab-doc -mindepth 3 -type f`; do \
	  sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python3\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

override_dh_auto_test:
	@echo "not yet running the tests"