#!/usr/bin/make -f # # (c) 2021-2025 Roland Rosenfeld # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 #export DH_OPTIONS=-v INSTDIR=`pwd`/debian/mailfromd export DEB_BUILD_MAINT_OPTIONS = hardening=+all GENERATED_FILES := $(shell grep -l 'THIS FILE IS GENERATED AUTOMATICALLY' \ src/builtin/*.[hc] src/*.[hc]) GENERATED_FILES += src/gram.c src/gram.h src/lex.c GENERATED_FILES += po/*.gmo %: dh $@ override_dh_autoreconf: # preserve files overwritten by dh_autoreconf: tar cf debian/autoreconf.tar INSTALL Makefile.in aclocal.m4 \ build-aux/compile \ build-aux/depcomp build-aux/install-sh build-aux/mdate-sh \ build-aux/missing build-aux/texinfo.tex \ configure doc/Makefile.in elisp/Makefile.in etc/Makefile.in \ gacopyz/Makefile.in imprimatur/Makefile.in lib/Makefile.in \ mflib/Makefile.in mtasim/Makefile.in pmult/Makefile.in \ src/Makefile.in src/builtin/Makefile.in tests/Makefile.in \ doc/mailfromd.info doc/mailfromd.info-1 doc/mailfromd.info-2 \ doc/mailfromd.info-3 doc/stamp-vti doc/version.texi \ build-aux/ltmain.sh m4/libtool.m4 m4/ltoptions.m4 \ m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 \ mfmod/Makefile.in tests/testsuite config.h.in dh_autoreconf override_dh_auto_configure: # preserve files from upstream tarball: tar cf debian/generated.tar $(GENERATED_FILES) rm -f $(GENERATED_FILES) dh_auto_configure -- \ --localstatedir=/var/lib \ --sysconfdir=/etc/mailfromd \ DEFAULT_USER=mailfromd ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) # workaround: no texinfo/makeinfo required in nodoc mode: touch doc/stamp-vti touch doc/*info doc/*info-* endif override_dh_auto_build-arch: # rebuild src/gram.c src/optab.[hc], required by imprimatur/check-docs.sh: (cd src; make gram.c optab.h optab.c) # rebuild po/*.gmo files: (cd po; make update-gmo) dh_auto_build -a ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) help2man -s 8 -n "a general-purpose mail filtering daemon" \ src/mailfromd > src/mailfromd.8 help2man -s 8 -n "a call out server" \ src/calloutd > src/calloutd.8 help2man -n "Mailfromd database management tool" \ src/mfdbtool > src/mfdbtool.1 help2man -n "MTA simulator for mailfromd" \ mtasim/mtasim > mtasim/mtasim.1 help2man -n "creates a Mfmod Structure" \ mfmod/mfmodnew > mfmod/mfmodnew.1 endif override_dh_auto_install-arch: dh_auto_install --destdir debian/mailfromd # Remove info files from mailfromd package (should go to mailfromd-doc): rm -rf debian/mailfromd/usr/share/info # install emacs lisp files (independently from emacs beeing installed): install -m0644 elisp/mfl-mode.el \ $(INSTDIR)/usr/share/emacs/site-lisp/mfl-mode.el install -m0644 elisp/obfemail-mode.el \ $(INSTDIR)/usr/share/emacs/site-lisp/obfemail-mode.el override_dh_auto_build-indep: ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) (cd doc; $(MAKE) manual) mv doc/manual/html_chapter doc/manual/html endif override_dh_auto_test-indep: echo "no testing when doing indep" override_dh_auto_install-indep: echo "avoid building binaries" override_dh_compress: dh_compress -X.pdf override_dh_auto_clean: dh_auto_clean rm -f src/mailfromd.8 src/calloutd.8 src/mfdbtool.1 mtasim/mtasim.1 \ mfmod/mfmodnew.1 src/gram.output rm -rf doc/manual rm -f doc/mailfromd.aux doc/mailfromd.cp doc/mailfromd.cps \ doc/mailfromd.fl doc/mailfromd.fn doc/mailfromd.kw \ doc/mailfromd.ky doc/mailfromd.log doc/mailfromd.mt \ doc/mailfromd.op doc/mailfromd.pg doc/mailfromd.pr \ doc/mailfromd.toc doc/mailfromd.tp doc/mailfromd.vr \ doc/otherdoc.texi override_dh_clean: dh_clean # restore files overwritten by dh_autoreconf: [ ! -f debian/autoreconf.tar ] || tar xf debian/autoreconf.tar rm -f debian/autoreconf.tar # restore generated files from upstream tarball: [ ! -f debian/generated.tar ] || tar xf debian/generated.tar rm -f debian/generated.tar