]> git.llucax.com Git - software/mutt-debian.git/blob - debian/rules
Start preparing mutt-1.5.12; adjusted patches and such stuff.
[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         rm -rf debian/tmp/usr/share/doc/samples/iconv
148         rm -rf debian/tmp/usr/share/doc/samples/ca-bundle.crt
149         
150         chmod +x debian/extra/lib/*
151         chmod +x debian/header.awk
152         debian/header.awk debian/patches/features/* >debian/tmp/README.Patches
153         
154         cp $(objdir)/Muttrc.head debian/tmp/Muttrc
155         echo "# GnuPG configuration" >>debian/tmp/Muttrc
156         grep '^set' contrib/gpg.rc \
157                 | sed -e 's#pgpewrap#/usr/lib/mutt/pgpewrap#' \
158                 | sed -e 's#/usr/bin/gpg#gpg#' \
159                 >> debian/tmp/Muttrc
160         cat debian/extra/rc/* >>debian/tmp/Muttrc
161         
162         touch $@
163
164 #
165
166 binary: binary-arch
167
168 binary-arch: build install
169         dh_testdir
170         dh_testroot
171         
172         dh_install
173         dh_installman
174         dh_installmime
175         dh_installmenu
176         dh_installdocs
177         dh_installexamples
178         dh_installchangelogs ChangeLog
179         
180         dh_link
181         dh_strip
182         dh_compress --exclude usr/share/doc/mutt/README.Patches
183         dh_fixperms --exclude usr/bin/mutt_dotlock
184         dh_installdeb
185         dh_shlibdeps
186         dh_gencontrol
187         dh_md5sums
188         dh_builddeb
189
190 binary-indep:
191         @echo "Nothing to do."
192
193 #
194
195 .PHONY: configure build clean install binary binary-arch binary-indep