#!/usr/bin/make -f # -*- makefile -*- DH_VERBOSE=1 ## 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/architecture.mk include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/pkg-info.mk FLAVORS=pd32 pd64 builddir=debian/build/flavor- deken_cpu = $(shell debian/dekencpu ${DEB_HOST_ARCH}) export DEB_CPPFLAGS_MAINT_APPEND= CONFIG := CONFIG_pd32 := CONFIG_pd64 := ifeq ($(DEB_HOST_ARCH_OS),linux) CONFIG += --enable-alsa else CONFIG += --disable-alsa endif CONFIG += --enable-jack CONFIG += --without-local-portaudio --without-local-portmidi CONFIG += --libdir=/usr/lib/ CONFIG_pd32 += --program-transform-name='s/pd$$/puredata/' CONFIG_pd32 += --enable-libpd --enable-libpd-utils CONFIG_pd64 += --program-transform-name='s/pd$$/puredata64/' --with-floatsize=64 --with-deken-cpu=$(deken_cpu) --with-external-extension=linux-$(deken_cpu)-64.so 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 export BUILD_DATE export DEB_VERSION %: dh $@ execute_before_dh_clean: test ! -d po.bak || rm -rf po test ! -d po.bak || mv po.bak po execute_before_dh_autoreconf: mkdir -p m4/generated cp -r po po.bak override_dh_auto_configure: $(patsubst %,configure_%,$(FLAVORS)) configure_%: dh_auto_configure --builddir $(builddir)$* -- $(strip $(CONFIG) $(CONFIG_$*)) override_dh_auto_build-arch: $(patsubst %,build_%,$(FLAVORS)) build_%: dh_auto_build -a --builddir $(builddir)$* execute_after_dh_auto_build-indep: debian/gui-plugins/pd-gui-plugin.1 override_dh_auto_install: $(patsubst %,install_%,$(FLAVORS)) install_%: dh_auto_install --builddir $(builddir)$* 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_installchangelogs: dh_installchangelogs src/CHANGELOG.txt execute_after_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_compress: dh_compress -X.pd -X.wav -X.aiff -X.txt debian/gui-plugins/pd-gui-plugin.1: debian/gui-plugins/pd-gui-plugin -help2man -N -n "enable or disable a Pd GUI plugin" -o $@ $< DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \ debian/.*|.*\.wav|.*\.aiff|.*\.png|.*\.jpg|.*\.ico|.*\.icns|.*\.gif|.*\.ttf|.*\.strings|.*\.zip|.*\.tgz # licensecheck v1 .PHONY: licensecheck licensecheck: LANG=C.UTF-8 licensecheck \ -i "^($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" \ --check '.*' --recursive --deb-machine --lines 0 * \ > debian/copyright_newhints cmp debian/copyright_hints debian/copyright_newhints \ && rm debian/copyright_newhints