]> git.llucax.com Git - software/mutt-debian.git/blob - debian/rules
mutt (1.5.16-1) experimental; urgency=low
[software/mutt-debian.git] / debian / rules
1 #!/usr/bin/make -f
2
3 include /usr/share/quilt/quilt.make
4
5 ###
6 # Uncomment one of these if you're rebuilding using them instead of libdb4.X
7 # HCACHE_DB := gdbm
8 # HCACHE_DB := qdbm
9 ###
10
11 # Configure arguments
12
13 hcache_db := --without-gdbm --without-qdbm
14 ifeq ($(HCACHE_DB),gdbm)
15     hcache_db := --without-qdbm --without-bdb
16 endif
17 ifeq ($(HCACHE_DB),qdbm)
18     hcache_db := --without-gdbm --without-bdb
19 endif
20
21 confflags =     --prefix=/usr                   \
22                 --sysconfdir=/etc               \
23                 --mandir=/usr/share/man         \
24                 --with-sharedir=/usr/share/mutt \
25                 --with-docdir=/usr/share/doc    \
26                 --with-mailpath=/var/mail       \
27                                                 \
28                 --disable-dependency-tracking   \
29                                                 \
30                 --enable-compressed             \
31                 --enable-debug                  \
32                 --enable-fcntl                  \
33                 --enable-hcache                 \
34                 --enable-gpgme                  \
35                 --enable-imap                   \
36                 --enable-smtp                   \
37                 --enable-inodesort              \
38                 --enable-pop                    \
39                                                 \
40                 --with-curses                   \
41                 --with-gnutls                   \
42                 --with-idn                      \
43                 --with-mixmaster                \
44                 --with-sasl                     \
45                                                 \
46                 $(hcache_db)
47
48 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
49 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
50 confflags += --build $(DEB_BUILD_GNU_TYPE)
51 # Only specify --host when cross-compiling
52 ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
53     confflags += --host $(DEB_HOST_GNU_TYPE)
54 endif
55
56 # CFLAGS
57 CFLAGS   = -Wall -g
58 CPPFLAGS = -I/usr/include/qdbm
59 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
60         CFLAGS += -O0
61 else
62         CFLAGS += -O2
63 endif
64
65 # Directory to make the build on
66 objdir = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
67
68 configure: $(objdir)/configure-stamp
69 $(objdir)/configure-stamp: $(QUILT_STAMPFN)
70         dh_testdir
71         
72         #ln -sf /usr/share/misc/config.sub .
73         #ln -sf /usr/share/misc/config.guess .
74         
75         # do not rebuild these files
76         touch configure.ac aclocal.m4 Makefile.in configure config.h.in
77         
78         -mkdir $(objdir)
79         cd $(objdir) && \
80         env CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
81         ../configure $(confflags)
82         
83         echo '#include "config-debian.h"' >>$(objdir)/config.h
84         
85         touch $@
86
87 build build-arch: $(objdir)/build-stamp
88 $(objdir)/build-stamp: $(objdir)/configure-stamp
89         cd $(objdir) && $(MAKE) CFLAGS="$(CFLAGS)"
90         touch $@
91
92 install: debian/tmp/install-stamp
93 debian/tmp/install-stamp: $(objdir)/build-stamp
94         dh_testdir
95         dh_testroot
96         dh_clean
97         cd $(objdir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
98         
99         cd debian/tmp/usr/share/doc && \
100         rm -rf samples/iconv samples/ca-bundle.crt && \
101         mv NEWS NEWS.old && \
102         mv ChangeLog.old changelog.old && \
103         cp $(CURDIR)/UPDATING NEWS
104         
105         chmod +x debian/extra/lib/*
106         chmod +x debian/header.awk
107         debian/header.awk debian/patches/features/* >debian/tmp/README.Patches
108         
109         ( sed -e '/## More settings/,$$d' $(objdir)/Muttrc || exit 1 ; \
110           cat debian/extra/rc/Muttrc.foot ) > debian/tmp/Muttrc
111         
112         ( echo "# GnuPG configuration"; \
113           grep '^set' contrib/gpg.rc; \
114           echo ) > debian/tmp/gpg.rc
115         
116         touch $@
117
118 binary binary-arch: build install
119         dh_testdir
120         dh_testroot
121         
122         dh_installdirs
123         dh_install
124         dh_installman
125         dh_installmenu
126         dh_installdocs
127         dh_installexamples
128         dh_installchangelogs ChangeLog
129         
130         dh_link
131         dh_strip
132         dh_compress --exclude usr/share/doc/mutt/README.Patches
133         dh_fixperms --exclude usr/bin/mutt_dotlock
134         dh_installdeb
135         dh_shlibdeps
136         dh_gencontrol
137         dh_md5sums
138         dh_builddeb
139
140 binary-indep:
141         @echo "Nothing to do."
142
143 clean: unpatch
144         dh_testdir
145         dh_testroot
146         
147         # please dpkg-source
148         rm -f po/*.gmo
149         #rm -f config.guess config.sub
150         touch PATCHES
151         
152         # remove build tree
153         rm -rf $(objdir)
154         
155         dh_clean
156
157 .PHONY: configure build build-arch build-indep clean install binary binary-arch binary-indep patch