#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 TARGETDIR=./debian/nmh BUILD_DATE := $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p') export DEB_CFLAGS_MAINT_APPEND="-Wall" export CFLAGS:= -Wall $(shell dpkg-buildflags --get CFLAGS) export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) INSTALL = install INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif build-stamp: dh_testdir dh_autoreconf dh_auto_configure -- \ --prefix= \ --bindir='$${prefix}/usr/bin/mh' \ --sysconfdir='$${prefix}/etc' \ --libdir='$${prefix}/usr/lib' \ --mandir='$${prefix}/usr/share/man' \ --docdir='$${prefix}/usr/share/doc/nmh' \ --libexecdir='$${prefix}/usr/lib/mh' \ --with-tls \ --with-mts=sendmail/pipe \ --with-cyrus-sasl \ --with-oauth $(MAKE) sendmailpath=/usr/sbin/sendmail touch build-stamp build: build-stamp build-arch: build build-indep: clean: dh_testdir dh_testroot rm -f build-stamp [ ! -f Makefile ] || $(MAKE) distclean # generated file shouldn't end up in the debian diff rm -f sbr/dtimep.c rm -f config.log rm -f test/*/test-*.log test/*/test-*.trs test-suite.log test/*.log test/*.trs dh_autoreconf_clean dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs make install prefix=$(TARGETDIR) # run the check *after* putting everything in its place, # so that the required components and other files are found # by the tests. # az [2022-01-15 Sat 16:01] no longer enabled, one buildd doesn't cooperate [ -n "$(filter testsuite,$(DEB_BUILD_OPTIONS))" ] && $(MAKE) check || true # upstream install file isn't wanted rm -f $(TARGETDIR)/usr/share/doc/nmh/INSTALL # ditto for rpm build script and spec file rm -f $(TARGETDIR)/usr/share/doc/nmh/contrib/build_nmh $(TARGETDIR)/usr/share/doc/nmh/contrib/nmh.spec # definitely don't want the example script rmmproc.messageid in etc/nmh mv $(TARGETDIR)/etc/nmh/rmmproc.messageid $(TARGETDIR)/usr/share/doc/nmh/examples/ # now install the mime-support-aware mhn.defaults $(INSTALL_FILE) debian/mhn.defaults $(TARGETDIR)/etc/nmh/ # install bash-completions (newer location) $(INSTALL_DIR) $(TARGETDIR)/usr/share/bash-completion/completions $(INSTALL_FILE) debian/nmh.bash_completions $(TARGETDIR)/usr/share/bash-completion/completions/nmh # don't want to fiddle with makefile.in too much, so i fix things here: # install-mh manpage is in wrong section mv $(TARGETDIR)/usr/share/man/man1/install-mh.1mh $(TARGETDIR)/usr/share/man/man8/install-mh.8mh binary-indep: build install # nothing to do binary-arch: build install dh_testdir dh_testroot dh_installdocs dh_installexamples dh_installchangelogs ChangeLog dh_link dh_strip dh_strip_nondeterminism dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol find '$(TARGETDIR)' -depth -newermt '$(BUILD_DATE)' -print0 | \ xargs -0r touch --no-dereference --date='$(BUILD_DATE)' dh_md5sums dh_builddeb binary: binary-arch .PHONY: configure build clean install binary binary-arch binary-indep