File: rules

package info (click to toggle)
pycxx 6.2.5-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,212 kB
  • ctags: 2,729
  • sloc: cpp: 6,126; python: 756; sh: 89; ansic: 60; makefile: 54
file content (67 lines) | stat: -rwxr-xr-x 3,204 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
export DH_VERBOSE=1

PYVERS=$(shell pyversions -s)
PY3VERS=$(shell py3versions -s)

%:
	dh $@ --with python2,python3

override_dh_auto_clean:
	rm -rf build

override_dh_auto_build:
	set -e && for i in $(PYVERS); do $${i} setup.py build; done
	set -e && for i in $(PY3VERS); do $${i} setup.py build; done

override_dh_auto_install:
	dh_install -ppython-cxx-dev CXX/*.hxx        /usr/include/CXX/;
	dh_install -ppython-cxx-dev CXX/*.h          /usr/include/CXX/;
	dh_install -ppython-cxx-dev CXX/Python2/*    /usr/include/CXX/Python2;
	dh_install -ppython3-cxx-dev CXX/Python3/*   /usr/include/CXX/Python3;
	dh_install -ppython-cxx-dev Src/*.c          /usr/src/CXX/;
	dh_install -ppython-cxx-dev Src/*.cxx        /usr/src/CXX/;
	dh_install -ppython-cxx-dev Src/Python2/*    /usr/src/CXX/Python2;
	dh_install -ppython3-cxx-dev Src/Python3/*   /usr/src/CXX/Python3;
	dh_install debian/PyCXX.pc /usr/lib/pkgconfig/
	#should symlink to a common folder, but dh_link takes no wildcards
	# and replacing folders symlinks in upgrades is problematic (policy 6.5)
	# => wasting a little space preferable to more complex logic
	# CXX/ in pythonX.Y_d was a link in << 6.2.3 so there its fine
	set -e && for i in $(PYVERS); do \
		$${i} setup.py install --force --root=$(CURDIR)/debian/tmp --no-compile -O0 --install-layout=deb; \
		dh_install -ppython-cxx-dev CXX/*.hxx        /usr/include/$${i}/CXX/; \
		dh_install -ppython-cxx-dev CXX/*.h          /usr/include/$${i}/CXX/; \
		dh_install -ppython-cxx-dev CXX/Python2/*    /usr/include/$${i}/CXX/Python2; \
		dh_link -ppython-cxx-dev /usr/include/$${i}/CXX/ /usr/include/$${i}_d/CXX; \
		dh_install -ppython-cxx-dev Src/*.c          /usr/share/$${i}/CXX/; \
		dh_install -ppython-cxx-dev Src/*.cxx        /usr/share/$${i}/CXX/; \
		dh_install -ppython-cxx-dev Src/Python2/*    /usr/share/$${i}/CXX/Python2; \
		dh_install -ppython-cxx-dev usr/lib/python2*/dist-packages/CXX/__init__.py; \
	done
	set -e && for i in $(PY3VERS); do \
		$${i} setup.py install --force --root=$(CURDIR)/debian/tmp --no-compile -O0 --install-layout=deb; \
		2to3 -w -n $(CURDIR)/debian/tmp/usr/lib; \
		python_inc_dir=$$(readlink -f /usr/include/$$i)m; \
		abitag=$$($${i}-dbg -c "import sys; print(sys.abiflags)"); \
		pythond_inc_dir=$$(readlink -f /usr/include/$${i}$${abitag}); \
		dh_install -ppython3-cxx-dev CXX/*.hxx        $${python_inc_dir}/CXX/; \
		dh_install -ppython3-cxx-dev CXX/*.h          $${python_inc_dir}/CXX/; \
		dh_install -ppython3-cxx-dev CXX/Python3/*    $${python_inc_dir}/CXX/Python3; \
		dh_link -ppython3-cxx-dev $${python_inc_dir}/CXX/ $${pythond_inc_dir}/CXX; \
		dh_install -ppython3-cxx-dev Src/*.c          /usr/share/$${i}/CXX/; \
		dh_install -ppython3-cxx-dev Src/*.cxx        /usr/share/$${i}/CXX/; \
		dh_install -ppython3-cxx-dev Src/Python3/*    /usr/share/$${i}/CXX/Python3; \
		dh_install -ppython3-cxx-dev usr/lib/python3*/dist-packages/CXX/__init__.py; \
	done
	dh_auto_install

override_dh_installdocs:
	dh_installdocs -A debian/README.Debian

override_dh_fixperms:
	chmod 644 $(CURDIR)/debian/python*-cxx-dev/usr/share/doc/python*-cxx-dev/examples/*
	dh_fixperms

override_dh_compress:
	dh_compress -X.py -X.cxx -X.hxx