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 stamp-h.in 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
122 [ ! -e PATCHES.unsorted ] || mv PATCHES.unsorted PATCHES
123 quilt pop -a -R || test $$? = 2
131 rm -f config.guess config.sub
140 install: debian/tmp/install-stamp
141 debian/tmp/install-stamp:
145 cd $(objdir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
147 cd debian/tmp/usr/share/doc; \
148 rm -rf samples/iconv samples/ca-bundle.crt; \
150 mv ChangeLog.old changelog.old; \
151 cp $(CURDIR)/UPDATING NEWS
153 chmod +x debian/extra/lib/*
154 chmod +x debian/header.awk
155 debian/header.awk debian/patches/features/* >debian/tmp/README.Patches
157 cp $(objdir)/Muttrc.head debian/tmp/Muttrc
158 echo "# GnuPG configuration" >>debian/tmp/Muttrc
159 grep '^set' contrib/gpg.rc \
160 | sed -e 's#pgpewrap#/usr/lib/mutt/pgpewrap#' \
161 | sed -e 's#/usr/bin/gpg#gpg#' \
163 cat debian/extra/rc/* >>debian/tmp/Muttrc
171 binary-arch: build install
181 dh_installchangelogs ChangeLog
185 dh_compress --exclude usr/share/doc/mutt/README.Patches
186 dh_fixperms --exclude usr/bin/mutt_dotlock
194 @echo "Nothing to do."
198 .PHONY: configure build clean install binary binary-arch binary-indep