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