pyzmq/packaging/debian/rules

53 lines
1.7 KiB
Makefile
Executable File

#!/usr/bin/make -f
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
ARCHITECTURE := $(shell dpkg-architecture -qDEB_HOST_ARCH)
export PYBUILD_DESTDIR_python3=debian/python3-zmq/
export PYBUILD_DESTDIR_python3-dbg=debian/python3-zmq-dbg/
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
# OBS build: add
# Macros:
# %_with_drafts 1
# at the BOTTOM of the OBS prjconf
OBS_BUILD_CFG=/.build/build.dist
ifeq ("$(wildcard $(OBS_BUILD_CFG))","")
BUILDCONFIG=$(shell ls -1 /usr/src/packages/SOURCES/_buildconfig* | head -n 1)
endif
ifneq ("$(wildcard $(OBS_BUILD_CFG))","")
ifneq ("$(shell grep drafts $(OBS_BUILD_CFG))","")
export PYBUILD_BUILD_ARGS=--enable-drafts
endif
endif
# User build: DEB_BUILD_OPTIONS=drafts dpkg-buildpackage
ifneq (,$(findstring drafts,$(DEB_BUILD_OPTIONS)))
export PYBUILD_BUILD_ARGS=--enable-drafts
endif
%:
dh $@ --with python3 --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
# cffi is only used for pypy
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
find debian/python3-zmq -depth -type d -empty -exec rmdir {} \;
find debian/python3-zmq-dbg -type d -depth -empty -exec rmdir {} \;
override_dh_auto_test:
override_dh_strip:
dh_strip --dbg-package=python3-zmq-dbg