Debian Codegraph @

packaging/debian/rules

raw
1 #!/usr/bin/make -f
2
3 DPKG_EXPORT_BUILDFLAGS = 1
4 include /usr/share/dpkg/buildflags.mk
5
6 ARCHITECTURE := $(shell dpkg-architecture -qDEB_HOST_ARCH)
7 export PYBUILD_DESTDIR_python3=debian/python3-zmq/
8 export PYBUILD_DESTDIR_python3-dbg=debian/python3-zmq-dbg/
9 export PYBUILD_DEBUG=1
10 # ignore that randomly hang or crash (gh-953)
11 export PYBUILD_TEST_ARGS=-v --ignore=zmq/tests/test_auth.py --ignore=zmq/tests/test_security.py
12 export DH_VERBOSE=1
13
14 # OBS build: add
15 # Macros:
16 # %_with_drafts 1
17 # at the BOTTOM of the OBS prjconf
18 OBS_BUILD_CFG=/.build/build.dist
19 ifeq ("$(wildcard $(OBS_BUILD_CFG))","")
20 BUILDCONFIG=$(shell ls -1 /usr/src/packages/SOURCES/_buildconfig* | head -n 1)
21 endif
22 ifneq ("$(wildcard $(OBS_BUILD_CFG))","")
23 ifneq ("$(shell grep drafts $(OBS_BUILD_CFG))","")
24 export PYBUILD_BUILD_ARGS=--enable-drafts
25 endif
26 endif
27
28 # User build: DEB_BUILD_OPTIONS=drafts dpkg-buildpackage
29 ifneq (,$(findstring drafts,$(DEB_BUILD_OPTIONS)))
30 export PYBUILD_BUILD_ARGS=--enable-drafts
31 endif
32
33 %:
34 dh $@ --with python3 --buildsystem=pybuild
35
36 override_dh_install:
37 dh_install
38 # remove a couple of header files already in python3-zmq
39 find debian/python3-zmq-dbg/usr/lib/ ! -type d ! -name '*.so' -delete
40 # cffi is only used for pypy
41 rm -rf debian/python3-zmq/usr/lib/python*/dist-packages/zmq/backend/cffi/
42 rm -rf debian/python3-dbg-zmq/usr/lib/python*/dist-packages/zmq/backend/cffi/
43 find debian/python*-zmq/ -name compiler.json -delete
44 find debian/python*-zmq/ -name config.json -delete
45
46 find debian/python3-zmq -depth -type d -empty -exec rmdir {} \;
47 find debian/python3-zmq-dbg -type d -depth -empty -exec rmdir {} \;
48
49 override_dh_auto_test:
50
51 override_dh_strip:
52 dh_strip --dbg-package=python3-zmq-dbg