File: rules

package info (click to toggle)
matplotlib 0.98.1-1%2Blenny4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,624 kB
  • ctags: 22,599
  • sloc: python: 76,915; cpp: 63,459; ansic: 5,353; makefile: 111; sh: 12
file content (112 lines) | stat: -rwxr-xr-x 2,925 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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

PYVERS := $(shell pyversions -v -r debian/control)
DEFPY := $(shell pyversions -v -d)
pd  := python-matplotlib-doc
p   := python-matplotlib
pdata := python-matplotlib-data

include /usr/share/quilt/quilt.make

# build
build: patch build-arch build-indep

build-indep: build-indep-stamp
build-indep-stamp:
	dh_testdir
	touch build-indep-stamp

build-arch:$(PYVERS:%=build-stamp-%)

build-stamp-%:
	dh_testdir
	python$* ./setup.py build $(PY_BUILD_FLAGS)
	touch $@


# clean
clean: clean-patched unpatch
clean-patched: patch
	dh_testdir
	dh_testroot
	for i in $(PYVERS); do python$(i) ./setup.py clean --all; done
	-rm -f *-stamp*
	-rm -rf build *.pyc *.pyo
	find ./lib -name '*.pyc' -exec rm {} \;

	rm -f lib/matplotlib/mpl-data/matplotlib.conf lib/matplotlib/mpl-data/matplotlibrc

	dh_clean

# install
install-arch: build-arch $(PYVERS:%=install-stamp-%)
	dh_testdir
	dh_testroot

install-stamp-%: build-stamp-%
	dh_testdir
	dh_testroot
	python$* ./setup.py install_lib \
		-d $(CURDIR)/debian/$(p)/usr/lib/python$*/site-packages/ --no-compile
	rm -rf $(CURDIR)/debian/$(p)/usr/lib/python$*/site-packages/matplotlib/mpl-data/
	rm -rf $(CURDIR)/debian/$(p)/usr/lib/python$*/site-packages/matplotlib/backends/Matplotlib.nib/

	touch $@

install-indep: build-indep
	dh_testdir -i
	dh_testroot -i
	dh_clean -k
	dh_install -p $(pdata)
	rm -fr $(CURDIR)/debian/$(pdata)/usr/share/matplotlib/mpl-data/fonts/ttf/Vera*.ttf
	rm -fr $(CURDIR)/debian/$(pdata)/usr/share/matplotlib/mpl-data/fonts/ttf/*.TXT
	rm -fr $(CURDIR)/debian/$(pdata)/usr/share/matplotlib/mpl-data/fonts/ttf/local.conf
	rm -fr $(CURDIR)/debian/$(pdata)/usr/share/matplotlib/mpl-data/fonts/pdfcorefonts/readme.txt
	chmod 644 $(CURDIR)/debian/$(pdata)/usr/share/matplotlib/mpl-data/images/*.svg


# binary
binary-indep: build-indep install-indep
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i CHANGELOG
	dh_installdocs -p$(pd) -i
	dh_installexamples -p$(pd) -i examples/*
	dh_compress -i -Xexamples -Xexamples/data -Xpdf
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build-arch install-arch
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a CHANGELOG
	dh_installdocs -p$(p) -a README.txt TODO API_CHANGES KNOWN_BUGS INTERACTIVE
	# make python scripts starting with '#!' executable
	for i in `find debian -mindepth 2 -type f ! -perm 755`; do \
	  if head -1 $$i | grep -q '^#!'; then \
	    chmod 755 $$i; \
	    echo "made executable: $$i"; \
	  fi; \
	done
	dh_pycentral -a
	dh_link -a
	dh_strip -a
	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