#!/usr/bin/make -f include /usr/share/dpkg/buildflags.mk export DEB_BUILD_MAINT_OPTIONS = hardening=+all export NEOMUTT_TEST_DIR = $(shell pwd)/test-files # To correctly build doc/ with autosetup. # See https://github.com/neomutt/neomutt/issues/980. EXTRA_CFLAGS_FOR_BUILD:=$(shell dpkg-buildflags --get CFLAGS) EXTRA_LDFLAGS_FOR_BUILD:=$(shell dpkg-buildflags --get LDFLAGS) no_notmuch_architectures := alpha hppa hurd-i386 powerpcspe ppc64 sh4 sparc64 ifneq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH), $(no_notmuch_architectures))) notmuch = --notmuch else notmuch = --disable-notmuch endif %: dh $@ --builddirectory override_dh_autoreconf: override_dh_auto_configure: dh_auto_configure -- \ --mandir=/usr/share/man \ --libexecdir=/usr/libexec \ --with-mailpath=/var/mail \ --autocrypt \ --disable-paths-in-cflags \ --full-doc \ --gnutls \ --gpgme \ --gsasl \ --gss \ --lmdb \ --lua \ --lz4 \ $(notmuch) \ --pcre2 \ --sqlite \ --tokyocabinet \ --zlib \ --zstd execute_before_dh_auto_test: cd test-files && ./setup.sh execute_after_dh_auto_test: cd test-files && ./restore.sh override_dh_auto_install: dh_auto_install --destdir=debian/tmp override_dh_install: cd debian/tmp/usr/share/doc/neomutt && \ rm -rf samples/iconv samples/ca-bundle.crt chmod +x debian/extra/lib/* ( sed -e '/## More settings/,$$d' debian/tmp/etc/neomuttrc || exit 1 ; \ cat debian/extra/rc/neomuttrc.foot ) > debian/tmp/neomuttrc # Install html documentation in the html folder mkdir -p debian/tmp/usr/share/doc/neomutt/html find debian/tmp/usr/share -name *html -exec \ mv {} debian/tmp/usr/share/doc/neomutt/html/ \; set -e; for size in 32 64 128 256; do \ mkdir -p debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps; \ cp debian/tmp/usr/share/neomutt/logo/neomutt-$${size}.png debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps/neomutt.png; \ done mkdir -p debian/tmp/usr/share/icons/hicolor/scalable/apps cp debian/tmp/usr/share/neomutt/logo/neomutt.svg debian/tmp/usr/share/icons/hicolor/scalable/apps/neomutt.svg rm -rf debian/tmp/usr/share/neomutt/logo dh_install --exclude=INSTALL.md