3 include /usr/share/quilt/quilt.make
4 QUILT = QUILT_PATCHES=$(QUILT_PATCH_DIR) quilt --quiltrc /dev/null
6 ###################### user serviceable parts ######################
9 # build a separate mutt-patched package?
12 # header cache backend
16 HCACHE_DB := tokyocabinet
19 GPGME := --enable-gpgme
22 ###################### variables ######################
24 ifneq ($(BUILD_PATCHED),yes)
25 export DH_OPTIONS := -Nmutt-patched
30 ifeq ($(HCACHE_DB),bdb)
31 hcache_db := --without-gdbm --without-qdbm --without-tokyocabinet
33 ifeq ($(HCACHE_DB),gdbm)
34 hcache_db := --without-qdbm --without-bdb --without-tokyocabinet
36 ifeq ($(HCACHE_DB),qdbm)
37 hcache_db := --without-gdbm --without-bdb --without-tokyocabinet
39 ifeq ($(HCACHE_DB),tokyocabinet)
40 hcache_db := --without-gdbm --without-bdb --without-qdbm
41 ifeq ($(shell dpkg --print-architecture),hurd-i386)
42 hcache_db := --without-bdb --without-qdbm
46 confflags = --prefix=/usr \
48 --mandir=/usr/share/man \
49 --with-sharedir=/usr/share/mutt \
50 --with-docdir=/usr/share/doc \
51 --with-mailpath=/var/mail \
53 --disable-dependency-tracking \
74 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
75 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
76 confflags += --build $(DEB_BUILD_GNU_TYPE)
77 # Only specify --host when cross-compiling
78 ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
79 confflags += --host $(DEB_HOST_GNU_TYPE)
84 CPPFLAGS = -I/usr/include/qdbm
85 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
91 # Directory to make the build on
92 objdir = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
94 ###################### main ######################
96 $(objdir)-patched/build-stamp: $(QUILT_STAMPFN)
99 -mkdir $(objdir)-patched
101 ifeq ($(BUILD_PATCHED),yes)
102 ###################### building mutt-patched ######################
103 $(QUILT) applied > PATCHES
104 autoreconf --install --include=m4
105 cd $(objdir)-patched && \
106 env CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
107 ../configure $(confflags)
109 echo '#include "config-debian.h"' >> $(objdir)-patched/config.h
111 # we should just "make mutt" here, but that doesn't work yet
112 cd $(objdir)-patched && $(MAKE) CFLAGS="$(CFLAGS)"
117 build build-arch: $(objdir)/build-stamp
118 $(objdir)/build-stamp: $(objdir)-patched/build-stamp
119 ###################### building mutt ######################
120 $(QUILT) pop mutt.org
121 $(QUILT) applied > PATCHES
123 autoreconf --install --include=m4
126 env CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
127 ../configure $(confflags)
129 echo '#include "config-debian.h"' >>$(objdir)/config.h
131 cd $(objdir) && $(MAKE) CFLAGS="$(CFLAGS)"
136 ###################### install ######################
140 cd $(objdir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
142 cd debian/tmp/usr/share/doc && \
143 rm -rf samples/iconv samples/ca-bundle.crt && \
144 mv NEWS NEWS.old && \
145 cp $(CURDIR)/UPDATING NEWS
147 chmod +x debian/extra/lib/*
148 chmod +x debian/header.awk
149 debian/header.awk debian/patches/features/* \
150 debian/patches/mutt-patched/* > debian/tmp/README.Patches
152 ( sed -e '/## More settings/,$$d' $(objdir)/doc/Muttrc || exit 1 ; \
153 cat debian/extra/rc/Muttrc.foot ) > debian/tmp/Muttrc
155 ( echo "# GnuPG configuration"; \
156 grep '^set' contrib/gpg.rc; \
157 echo ) > debian/tmp/gpg.rc
159 ifeq ($(BUILD_PATCHED),yes)
160 # temporarily call the binary mutt-patched so dh_strip gets the debug file name right
161 install -D $(objdir)-patched/mutt debian/mutt-patched/usr/bin/mutt-patched
166 install -m644 debian/bug/control $(CURDIR)/debian/mutt/usr/share/bug/mutt
167 install debian/bug/script $(CURDIR)/debian/mutt/usr/share/bug/mutt
169 binary binary-arch: install
170 ###################### binary ######################
177 dh_installchangelogs ChangeLog
180 dh_strip --dbg-package=mutt-dbg
181 rm -rf $(CURDIR)/debian/mutt-dbg/usr/share/doc/mutt-dbg \
182 $(CURDIR)/debian/mutt-patched/usr/share/doc/mutt-patched
183 ifeq ($(BUILD_PATCHED),yes)
184 mv debian/mutt-patched/usr/bin/mutt-patched debian/mutt-patched/usr/bin/mutt
188 dh_compress --exclude usr/share/doc/mutt/README.Patches
189 dh_fixperms --exclude usr/bin/mutt_dotlock
196 build-indep binary-indep:
197 @echo "Nothing to do."
200 ###################### clean ######################
209 rm -rf $(objdir) $(objdir)-patched
211 # remove autotool-generated files so they don't show up in the diff.gz
212 rm -f configure config.h.in
213 rm -f Makefile.in contrib/Makefile.in imap/Makefile.in doc/Makefile.in m4/Makefile.in
217 .PHONY: configure build build-arch build-indep clean install binary binary-arch binary-indep patch