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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# needed for the tests
export DCMDICTPATH=$(shell ls /usr/share/libdcmtk*/dicom.dic | head -n 1)
# Find all Python versions
PYTHON3=$(shell py3versions -vd)
ALLPY=$(shell py3versions -vs)
%:
# NOTE: although Odil correctly builds in parallel, it requires a huge
# amount of RAM to do so. Disable parallel building to avoid build
# failures.
dh $@ --builddirectory=build --with python3 --no-parallel
# Base build: no wrappers
override_dh_auto_configure-arch:
dh_auto_configure -- \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PYTHON_WRAPPERS=OFF -DBUILD_JAVASCRIPT_WRAPPERS=OFF
override_dh_auto_build-nopy:
dh_auto_build
mv build build-nopy
# Reconfigure base build for specific Python version and build wrappers
# WARNING: builds for Python versions MUST be sequential since they use the
# same build directory
override_dh_auto_build-py: override_dh_auto_build-nopy
set -e; \
for Python in $(ALLPY); do \
echo "=== Building for Python $${Python} ==="; \
cp -a build-nopy build; \
dh_auto_configure -- \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PYTHON_WRAPPERS=ON -DBUILD_JAVASCRIPT_WRAPPERS=OFF \
-DPYTHON_EXECUTABLE=/usr/bin/python$${Python}; \
dh_auto_build; \
mv build build-py$${Python}; \
done
override_dh_auto_build-arch: override_dh_auto_build-nopy override_dh_auto_build-py
override_dh_auto_build-indep:
dh_auto_configure --builddirectory=build-indep -- \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PYTHON_WRAPPERS=ON -DBUILD_JAVASCRIPT_WRAPPERS=OFF \
-DPYTHON_EXECUTABLE=/usr/bin/python$(PYTHON3)
mkdir -p documentation/_build
cd documentation && doxygen
find documentation/_build -name "*.md5" -delete
# WARNING: tests for Python versions MUST be sequential since they use the
# same build directory
override_dh_auto_test-arch:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
set -e; \
for Python in $(ALLPY); do \
echo "=== Testing for Python $${Python} ==="; \
ln -s build-py$${Python} build; \
ln -sr ./build/wrappers/python ./build/odil; \
ln -sr ./wrappers/python/*.py ./build/odil; \
cd build && \
$(MAKE) install DESTDIR=../install && \
WORKSPACE=$(CURDIR) ../.ci/deb/post_build || true;\
cd ..; \
rm ./build/odil/*py; \
rm ./build/odil; \
rm build; \
rm -rf install; \
done
endif
override_dh_auto_install-arch-nopy:
ln -s build-nopy build
$(MAKE) -C build/src install DESTDIR=$(CURDIR)/debian/tmp
rm build
# WARNING: installs for Python versions MUST be sequential since they use the
# same build directory
override_dh_auto_install-arch-py: override_dh_auto_install-arch-nopy
set -e; \
for Python in $(ALLPY); do \
echo "=== Installing for Python $${Python} ==="; \
ln -s build-py$${Python} build; \
$(MAKE) -C build/wrappers/python install DESTDIR=$(CURDIR)/debian/tmp; \
rm build; \
done
override_dh_auto_install-arch: override_dh_auto_install-arch-nopy override_dh_auto_install-arch-py
override_dh_auto_install-indep:
ln -s build-indep build
$(MAKE) -C build/applications install DESTDIR=$(CURDIR)/debian/tmp
rm build
override_dh_install-arch:
dh_install
d-shlibmove \
--devunversioned \
--commit --multiarch --exclude-a --exclude-la \
--movedev debian/tmp/usr/include/* usr/include \
--override s/libboost_log.*-dev/libboost-log-dev/ \
debian/tmp/usr/lib/*.so
override_dh_clean:
dh_clean
find tests -name "*pyc" -delete
rm -rf build-nopy $(ALLPY:%=build-py%) build-indep documentation/_build
rm -f build
# These steps are not needed for arch-independent packages
override_dh_auto_configure-indep:
override_dh_auto_test-indep:
|