#! /usr/bin/make -f include /usr/share/dpkg/architecture.mk export DEB_BUILD_MAINT_OPTIONS = hardening=+all, optimize=+lto export DEB_CFLAGS_MAINT_APPEND += -fvisibility=hidden -fvisibility-inlines-hidden export DEB_CXXFLAGS_MAINT_APPEND += -fvisibility=hidden -fvisibility-inlines-hidden # Build with NDEBUG (i.e. no debug messages) unless noopt build was requested ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) export DEB_CFLAGS_MAINT_APPEND += -DNDEBUG export DEB_CXXFLAGS_MAINT_APPEND += -DNDEBUG endif DH_AUTO_ARGS = --buildsystem=cmake --builddirectory=builddir DH_AUTO_STATIC_ARGS = --buildsystem=cmake --builddirectory=builddir-static CMAKE_ARGS = -DCMAKE_USE_RELATIVE_PATHS=ON -DWITH_ASF=ON -DWITH_MP4=ON \ -DBUILD_TESTING=$(if $(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)),OFF,ON) \ -DVISIBILITY_HIDDEN=ON override_dh_auto_configure: dh_auto_configure $(DH_AUTO_ARGS) -- $(CMAKE_ARGS) -DBUILD_SHARED_LIBS=ON execute_after_dh_auto_configure-arch: dh_auto_configure $(DH_AUTO_STATIC_ARGS) -- $(CMAKE_ARGS) \ -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=OFF execute_after_dh_auto_build-arch: dh_auto_build $(DH_AUTO_STATIC_ARGS) execute_after_dh_auto_test-arch: dh_auto_test $(DH_AUTO_STATIC_ARGS) execute_after_dh_auto_install-arch: # Keep the shared build's headers, pkg-config files and CMake targets. install -m644 builddir-static/taglib/libtag.a \ builddir-static/bindings/c/libtag_c.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ # Record libtag's math dependency for static consumers. sed -i '/^Libs:/a Libs.private: -lm' \ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/taglib.pc # C clients need the C++ runtime when linking the bindings statically. sed -i '/^Libs:/a Libs.private: -lstdc++' \ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/taglib_c.pc execute_after_dh_auto_clean: dh_auto_clean $(DH_AUTO_STATIC_ARGS) override_dh_installchangelogs: dh_installchangelogs CHANGELOG.md override_dh_installdocs: dh_installdocs -X '*.md5' # Generate docs when building indep execute_after_dh_auto_build-indep: # build-indep gets invoked in buildds as well... if [ -x /usr/bin/doxygen ]; then \ dh_auto_build --buildsystem=makefile --builddirectory=builddir -- docs; \ rm builddir/doc/html/jquery.js; \ ln -s /usr/share/javascript/jquery/jquery.js builddir/doc/html; \ fi # All-in-one default dh rule %: dh $@ $(DH_AUTO_ARGS)