File: rules

package info (click to toggle)
pyicu 1.9.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,340 kB
  • ctags: 1,774
  • sloc: cpp: 21,651; python: 1,077; makefile: 88
file content (111 lines) | stat: -rwxr-xr-x 3,052 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
#!/usr/bin/make -f

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

export LC_ALL=C

PKGNAME:=python-pyicu
PKG3NAME=python3-icu
PYVERS:=$(shell pyversions -vr)
PY3VERS:=$(shell py3versions -vr)

-include /usr/share/python/python.mk


build: build-arch
build-indep:
# We have nothing to do by default.
build-arch: build-stamp
build-stamp:
	dh_testdir
	
	# setup.py modifies test source files when building for Python 3, so
	# build out of tree.
	rm -rf build/py2 build/py3
	mkdir -p build/py2 build/py3
	cp -a $(filter-out build/py2 build/py3 debian,$(wildcard *)) build/py2/
	cp -a $(filter-out build/py2 build/py3 debian,$(wildcard *)) build/py3/
	
	set -e; \
	for py in $(PYVERS) $(PY3VERS); do  \
	    (cd build/py$${py%%.*}; \
	    python$$py setup.py build; \
	    python$$py-dbg setup.py build); \
	done
	set -e; \
	for file in `find $(CURDIR)/build -type f -name docs.py`; do \
	  mv "$$file" "`dirname $$file`/icu_docs.py"; done

ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	set -ex ;\
	for test in `ls test/*.py`; do \
	  for py in $(PYVERS) $(PY3VERS); do  \
	    (cd build/py$${py%%.*}; \
	    PYTHONPATH=`ls -d $$(pwd)/build/lib.*-$$py` \
	      python$$py $$test ;\
	    PYTHONPATH=`ls -d $$(pwd)/build/lib_d.*-$$py || ls -d $$(pwd)/build/lib.*-$$py-pydebug` \
	      python$$py-dbg $$test) ;\
	  done ;\
	done
endif

	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f install-stamp build-stamp
	find . -name "*.pyc" -print0 | xargs -0 rm -f
	find . -name __pycache__ -print0 | xargs -0 rm -rf
	rm -rf build
	dh_clean 

install: install-stamp
install-stamp: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	set -e; \
	for py in $(PYVERS); do  \
	    (cd build/py2; \
	    python$$py setup.py install --root=$(CURDIR)/debian/$(PKGNAME) --prefix=/usr $(py_setup_install_args) ;\
	    python$$py-dbg setup.py install --root=$(CURDIR)/debian/$(PKGNAME)-dbg --prefix=/usr $(py_setup_install_args)) ;\
	done
	set -e; \
	for py in $(PY3VERS); do  \
	    (cd build/py3; \
	    python$$py setup.py install --root=$(CURDIR)/debian/$(PKG3NAME) --prefix=/usr $(py_setup_install_args) ;\
	    python$$py-dbg setup.py install --root=$(CURDIR)/debian/$(PKG3NAME)-dbg --prefix=/usr $(py_setup_install_args)) ;\
	done
	
	dh_installdocs
	dh_installexamples
	touch install-stamp

binary-indep: build-indep install
# We have nothing to do by default.

binary-arch: build-arch install
	dh_testdir
	dh_testroot
	dh_installchangelogs CHANGES
	dh_compress -X.py
	dh_strip -p$(PKGNAME) --dbg-package=$(PKGNAME)-dbg
	dh_strip -p$(PKG3NAME) --dbg-package=$(PKG3NAME)-dbg
	dh_fixperms
	dh_python2
	dh_python3
	rm -rf debian/$(PKGNAME)-dbg/usr/share/doc/$(PKGNAME)-dbg
	ln -s $(PKGNAME) debian/$(PKGNAME)-dbg/usr/share/doc/$(PKGNAME)-dbg
	rm -rf debian/$(PKG3NAME)-dbg/usr/share/doc/$(PKG3NAME)-dbg
	ln -s $(PKG3NAME) debian/$(PKG3NAME)-dbg/usr/share/doc/$(PKG3NAME)-dbg
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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