#!/usr/bin/make -f # export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow # See http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS) CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS) LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) COMMA = , ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) endif OPENGL_ES_ARCHITECTURES := armel armhf ifneq (,$(findstring $(DEB_HOST_ARCH), $(OPENGL_ES_ARCHITECTURES))) DEBHELPER_QT6 := -Nlibcgal-qt6-dev CMAKE_QT6 := -DWITH_CGAL_Qt6=OFF endif %: dh $@ $(DEBHELPER_QT6) override_dh_auto_clean: dh_auto_clean $(DEBHELPER_QT6) rm -fr build $(MAKE) -C debian/tests clean override_dh_auto_configure-arch: QTDIR= dh_auto_configure --builddirectory=build -- \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_demos=OFF -DWITH_examples=OFF \ -DCGAL_INSTALL_CMAKE_DIR=lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL $(CMAKE_QT6) QTDIR= dh_auto_configure --builddirectory=build/demo/CGAL_ipelets --sourcedirectory=demo/CGAL_ipelets -- \ -DCMAKE_BUILD_TYPE=Release \ -DCGAL_DIR=$(CURDIR)/build override_dh_auto_configure-indep: # empty override_dh_auto_build-arch: $(MAKE) $(NJOBS) -C build $(MAKE) $(NJOBS) -C build/demo/CGAL_ipelets override_dh_auto_build-indep: # empty override_dh_auto_test-arch: ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) $(MAKE) -C debian/tests rounding_modes_simple debian/tests/rounding_modes_simple $(MAKE) -C debian/tests rounding_math_simple debian/tests/rounding_math_simple $(MAKE) -C debian/tests rounding_modes_cgal debian/tests/rounding_modes_cgal endif override_dh_auto_test-indep: # empty override_dh_install-arch: # install files into debian/tmp $(MAKE) -C build DESTDIR=$(CURDIR)/debian/tmp install $(MAKE) -C build/demo/CGAL_ipelets DESTDIR=$(CURDIR)/debian/tmp install # remove -fdebug-prefix-map, -ffile-prefix-map, and -fmacro-prefix-map settings # from CGALConfig.cmake to avoid false positives in reproducible builds report sed -i 's/-f\(debug\|file\|macro\)-prefix-map=[^ ]* //' \ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL/CGALConfig.cmake # tweak installed documentation files mv debian/tmp/usr/share/doc/CGAL debian/tmp/usr/share/doc/cgal mv debian/tmp/usr/share/doc/cgal/CHANGES.md debian/tmp/usr/share/doc/cgal/changelog rm debian/tmp/usr/share/doc/cgal/LICENSE* rm debian/tmp/usr/share/doc/cgal/AUTHORS dh_install --sourcedir=debian/tmp dh_missing --list-missing ifeq (,$(findstring $(DEB_HOST_ARCH), $(OPENGL_ES_ARCHITECTURES))) # move Qt header and cmake files into libcgal-qt6-dev package mkdir -p debian/libcgal-qt6-dev/usr/include/CGAL mv debian/libcgal-dev/usr/include/CGAL/Qt debian/libcgal-qt6-dev/usr/include/CGAL mkdir -p debian/libcgal-qt6-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL mv debian/libcgal-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL/CGAL_Qt6* \ debian/libcgal-qt6-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL else # remove Qt header and cmake files # use -f to avoid build failures if the files should disappear again in future releases rm -rf debian/libcgal-dev/usr/include/CGAL/Qt rm -f debian/libcgal-dev/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/CGAL/CGAL_Qt6* endif # create symlinks to /usr/share/doc/libcgal-dev ifeq (,$(findstring $(DEB_HOST_ARCH), $(OPENGL_ES_ARCHITECTURES))) mkdir -p debian/libcgal-qt6-dev/usr/share/doc ln -s libcgal-dev debian/libcgal-qt6-dev/usr/share/doc/libcgal-qt6-dev endif override_dh_install-indep: mkdir -p debian/tmp/usr/share/doc/cgal # patches affecting the demos or examples will change the timestamps of affected files # use timestamp of debian/changelog to improve reproducibility tar cf - --sort=name --mode u=rwX,g=rX,o=rX --owner root --group root --mtime=$(CURDIR)/debian/changelog data | \ gzip --no-name --best >debian/tmp/usr/share/doc/cgal/data.tar.gz tar cf - --sort=name --mode u=rwX,g=rX,o=rX --owner root --group root --mtime=$(CURDIR)/debian/changelog demo | \ gzip --no-name --best >debian/tmp/usr/share/doc/cgal/demo.tar.gz tar cf - --sort=name --mode u=rwX,g=rX,o=rX --owner root --group root --mtime=$(CURDIR)/debian/changelog examples | \ gzip --no-name --best >debian/tmp/usr/share/doc/cgal/examples.tar.gz dh_install --sourcedir=debian/tmp dh_missing --list-missing mkdir -p debian/libcgal-demo/usr/share/doc ln -s libcgal-dev debian/libcgal-demo/usr/share/doc/libcgal-demo override_dh_installdocs: dh_installdocs -plibcgal-dev -plibcgal-ipelets debian/copyright override_dh_installchangelogs: dh_installchangelogs -plibcgal-dev -plibcgal-ipelets override_dh_gencontrol: dh_gencontrol -- -VIpe-Version=`dpkg-awk 'Package:^ipe$$' -- Version | grep Version | sed 's/Version: //;s/-[^-]*$$//'`