File: rules

package info (click to toggle)
gadfly 1.0.0-16
  • links: PTS
  • area: main
  • in suites: buster, sid, stretch
  • size: 1,308 kB
  • ctags: 2,139
  • sloc: python: 12,216; ansic: 5,172; makefile: 89; perl: 35
file content (112 lines) | stat: -rwxr-xr-x 2,653 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

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

DEFAULT_PYTHON = python$(VER)

kjb_version=1:$(shell dpkg-parsechangelog | sed -n 's/^Version: //p')

include /usr/share/python/python.mk

build: build-indep build-arch

build-indep: build-indep-stamp
build-indep-stamp:
	dh_testdir
	for v in $(PYVERSIONS); do \
	  python$$v setup.py build || exit 1; \
	done
	touch $@

build-arch: build-arch-stamp
build-arch-stamp:
	dh_testdir
	cd kjbuckets && \
	for v in $(PYVERSIONS); do \
	  python$$v setup.py build || exit 1; \
	done
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-indep-stamp build-arch-stamp
	for v in $(PYVERSIONS); do \
	  python$$v setup.py clean --all; \
	done
	cd kjbuckets && \
	for v in $(PYVERSIONS); do \
	  python$$v setup.py clean --all; \
	done
	dh_clean

binary: binary-indep binary-arch

# pythonX.Y-gadfly, python-gadfly & gadfly & python-kjbuckets (default)
binary-indep: build-indep
	dh_testdir -i
	dh_testroot -i
	dh_prep -i
	dh_installdirs -i

	: # python-gadfly
	dh_installdocs -ppython-gadfly -Xinstallation -Xkjbuckets \
		-Xstructure -Xgfplus TODO.txt doc/*.txt
	dh_installexamples -ppython-gadfly doc/demo/kjParsing/*

	for v in $(PYVERSIONS); do \
	  python$$v setup.py install_lib --install-dir \
		debian/python-gadfly/usr/lib/python$$v/$(call py_sitename_sh, $$v) \
		--no-compile || exit 1; \
	done
	: # gadfly
	/usr/bin/python setup.py install_scripts \
		--install-dir debian/gadfly/usr/bin
	dh_installdocs -pgadfly -Xinstallation -Xkjbuckets -Xstructure \
		-Xgadfly -XkwParsing TODO.txt doc/*.txt

	dh_python2 -i

	: # python-gadfly
	dh_installdocs -ppython-gadfly
	dh_gencontrol -ppython-gadfly

	dh_installchangelogs -i CHANGES.txt
	dh_compress -i -X.py
	perl debian/dh_fixpythonscripts -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# python-kjbuckets (version-specific)
binary-arch: build-arch
	dh_testdir -a
	dh_testroot -a
	dh_prep -a
	dh_installdirs -a

	cd kjbuckets && \
	for v in $(PYVERSIONS); do \
	  python$$v setup.py install --install-layout=deb \
		--root $(CURDIR)/debian/python-kjbuckets $(py_setup_install_args) || exit 1; \
	done
	dh_installchangelogs -a CHANGES.txt
	dh_installdocs -a doc/kjbuckets.txt
	dh_installexamples -a doc/demo/kjbuckets/*
	dh_strip -a
	dh_compress -a -X.py
	perl debian/dh_fixpythonscripts -a
	dh_fixperms -a
	dh_python2 -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a -- -v'$(kjb_version)'
	dh_md5sums -a
	dh_builddeb -a

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