5 # Uncomment one of these if you're rebuilding using them instead of libdb4.X
13 confflags = --prefix=/usr \
15 --mandir=/usr/share/man \
16 --with-sharedir=/usr/share/mutt \
17 --with-docdir=/usr/share/doc \
18 --with-mailpath=/var/mail \
20 --disable-dependency-tracking \
38 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
39 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
41 confflags += --build $(DEB_BUILD_GNU_TYPE)
43 # Only specify --host when cross-compiling
44 ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
45 confflags += --host $(DEB_HOST_GNU_TYPE)
50 hcache_db := --without-gdbm --without-qdbm
52 ifeq ($(HCACHE_DB),gdbm)
53 hcache_db := --without-qdbm --without-bdb
56 ifeq ($(HCACHE_DB),qdbm)
57 hcache_db := --without-gdbm --without-bdb
62 # Directory to make the build on
64 objdir = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
71 CPPFLAGS = -I/usr/include/qdbm
73 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
81 configure: $(objdir)/configure-stamp
82 $(objdir)/configure-stamp:
85 ln -sf /usr/share/misc/config.sub .
86 ln -sf /usr/share/misc/config.guess .
89 quilt push -a || test $$? = 2
91 # sort the patches as printed by mutt -v
92 [ -e PATCHES.unsorted ] || mv PATCHES PATCHES.unsorted && \
93 env LC_COLLATE=C sort PATCHES.unsorted >PATCHES
95 # do not rebuild these files
96 touch configure.in aclocal.m4 Makefile.in configure config.h.in
100 env CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
101 ../configure $(confflags)
103 echo '#include "config-debian.h"' >>$(objdir)/config.h
109 build: $(objdir)/build-stamp
110 $(objdir)/build-stamp: $(objdir)/configure-stamp
112 $(MAKE) CFLAGS="$(CFLAGS)"
122 [ ! -e PATCHES.unsorted ] || mv PATCHES.unsorted PATCHES
123 quilt pop -a -R || test $$? = 2
132 rm -f config.guess config.sub
141 install: debian/tmp/install-stamp
142 debian/tmp/install-stamp:
146 cd $(objdir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
148 cd debian/tmp/usr/share/doc; \
149 rm -rf samples/iconv samples/ca-bundle.crt; \
151 mv ChangeLog.old changelog.old; \
152 cp $(CURDIR)/UPDATING NEWS
154 chmod +x debian/extra/lib/*
155 chmod +x debian/header.awk
156 debian/header.awk debian/patches/features/* >debian/tmp/README.Patches
158 cp $(objdir)/Muttrc.head debian/tmp/Muttrc
159 echo "# GnuPG configuration" >>debian/tmp/Muttrc
160 grep '^set' contrib/gpg.rc \
161 | sed -e 's#pgpewrap#/usr/lib/mutt/pgpewrap#' \
162 | sed -e 's#/usr/bin/gpg#gpg#' \
164 cat debian/extra/rc/* >>debian/tmp/Muttrc
172 binary-arch: build install
182 dh_installchangelogs ChangeLog
186 dh_compress --exclude usr/share/doc/mutt/README.Patches
187 dh_fixperms --exclude usr/bin/mutt_dotlock
195 @echo "Nothing to do."
199 .PHONY: configure build clean install binary binary-arch binary-indep