File: rules

package info (click to toggle)
pyicu 2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,712 kB
  • sloc: cpp: 29,449; python: 1,490; makefile: 72
file content (95 lines) | stat: -rwxr-xr-x 2,256 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
#!/usr/bin/make -f

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

export LC_ALL=C

PKG3NAME=python3-icu
PY3VERS:=$(shell py3versions -vr)

-include /usr/share/python3/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/py3
	mkdir -p build/py3
	cp -a $(filter-out build/py3 debian,$(wildcard *)) build/py3/
	
	set -e; \
	for py in $(PY3VERS); do  \
	    (cd build/py$${py%%.*}; \
	    python$$py setup.py build; \
	    python$$py-dbg setup.py build); \
	done

ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	set -ex ;\
	for test in `ls test/*.py`; do \
	  for py in $(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_prep
	dh_installdirs
	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$(PKG3NAME) --dbg-package=$(PKG3NAME)-dbg
	dh_fixperms
	dh_python3
	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