#!/usr/bin/make -f #export DH_VERBOSE=1 # export DEB_BUILD_MAINT_OPTIONS = hardening=+pie ifeq ($(DEB_TARGET_ARCH),armel) # https://lists.debian.org/debian-arm/2024/01/msg00031.html # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1060104 export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-stackclash optimize=+lto else export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto endif # needed for the tests export DCMDICTPATH=$(CURDIR)/dcmdata/data/dicom.dic # deduce documentation option (build-indep target) ifeq "" "$(filter %-doc,$(shell dh_listpackages))" BUILDDOC = OFF else BUILDDOC = ON endif ifeq ($(DEB_HOST_ARCH_CPU),i386) DEB_CXXFLAGS_MAINT_APPEND += -fexcess-precision=fast endif # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001703 DEB_CXXFLAGS_MAINT_APPEND += -DENABLE_DCMJPLS_INTERLEAVE_NONE export DEB_CXXFLAGS_MAINT_APPEND # when BUILDDOC==OFF, convenient copies of doxygen man pages are used # when BUILDDOC==ON, doxygen man pages are being regenerated, this may leads to # improper md5sum... %: dh $@ --buildsystem=cmake CMAKE_EXTRA_FLAGS += \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DCMAKE_BUILD_TYPE:STRING=None \ -DCMAKE_CXX_EXTENSIONS:BOOL=OFF \ -DCMAKE_CXX_STANDARD:STRING=17 \ -DCMAKE_INSTALL_DATADIC:STRING=share/libdcmtk18 \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DDCMTK_ENABLE_PRIVATE_TAGS:BOOL=ON \ -DDCMTK_ENABLE_STL:BOOL=ON \ -DDCMTK_WITH_DOXYGEN:BOOL=$(BUILDDOC) \ -DDCMTK_WITH_ICONV:BOOL=OFF \ -DDCMTK_WITH_ICU:BOOL=OFF \ -DDCMTK_WITH_OPENSSL:BOOL=ON \ -DDCMTK_WITH_STDLIBC_ICONV:BOOL=OFF \ -DDCMTK_WITH_TIFF:BOOL=ON \ -DDCMTK_WITH_XML:BOOL=ON \ -DDCMTK_WITH_ZLIB:BOOL=ON \ -DUSE_COMPILER_HIDDEN_VISIBILITY:BOOL=ON \ ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) CMAKE_EXTRA_FLAGS += -DBUILD_TESTING:BOOL=OFF endif override_dh_auto_configure: dh_auto_configure -- $(CMAKE_EXTRA_FLAGS) override_dh_auto_build-arch: # need man page in -arch packages: #$(MAKE) -C obj-* man dh_auto_build sed -i 's% -ffile-prefix-map=[^ ]* % %' obj-*/CMakeFiles/DCMTKConfig.cmake # Let's be smart with building doc override_dh_auto_build-indep: $(MAKE) -C obj-* DOXYGEN override_dh_auto_test-arch: LD_LIBRARY_PATH=$(wildcard $(CURDIR)/obj-*/lib):$(LD_LIBRARY_PATH) dh_auto_test # No tests needed for docs override_dh_auto_test-indep: override_dh_auto_install-arch: dh_auto_install override_dh_auto_install-indep: # DESTDIR=$(CURDIR)/debian/tmp cmake --install obj-* --component data DESTDIR=$(CURDIR)/debian/tmp $(MAKE) -C obj-*/doxygen install DESTDIR=$(CURDIR)/debian/tmp $(MAKE) -C obj-*/dcmwlm/data install DESTDIR=$(CURDIR)/debian/tmp $(MAKE) -C obj-*/dcmdata/data install DESTDIR=$(CURDIR)/debian/tmp $(MAKE) -C obj-*/oficonv/data install override_dh_installdocs: dh_installdocs # do the doxygen / jquery fix: dh_link -pdcmtk-doc usr/share/javascript/jquery/jquery.js usr/share/doc/dcmtk-doc/html/jquery.js override_dh_install-arch: dh_install # --list-missing #remove test binaries rm ./debian/dcmtk/usr/bin/*_tests rm ./debian/dcmtk/usr/bin/drttest rm ./debian/dcmtk/usr/bin/mkreport rm ./debian/dcmtk/usr/bin/msgserv rm ./debian/dcmtk/usr/bin/wltest .PHONY: get-orig-source