]> git.llucax.com Git - software/mutt-debian.git/blob - debian/rules
mutt (1.5.16-3) unstable; urgency=medium
[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         #ln -sf /usr/share/misc/config.sub .
79         #ln -sf /usr/share/misc/config.guess .
80         
81         # do not rebuild these files
82         touch configure.ac aclocal.m4 Makefile.in configure config.h.in
83         
84         -mkdir $(objdir)
85         cd $(objdir) && \
86         env CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
87         ../configure $(confflags)
88         
89         echo '#include "config-debian.h"' >>$(objdir)/config.h
90         
91         touch $@
92
93 build build-arch: $(objdir)/build-stamp
94 $(objdir)/build-stamp: $(objdir)/configure-stamp
95         cd $(objdir) && $(MAKE) CFLAGS="$(CFLAGS)"
96         touch $@
97
98 install: debian/tmp/install-stamp
99 debian/tmp/install-stamp: $(objdir)/build-stamp
100         dh_testdir
101         dh_testroot
102         dh_clean
103         cd $(objdir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
104         
105         cd debian/tmp/usr/share/doc && \
106         rm -rf samples/iconv samples/ca-bundle.crt && \
107         mv NEWS NEWS.old && \
108         mv ChangeLog.old changelog.old && \
109         cp $(CURDIR)/UPDATING NEWS
110         
111         chmod +x debian/extra/lib/*
112         chmod +x debian/header.awk
113         debian/header.awk debian/patches/features/* >debian/tmp/README.Patches
114         
115         ( sed -e '/## More settings/,$$d' $(objdir)/Muttrc || exit 1 ; \
116           cat debian/extra/rc/Muttrc.foot ) > debian/tmp/Muttrc
117         
118         ( echo "# GnuPG configuration"; \
119           grep '^set' contrib/gpg.rc; \
120           echo ) > debian/tmp/gpg.rc
121         
122         touch $@
123
124 binary binary-arch: build install
125         dh_testdir
126         dh_testroot
127         
128         dh_installdirs
129         dh_install
130         dh_installman
131         dh_installmenu
132         dh_installdocs
133         dh_installexamples
134         dh_installchangelogs ChangeLog
135         
136         dh_link
137         dh_strip
138         dh_compress --exclude usr/share/doc/mutt/README.Patches
139         dh_fixperms --exclude usr/bin/mutt_dotlock
140         dh_installdeb
141         dh_shlibdeps
142         dh_gencontrol
143         dh_md5sums
144         dh_builddeb
145
146 binary-indep:
147         @echo "Nothing to do."
148
149 clean: unpatch
150         dh_testdir
151         dh_testroot
152         
153         # please dpkg-source
154         rm -f po/*.gmo
155         #rm -f config.guess config.sub
156         touch PATCHES
157         
158         # remove build tree
159         rm -rf $(objdir)
160         
161         dh_clean
162
163 .PHONY: configure build build-arch build-indep clean install binary binary-arch binary-indep patch