3 include /usr/share/quilt/quilt.make
12 # GPGME := --enable-gpgme
17 ifeq ($(HCACHE_DB),bdb)
18 hcache_db := --without-gdbm --without-qdbm
20 ifeq ($(HCACHE_DB),gdbm)
21 hcache_db := --without-qdbm --without-bdb
23 ifeq ($(HCACHE_DB),qdbm)
24 hcache_db := --without-gdbm --without-bdb
27 confflags = --prefix=/usr \
29 --mandir=/usr/share/man \
30 --with-sharedir=/usr/share/mutt \
31 --with-docdir=/usr/share/doc \
32 --with-mailpath=/var/mail \
34 --disable-dependency-tracking \
54 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
55 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
56 confflags += --build $(DEB_BUILD_GNU_TYPE)
57 # Only specify --host when cross-compiling
58 ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
59 confflags += --host $(DEB_HOST_GNU_TYPE)
64 CPPFLAGS = -I/usr/include/qdbm
65 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
71 # Directory to make the build on
72 objdir = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
74 $(objdir)-patched/build-stamp: $(QUILT_STAMPFN)
78 ###################### building mutt-patched ######################
79 autoreconf --install --include=m4
80 -mkdir $(objdir)-patched
81 cd $(objdir)-patched && \
82 env CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
83 ../configure $(confflags)
85 echo '#include "config-debian.h"' >> $(objdir)-patched/config.h
87 # we should just "make mutt" here, but that doesn't work yet
88 cd $(objdir)-patched && $(MAKE) CFLAGS="$(CFLAGS)"
92 build build-arch: $(objdir)/build-stamp
93 $(objdir)/build-stamp: $(objdir)-patched/build-stamp
94 ###################### building mutt ######################
95 QUILT_PATCHES=$(QUILT_PATCH_DIR) quilt --quiltrc /dev/null pop mutt.org
97 autoreconf --install --include=m4
100 env CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
101 ../configure $(confflags)
103 echo '#include "config-debian.h"' >>$(objdir)/config.h
105 cd $(objdir) && $(MAKE) CFLAGS="$(CFLAGS)"
110 ###################### install ######################
112 cd $(objdir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
114 cd debian/tmp/usr/share/doc && \
115 rm -rf samples/iconv samples/ca-bundle.crt && \
116 mv NEWS NEWS.old && \
117 mv ChangeLog.old changelog.old && \
118 cp $(CURDIR)/UPDATING NEWS
120 chmod +x debian/extra/lib/*
121 chmod +x debian/header.awk
122 debian/header.awk debian/patches/features/* \
123 debian/patches/mutt-patched/* > debian/tmp/README.Patches
125 ( sed -e '/## More settings/,$$d' $(objdir)/doc/Muttrc || exit 1 ; \
126 cat debian/extra/rc/Muttrc.foot ) > debian/tmp/Muttrc
128 ( echo "# GnuPG configuration"; \
129 grep '^set' contrib/gpg.rc; \
130 echo ) > debian/tmp/gpg.rc
132 # temporarily call the binary mutt-patched so dh_strip gets the debug file name right
133 install -D $(objdir)-patched/mutt debian/mutt-patched/usr/bin/mutt-patched
135 binary binary-arch: install
136 ###################### binary ######################
146 dh_installchangelogs ChangeLog
147 install -m644 debian/mutt.lintian $(CURDIR)/debian/mutt/usr/share/lintian/overrides/mutt
149 dh_strip --dbg-package=mutt-dbg
150 rm -rf $(CURDIR)/debian/mutt-dbg/usr/share/doc/mutt-dbg \
151 $(CURDIR)/debian/mutt-patched/usr/share/doc/mutt-patched
152 mv debian/mutt-patched/usr/bin/mutt-patched debian/mutt-patched/usr/bin/mutt
155 dh_compress --exclude usr/share/doc/mutt/README.Patches
156 dh_fixperms --exclude usr/bin/mutt_dotlock
163 build-indep binary-indep:
164 @echo "Nothing to do."
167 ###################### clean ######################
176 rm -rf $(objdir) $(objdir)-patched
178 # remove autotool-generated files so they don't show up in the diff.gz
179 rm -f configure config.h.in
180 rm -f Makefile.in contrib/Makefile.in imap/Makefile.in doc/Makefile.in m4/Makefile.in
182 # clean PATCHES hunks (blame quilt refresh)
183 for p in `grep -rl PATCHES debian/patches` ; do perl -wi debian/fix-PATCHES.pl $$p ; done
187 .PHONY: configure build build-arch build-indep clean install binary binary-arch binary-indep patch