#!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- # Copyright © 2015-2016 IOhannes m zmölnig # Description: Main Debian packaging script for mrpeach pkglibdir = /usr/lib/pd/extra #enable hardening export DEB_BUILD_MAINT_OPTIONS=hardening=+all # get SOURCE_DATE_EPOCH and DEB_VERSION include /usr/share/dpkg/pkg-info.mk ## 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 +=-DBUILD_DATE='\"compiled for Debian on $(BUILD_DATE)\"' CFLAGS+=$(CPPFLAGS) -I/usr/include/pd %: dh $@ override_dh_auto_build: dh_auto_build make -C osc \ CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" make -C net \ CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" make -C cmos \ CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" override_dh_auto_install: dh_auto_install -- prefix=/usr pkglibdir=$(pkglibdir) # fix permissions find $(CURDIR)/debian/tmp/ -name "*.pd_linux" -exec \ chmod 0644 {} + # replace license file with link to the Debian license file rm -f -- $(CURDIR)/debian/tmp/$(pkglibdir)/$(LIBRARY_NAME)/LICENSE.txt override_dh_installchangelogs: dh_installchangelogs debian/upstream_changelog override_dh_gencontrol: dh_gencontrol --package=pd-osc -- -v1:$(DEB_VERSION_UPSTREAM_REVISION) dh_gencontrol --remaining-packages override_dh_clean: dh_clean make clean -C osc make clean -C net make clean -C cmos licensecheck: licensecheck --deb-machine -r . \ | perl -00ne 'print unless /^(Files:)? ^(midifile/I_Wanna_Be_Sedated\.mid|debian/(changelog|copyright(|_hints|_newhints)))$ > debian/copyright_newhints cmp debian/copyright_hints debian/copyright_newhints \ && rm debian/copyright_newhints