]> git.llucax.com Git - software/mutt-debian.git/blob - debian/rules
Import mutt_1.5.11-2
[software/mutt-debian.git] / debian / rules
1 #!/usr/bin/make -f
2 SHELL+= -e
3
4 export LC_ALL=C
5 include debian/scripts/vars
6
7 BUILD_DIR := $(SOURCE_DIR)/$(TAR_DIR)
8 B := $(BUILD_DIR)
9 D := $(CURDIR)/debian/mutt
10
11 # Comment this line if you want the header cache with qdbm or gdbm
12 HCACHE_WITH_DB := --without-qdbm --without-gdbm
13
14 clean:
15         $(MAKE) -f debian/sys-build.mk source.clean
16         dh_clean
17
18 # target used by the maintainer
19 unpack.nopatch: 
20         $(MAKE) -f debian/sys-build.mk source.build
21         rm -f $B/Muttrc $B/doc/muttrc.man \
22                 $B/doc/manual.sgml $B/doc/manual.txt $B/doc/*.html 
23
24 diff:
25         $(MAKE) -f debian/sys-build.mk make-diff
26
27 unpack: $(STAMP_DIR)/source.make
28 $(STAMP_DIR)/source.make:
29         $(MAKE) -f debian/sys-build.mk source.make
30         
31         # sort the patches list
32         sort $B/PATCHES > $B/PATCHES.temp
33         mv $B/PATCHES.temp $B/PATCHES
34
35         # rebuild these files   
36         rm -f $B/Muttrc $B/doc/muttrc.man \
37                 $B/doc/manual.sgml $B/doc/manual.txt $B/doc/*.html 
38
39         # we include some #defines in debian-config.h
40         echo '#include "debian-config.h"' >> $B/config.h.in
41
42         # do not rebuild these files
43         touch $B/configure.in $B/aclocal.m4 $B/Makefile.in $B/configure \
44                 $B/stamp-h.in $B/config.h.in
45         touch $@
46
47         # update config.guess and config.sub
48         -test -r /usr/share/misc/config.sub && \
49         cp -f /usr/share/misc/config.sub $B/config.sub
50         -test -r /usr/share/misc/config.guess && \
51         cp -f /usr/share/misc/config.guess $B/config.guess
52
53 configure: $(STAMP_DIR)/configure
54 $(STAMP_DIR)/configure: $(STAMP_DIR)/source.make
55         CPPFLAGS=-I/usr/include/qdbm   \
56         CC=cc ac_cv_path_ISPELL=ispell \
57         SENDMAIL=/usr/sbin/sendmail PERL=/usr/bin/perl \
58         $(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
59         ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
60                 --with-sharedir=/usr/share/mutt --with-docdir=/usr/share/doc \
61                 --with-mailpath=/var/mail \
62                 --enable-fcntl --enable-pop --enable-imap \
63                 --with-mixmaster --with-sasl --with-idn \
64                 --with-curses \
65                 --with-gnutls \
66                 --enable-debug \
67                 --enable-inodesort \
68                 --enable-compressed \
69                 --enable-hcache $(HCACHE_WITH_DB) \
70         "
71         touch $@
72
73 build: $(STAMP_DIR)/build
74 $(STAMP_DIR)/build: $(STAMP_DIR)/configure $(STAMP_DIR)/source.make
75         GROFF_NO_SGR=1 \
76         $(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
77                 make keymap_defs.h all CFLAGS=\"-O2 -g\" \
78         "
79         touch $@
80
81 binary-arch: $(STAMP_DIR)/build checkroot
82         dh_testdir
83         dh_clean -k
84         $(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
85                 $(MAKE) install DESTDIR=$D SUBDIRS=\"intl po\" \
86         "
87
88         dh_installdirs -p mutt usr/share/pixmaps usr/lib/mutt/ \
89                 usr/bin/ usr/share/doc/mutt/html/
90         dh_installmenu
91         dh_installdocs $B/README $B/README.SECURITY $B/README.SSL $B/NEWS \
92                 $B/doc/manual.txt $B/doc/PGP-Notes.txt extra/README.SMIME
93         cp $B/doc/*.html $D/usr/share/doc/mutt/html/
94         for file in README BUGS TODO; do \
95                 cp $B/imap/$$file $D/usr/share/doc/mutt/$$file.IMAP; \
96         done
97         # generate README.Patches
98         for file in $(EXTRA_PATCHES)/*; do \
99                 mawk -f debian/gen-README.Patches $$file >> \
100                         $D/usr/share/doc/mutt/README.Patches; \
101         done
102         dh_installexamples \
103                 $B/contrib/*rc $B/contrib/sample.muttrc-tlr \
104                 extra/ray.muttrc extra/colors.angdraug
105         dh_installman \
106                 $B/doc/mutt.1 $B/doc/dotlock.man \
107                 $B/doc/muttrc.man $B/doc/mbox.man
108
109         install --mode=755 extra/debian-ldap-query extra/mailspell \
110                 extra/source-muttrc.d $D/usr/lib/mutt/
111         cp extra/mutt.xpm $D/usr/share/pixmaps/
112
113 #       some fixes to the package structure
114         mv $D/usr/bin/pgp* $D/usr/lib/mutt/
115         mv $D/usr/share/man/man1/dotlock.1 $D/usr/share/man/man1/mutt_dotlock.1
116         rm $D/etc/mime.types $D/usr/bin/muttbug $D/usr/bin/flea
117
118 #       I think the default config file with the embedded manual is too big
119         mv $D/etc/Muttrc $D/usr/share/doc/mutt/examples/
120         cp $B/Muttrc.head $D/etc/Muttrc
121         echo "# GnuPG configuration" >> $D/etc/Muttrc
122         grep ^set $B/contrib/gpg.rc \
123                 | sed -e 's#pgpewrap#/usr/lib/mutt/pgpewrap#' \
124                 | sed -e 's#/usr/bin/gpg#gpg#' \
125                 >> $D/etc/Muttrc
126         cat extra/smime-paths.rc extra/source-Muttrc.d.rc >> $D/etc/Muttrc
127
128         dh_installchangelogs $B/ChangeLog
129         dh_strip
130         dh_compress
131         dh_fixperms --exclude=usr/bin/mutt_dotlock
132         dh_installdeb
133         dh_shlibdeps
134         dh_gencontrol
135         dh_builddeb
136
137 binary: binary-arch
138
139 extra-clean:
140         find -type f \( -name "*.orig" -o -name "*.rej" \) -exec rm -v {} \;
141
142 checkroot:
143         test root = "`whoami`"
144
145 .PHONY: binary binary-arch build clean configure checkroot extra-clean