File: rules

package info (click to toggle)
pyzmq 16.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,052 kB
  • ctags: 2,906
  • sloc: python: 13,502; ansic: 971; makefile: 133; sh: 51
file content (60 lines) | stat: -rwxr-xr-x 2,504 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

ARCHITECTURE := $(shell dpkg-architecture -qDEB_HOST_ARCH)
export PYBUILD_DESTDIR_python2=debian/python-zmq/
export PYBUILD_DESTDIR_python2-dbg=debian/python-zmq-dbg/
export PYBUILD_DESTDIR_python3=debian/python3-zmq/
export PYBUILD_DESTDIR_python3-dbg=debian/python3-zmq-dbg/
export PYBUILD_DESTDIR_pypy=debian/pypy-zmq/
export PYBUILD_DEBUG=1
# ignore that randomly hang or crash (gh-953)
export PYBUILD_TEST_ARGS=-v --ignore=zmq/tests/test_auth.py --ignore=zmq/tests/test_security.py
export DH_VERBOSE=1

%:
	dh $@ --with python2,python3,pypy --buildsystem=pybuild

override_dh_install:
	dh_install
	# remove a couple of header files already in python3-zmq
	find debian/python3-zmq-dbg/usr/lib/ ! -type d ! -name '*.so' -delete
	find debian/python-zmq-dbg/usr/lib/ ! -type d ! -name '*.so' -delete
	# cffi is only used for pypy
	rm -rf debian/python-zmq/usr/lib/python*/dist-packages/zmq/backend/cffi/
	rm -rf debian/python-dbg-zmq/usr/lib/python*/dist-packages/zmq/backend/cffi/
	rm -rf debian/python3-zmq/usr/lib/python*/dist-packages/zmq/backend/cffi/
	rm -rf debian/python3-dbg-zmq/usr/lib/python*/dist-packages/zmq/backend/cffi/
	find debian/python*-zmq/ -name compiler.json -delete
	find debian/python*-zmq/ -name config.json -delete
	# cython core is only used for cpython
	rm -rf debian/pypy-zmq/usr/lib/pypy/dist-packages/zmq/backend/cython
	# yield from isn't byte-compileable in Python 2.x
	find debian/python-zmq debian/pypy-zmq -name '*test_asyncio.py' -delete
	find debian/python-zmq debian/pypy-zmq -name '*asyncio.py' -delete

	# build shared libraries for pypy and install them
	pypy -c 'import zmq'
	mv -v zmq/backend/cffi/__pycache__/*so \
	  $(CURDIR)/debian/pypy-zmq/usr/lib/pypy/dist-packages/zmq/backend/cffi
	# put there by install, not needed
	rm -f $(CURDIR)/debian/pypy-zmq/usr/lib/pypy/dist-packages/_cffi*.so

	find debian/python-zmq -depth -type d -empty -exec rmdir {} \;
	find debian/python-zmq-dbg -type d -depth -empty -exec rmdir {} \;
	find debian/python3-zmq -depth -type d -empty -exec rmdir {} \;
	find debian/python3-zmq-dbg -type d -depth -empty -exec rmdir {} \;
	find debian/pypy-zmq -type d -depth -empty -exec rmdir {} \;

override_dh_auto_test:
# hard to debug race condition in monitor sockets
ifneq (,$(filter $(ARCHITECTURE), mipsel mips))
	-dh_auto_test -- --test-pytest
else
	dh_auto_test -- --test-pytest
endif

override_dh_strip:
	dh_strip --no-automatic-dbgsym