#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk # To access the "DEB_VERSION" variable export UPSTREAM_VERSION := $(shell echo "$(DEB_VERSION)" | cut -d '-' -f 1) export TARGET_INDEX := libOrthancPostgreSQLIndex.so export TARGET_STORAGE := libOrthancPostgreSQLStorage.so export DEB_BUILD_MAINT_OPTIONS := hardening=+all # Disable assert() checking from upstream project, for best performance # https://lists.debian.org/debian-med/2018/04/msg00132.html export DEB_CFLAGS_MAINT_APPEND=-DNDEBUG export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG %: dh $@ --builddirectory=Build CMAKE_EXTRA_FLAGS += \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DSTATIC_BUILD:BOOL=OFF \ -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE:BOOL=ON \ -DORTHANC_FRAMEWORK_SOURCE=system \ -DDEB_VERSION=$(DEB_VERSION) \ -DORTHANC_FRAMEWORK_USE_SHARED:BOOL=OFF \ "-DORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES=boost_filesystem boost_iostreams boost_locale boost_regex boost_thread jsoncpp pugixml uuid" \ -DCMAKE_BUILD_TYPE=None # The build type must be set to None, see #711515 # Automated generation of the "Built-Using" attribute in "d/control" # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=989128 # Adapted from: # https://wiki.debian.org/SIMDEverywhere#Approach (Point 6) override_dh_gencontrol: dh_gencontrol -- -Vorthancframework:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W liborthancframework-dev)" override_dh_auto_configure: dh_auto_configure --sourcedirectory=PostgreSQL -- $(CMAKE_EXTRA_FLAGS) override_dh_auto_install: dh_install Build/${TARGET_INDEX}.${UPSTREAM_VERSION} usr/lib/orthanc dh_install Build/${TARGET_STORAGE}.${UPSTREAM_VERSION} usr/lib/orthanc override_dh_link: dh_link usr/lib/orthanc/${TARGET_INDEX}.${UPSTREAM_VERSION} usr/share/orthanc/plugins/${TARGET_INDEX} dh_link usr/lib/orthanc/${TARGET_STORAGE}.${UPSTREAM_VERSION} usr/share/orthanc/plugins/${TARGET_STORAGE} override_dh_installchangelogs: dh_installchangelogs -k PostgreSQL/NEWS