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
|
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = yes
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk
# Upstream does not use CPPFLAGS
CFLAGS += $(CPPFLAGS)
PYTHON2=$(shell pyversions -vr)
# Prevent setuptools/distribute from accessing the internet.
export http_proxy = http://127.0.0.1:9
# architecture mapping $(DEB_HOST_ARCH) => libpfm4 ARCH
# in case that can't be derived from the cpu correctly
# e.g. cross-compiling for a 32-bit architecture on a 64-bit cpu
LIBPFM4_ARCH_armel = arm
LIBPFM4_ARCH_armhf = arm
LIBPFM4_ARCH_i386 = i386
LIBPFM4_ARCH_FLAG = $(foreach a,$(strip $(LIBPFM4_ARCH_$(DEB_HOST_ARCH))),ARCH=$a)
%:
dh $@ --with python2
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#test-python%:
# cd python && python$* setup.py test -vv
#
#override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%)
#endif
override_dh_auto_build:
dh_auto_build -- $(LIBPFM4_ARCH_FLAG)
dh_auto_build --sourcedirectory=python --buildsystem=python_distutils
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
./tests/validate
endif
override_dh_auto_install:
$(MAKE) install \
DESTDIR=$(CURDIR)/debian/tmp \
PREFIX=/usr \
LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
LDCONFIG=true
dh_auto_install --sourcedirectory=python --buildsystem=python_distutils
override_dh_auto_clean:
dh_auto_clean
dh_auto_clean --sourcedirectory=python --buildsystem=python_distutils
dh_auto_clean --sourcedirectory=python --buildsystem=makefile
override_dh_install:
dh_install -X.pyc
override_dh_missing:
dh_missing --list-missing
override_dh_makeshlibs:
dh_makeshlibs -a -- -c4
override_dh_shlibdeps:
dh_shlibdeps -a -- --warnings=7
|