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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/architecture.mk
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
PERLVER := $(shell perl -MConfig -e 'print $$Config{version}')
PERL5LIB := /usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config-$(PERLVER)$(if $(PERL5LIB),:$(PERL5LIB))
export PERL5LIB
endif
PYVERS=$(shell py3versions --supported --version)
CMAKE_OPTS = \
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
-DENABLE_DOCS=ON \
-DENABLE_OSCAP_REMEDIATE_SERVICE=OFF \
-DENABLE_PERL=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python$$V \
override_dh_auto_clean:
for V in $(PYVERS); do \
dh_auto_clean --builddir=build-py$$V ; \
done
override_dh_auto_configure:
for V in $(PYVERS); do \
dh_auto_configure --builddir=build-py$$V -- \
$(CMAKE_OPTS) ; \
done
override_dh_auto_build:
for V in $(PYVERS); do \
dh_auto_build --builddir=build-py$$V ; \
done
override_dh_auto_install:
# Move Python files to separate folders so they don't overwrite
# each other at install time.
for V in $(PYVERS); do \
dh_auto_install --builddir=build-py$$V ; \
mv ${CURDIR}/debian/tmp/usr/lib/python3 ${CURDIR}/debian/tmp/usr/lib/python$$V ; \
chmod 0644 ${CURDIR}/debian/tmp/usr/lib/python$$V/dist-packages/openscap_py.py ; \
chmod 0644 ${CURDIR}/debian/tmp/usr/lib/python$$V/dist-packages/openscap_api.py ; \
done
find debian/tmp -name "*.la" -delete
rm -rf $(CURDIR)/debian/tmp/usr/share/openscap/cpe
$(RM) $(CURDIR)/debian/tmp/usr/share/doc/openscap/html/*.md5 \
$(CURDIR)/debian/tmp/usr/share/doc/openscap/html/*.map
override_dh_python3:
dh_python3 -popenscap-utils -ppython3-openscap --shebang=/usr/bin/python3
override_dh_installchangelogs:
dh_installchangelogs NEWS
# Skip tests when building for 'all'.
override_dh_auto_test-indep:
override_dh_auto_test-arch:
for V in $(PYVERS); do \
dh_auto_test --no-parallel --builddir=build-py$$V ; \
done
%:
dh $@ --with python3
|