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
|
#!/usr/bin/make -f
# DH_VERBOSE := 1
export LC_ALL=C.UTF-8
include /usr/share/dpkg/default.mk
# for hardening you might like to uncomment this:
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
MULTIARCH_SONAME = shasta.cpython-$(shell py3versions -vd | sed 's/\.//')-$(DEB_HOST_MULTIARCH).so
%:
dh $@ --with python3,sphinxdoc
override_dh_auto_configure:
dh_auto_configure -- -DBUILD_ID=${DEB_VERSION_UPSTREAM} \
-DBUILD_STATIC_EXECUTABLE=OFF \
-DBUILD_DYNAMIC_EXECUTABLE=ON
override_dh_auto_build: export http_proxy=127.0.0.1:9
override_dh_auto_build: export https_proxy=127.0.0.1:9
override_dh_auto_build:
dh_auto_build
# Move shared library into sphinx documentation folder for doc generation
find . -name "shasta.so" -exec cp {} docs/PythonApi/ \;
PYTHONPATH=docs/PythonApi/ python3 -m sphinx -N -bhtml docs/PythonApi/ build/html # HTML generator
override_dh_install-arch:
dh_install -a
# Rename shastaDynamic to shasta for ease
mv debian/shasta/usr/bin/shastaDynamic debian/shasta/usr/bin/shasta
# The library is in a more unusual place (nested within /usr/lib), so modify
# the ELF
chrpath -r /usr/lib/python3/dist-packages \
debian/shasta/usr/bin/shasta
patchelf \
--replace-needed shasta.so $(MULTIARCH_SONAME) \
debian/shasta/usr/bin/shasta
execute_after_dh_python3-arch:
patchelf \
--set-soname $(MULTIARCH_SONAME) \
$(CURDIR)/debian/python3-shasta/usr/lib/python3/dist-packages/$(MULTIARCH_SONAME)
override_dh_missing:
# No need to install docker files
find debian/tmp -type d -name docker | xargs rm -rf
# static library should not be installed
find debian/tmp -name shasta.a -delete
# dynamic library was installed manually before - so remove it from debian/tmp
find debian/tmp -name shasta.so -delete
# 11MB of generated docs should go into a separate package if this is considered sensible
# FIXME: for the moment do not install these
find debian/tmp -name docs | xargs rm -rf
# Remove rest of files which have already been installed
rm -rf debian/tmp/${CURDIR}
dh_missing --list-missing
|