]> git.llucax.com Git - software/mutt-debian.git/blob - debian/rules
Mention new thread pattern in changelog entry.
[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 stamp-h.in 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)
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         
129         # please dpkg-source
130         rm -f po/*.gmo
131         rm -f config.guess config.sub
132         
133         # remove build tree
134         rm -rf $(objdir)
135         
136         dh_clean
137         
138 #
139
140 install: debian/tmp/install-stamp
141 debian/tmp/install-stamp:
142         dh_testdir
143         dh_testroot
144         dh_clean
145         cd $(objdir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
146         
147         cd debian/tmp/usr/share/doc; \
148         rm -rf samples/iconv samples/ca-bundle.crt; \
149         mv NEWS NEWS.old; \
150         mv ChangeLog.old changelog.old; \
151         cp $(CURDIR)/UPDATING NEWS
152         
153         chmod +x debian/extra/lib/*
154         chmod +x debian/header.awk
155         debian/header.awk debian/patches/features/* >debian/tmp/README.Patches
156         
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#' \
162                 >> debian/tmp/Muttrc
163         cat debian/extra/rc/* >>debian/tmp/Muttrc
164         
165         touch $@
166
167 #
168
169 binary: binary-arch
170
171 binary-arch: build install
172         dh_testdir
173         dh_testroot
174         
175         dh_install
176         dh_installman
177         dh_installmime
178         dh_installmenu
179         dh_installdocs
180         dh_installexamples
181         dh_installchangelogs ChangeLog
182         
183         dh_link
184         dh_strip
185         dh_compress --exclude usr/share/doc/mutt/README.Patches
186         dh_fixperms --exclude usr/bin/mutt_dotlock
187         dh_installdeb
188         dh_shlibdeps
189         dh_gencontrol
190         dh_md5sums
191         dh_builddeb
192
193 binary-indep:
194         @echo "Nothing to do."
195
196 #
197
198 .PHONY: configure build clean install binary binary-arch binary-indep