]> git.llucax.com Git - software/mutt-debian.git/blob - debian/rules
* Build a mutt-dbg package, and bump DH level to 5.
[software/mutt-debian.git] / debian / rules
1 #!/usr/bin/make -f
2
3 include /usr/share/quilt/quilt.make
4
5 ###
6 # header cache backend
7 # HCACHE_DB := bdb
8 HCACHE_DB := gdbm
9 # HCACHE_DB := qdbm
10 ###
11 # GPGME backend
12 # GPGME := --enable-gpgme
13 ###
14
15 # Configure arguments
16
17 ifeq ($(HCACHE_DB),bdb)
18     hcache_db := --without-gdbm --without-qdbm
19 endif
20 ifeq ($(HCACHE_DB),gdbm)
21     hcache_db := --without-qdbm --without-bdb
22 endif
23 ifeq ($(HCACHE_DB),qdbm)
24     hcache_db := --without-gdbm --without-bdb
25 endif
26
27 confflags =     --prefix=/usr                   \
28                 --sysconfdir=/etc               \
29                 --mandir=/usr/share/man         \
30                 --with-sharedir=/usr/share/mutt \
31                 --with-docdir=/usr/share/doc    \
32                 --with-mailpath=/var/mail       \
33                                                 \
34                 --disable-dependency-tracking   \
35                                                 \
36                 --enable-compressed             \
37                 --enable-debug                  \
38                 --enable-fcntl                  \
39                 --enable-hcache                 \
40                 $(GPGME)                        \
41                 --enable-imap                   \
42                 --enable-smtp                   \
43                 --enable-inodesort              \
44                 --enable-pop                    \
45                                                 \
46                 --with-curses                   \
47                 --with-gnutls                   \
48                 --with-idn                      \
49                 --with-mixmaster                \
50                 --with-sasl                     \
51                                                 \
52                 $(hcache_db)
53
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)
60 endif
61
62 # CFLAGS
63 CFLAGS   = -Wall -g
64 CPPFLAGS = -I/usr/include/qdbm
65 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
66         CFLAGS += -O0
67 else
68         CFLAGS += -O2
69 endif
70
71 # Directory to make the build on
72 objdir = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
73
74 configure: $(objdir)/configure-stamp
75 $(objdir)/configure-stamp: $(QUILT_STAMPFN)
76         dh_testdir
77         
78         autoreconf --install --include=m4
79         -mkdir $(objdir)
80         cd $(objdir) && \
81         env CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
82         ../configure $(confflags)
83         
84         echo '#include "config-debian.h"' >>$(objdir)/config.h
85         
86         touch $@
87
88 build build-arch: $(objdir)/build-stamp
89 $(objdir)/build-stamp: $(objdir)/configure-stamp
90         cd $(objdir) && $(MAKE) CFLAGS="$(CFLAGS)"
91         touch $@
92
93 install: debian/tmp/install-stamp
94 debian/tmp/install-stamp: $(objdir)/build-stamp
95         dh_testdir
96         dh_testroot
97         dh_clean
98         cd $(objdir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
99         
100         cd debian/tmp/usr/share/doc && \
101         rm -rf samples/iconv samples/ca-bundle.crt && \
102         mv NEWS NEWS.old && \
103         mv ChangeLog.old changelog.old && \
104         cp $(CURDIR)/UPDATING NEWS
105         
106         chmod +x debian/extra/lib/*
107         chmod +x debian/header.awk
108         debian/header.awk debian/patches/features/* >debian/tmp/README.Patches
109         
110         ( sed -e '/## More settings/,$$d' $(objdir)/Muttrc || exit 1 ; \
111           cat debian/extra/rc/Muttrc.foot ) > debian/tmp/Muttrc
112         
113         ( echo "# GnuPG configuration"; \
114           grep '^set' contrib/gpg.rc; \
115           echo ) > debian/tmp/gpg.rc
116         
117         touch $@
118
119 binary binary-arch: build install
120         dh_testdir
121         dh_testroot
122         
123         dh_installdirs
124         dh_install
125         dh_installman
126         dh_installmenu
127         dh_installdocs
128         dh_installexamples
129         dh_installchangelogs ChangeLog
130         install -m644 debian/mutt.lintian $(CURDIR)/debian/mutt/usr/share/lintian/overrides/mutt
131         
132         dh_strip --dbg-package=mutt-dbg
133         rm -rf $(CURDIR)/debian/mutt-dbg/usr/share/doc/mutt-dbg
134         dh_link
135         dh_compress --exclude usr/share/doc/mutt/README.Patches
136         dh_fixperms --exclude usr/bin/mutt_dotlock
137         dh_installdeb
138         dh_shlibdeps
139         dh_gencontrol
140         dh_md5sums
141         dh_builddeb
142
143 binary-indep:
144         @echo "Nothing to do."
145
146 clean: unpatch
147         dh_testdir
148         dh_testroot
149         
150         # please dpkg-source
151         rm -f po/*.gmo
152         touch PATCHES
153         
154         # remove build tree
155         rm -rf $(objdir)
156         
157         # remove autotool-generated files so they don't show up in the diff.gz
158         rm -f configure config.h.in
159         rm -f Makefile.in contrib/Makefile.in imap/Makefile.in doc/Makefile.in m4/Makefile.in
160         
161         # clean PATCHES hunks (blame quilt refresh)
162         for p in `grep -rl PATCHES debian/patches` ; do perl -wi debian/fix-PATCHES.pl $$p ; done
163         
164         dh_clean
165
166 .PHONY: configure build build-arch build-indep clean install binary binary-arch binary-indep patch