#!/usr/bin/make -f # -*- makefile -*- ## use hardening some flags DPKG_EXPORT_BUILDFLAGS = 1 # if you change values below, you might also need to fix d/salsa-ci.yml DEB_BUILD_MAINT_OPTIONS=hardening=+format,-fortify,+stackprotector,+relro export DEB_BUILD_MAINT_OPTIONS include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/pkg-info.mk export DEB_CPPFLAGS_MAINT_APPEND= ## only link what is needed export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed archconfflags := ifeq ($(DEB_HOST_ARCH_OS),linux) archconfflags += --enable-alsa else archconfflags += --disable-alsa endif archconfflags += --enable-jack archconfflags += --without-local-portaudio --without-local-portmidi ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) DEB_CPPFLAGS_MAINT_APPEND+=-D__BSD_VISIBLE endif ## set timestamp for reproducible builds DATE_FMT = %Y/%m/%d at %H:%M:%S UTC ifdef SOURCE_DATE_EPOCH BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)") else BUILD_DATE ?= $(shell date "+$(DATE_FMT)") endif CPPFLAGS_VERSION=-DPD_TIMESTAMP_STRING='\"compiled for Debian ($(DEB_VERSION)) on $(BUILD_DATE)\"' $(CPPFLAGS) # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \ ^\./\.git|\./\.pc/.*|\./debian/|.*\.wav|.*\.aiff|.*\.png|.*\.jpg|.*\.ico|.*\.icns|.*\.gif|.*\.ttf|.*\.strings|.*\.zip|.*\.tgz$ %: dh $@ override_dh_autoreconf: mkdir -p m4/generated dh_autoreconf override_dh_auto_configure: dh_auto_configure -- \ --program-transform-name='s/pd$$/puredata/' \ --libdir=/usr/lib/ \ $(archconfflags) override_dh_auto_build: debian/gui-plugins/pd-gui-plugin.1 dh_auto_build -- CPPFLAGS="$(CPPFLAGS_VERSION)" debian/gui-plugins/pd-gui-plugin.1: debian/gui-plugins/pd-gui-plugin help2man -N -n "enable or disable a Pd GUI plugin" $< > $@ override_dh_install: find debian/tmp -type f -name "pd.pc" -exec \ sed -e 's|^Libs: .*|Libs:|' -e 's| -fPIC||' -i {} + dh_install -X "*.la" -X "LICENSE.txt" -X "Makefile.am" rm -rf debian/puredata-doc/usr/share/puredata/doc/1.manual/1.introduction.txt rm -rf debian/puredata-doc/usr/share/puredata/doc/5.reference rm -rf debian/puredata-doc/usr/share/puredata/doc/7.stuff override_dh_auto_clean: -rm -f debian/gui-plugins/pd-gui-plugin.1 dh_auto_clean override_dh_installchangelogs: dh_installchangelogs src/CHANGELOG.txt override_dh_fixperms: dh_fixperms ifneq (,$(findstring puredata-extra, $(shell dh_listpackages))) find debian/puredata-extra/ -type f -name "*.pd_linux" -exec \ chmod 0644 {} + endif ifneq (,$(findstring puredata-gui, $(shell dh_listpackages))) find debian/puredata-gui/ -type f -name "pkg_mkIndex.tcl" -exec \ chmod 0755 {} + endif override_dh_shlibdeps: dh_shlibdeps ifneq (,$(findstring puredata-extra, $(shell dh_listpackages))) find debian/puredata-extra/ -type f -name "*.pd_linux" -exec \ dpkg-shlibdeps -Tdebian/puredata-extra.substvars {} + endif override_dh_strip: dh_strip ifneq (,$(findstring puredata-extra, $(shell dh_listpackages))) find debian/puredata-extra/ -type f -name "*.pd_linux" -exec \ strip --remove-section=.comment --remove-section=.note --strip-unneeded {} + endif override_dh_compress: dh_compress -X.pd -X.wav -X.aiff -X.txt licensecheck: LANG=C.UTF-8 licensecheck -i "$(DEB_COPYRIGHT_CHECK_IGNORE_REGEX)" --deb-machine -r . \ > debian/copyright_newhints cmp debian/copyright_hints debian/copyright_newhints \ && rm debian/copyright_newhints