]> git.llucax.com Git - software/mutt-debian.git/blob - debian/rules
mutt (1.5.9-2sarge1) stable; urgency=low
[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 gdbm
12 HCACHE_WITH_DB := --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 configure: $(STAMP_DIR)/configure
48 $(STAMP_DIR)/configure: $(STAMP_DIR)/source.make
49         CC=cc ac_cv_path_ISPELL=ispell \
50         SENDMAIL=/usr/sbin/sendmail PERL=/usr/bin/perl \
51         $(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
52         ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
53                 --with-sharedir=/usr/share/mutt --with-docdir=/usr/share/doc \
54                 --with-mailpath=/var/mail \
55                 --enable-fcntl --enable-pop --enable-imap \
56                 --with-mixmaster --with-sasl2 --with-idn \
57                 --with-curses \
58                 --with-gnutls \
59                 --enable-debug \
60                 --enable-inodesort \
61                 --enable-compressed \
62                 --enable-hcache $(HCACHE_WITH_DB) \
63         "
64         touch $@
65
66 build: $(STAMP_DIR)/build
67 $(STAMP_DIR)/build: $(STAMP_DIR)/configure $(STAMP_DIR)/source.make
68         GROFF_NO_SGR=1 \
69         $(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
70                 make keymap_defs.h all CFLAGS=\"-O2 -g\" \
71         "
72         touch $@
73
74 binary-arch: $(STAMP_DIR)/build checkroot
75         dh_testdir
76         dh_clean -k
77         $(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD=" \
78                 $(MAKE) install DESTDIR=$D SUBDIRS=\"intl po\" \
79         "
80
81         dh_installdirs -p mutt usr/share/pixmaps usr/lib/mutt/ \
82                 usr/bin/ usr/share/doc/mutt/html/
83         dh_installmenu
84         dh_installdocs $B/README $B/README.SECURITY $B/README.SSL $B/NEWS \
85                 $B/doc/manual.txt $B/doc/PGP-Notes.txt extra/README.SMIME
86         cp $B/doc/*.html $D/usr/share/doc/mutt/html/
87         for file in README BUGS TODO; do \
88                 cp $B/imap/$$file $D/usr/share/doc/mutt/$$file.IMAP; \
89         done
90         # generate README.Patches
91         for file in $(EXTRA_PATCHES)/*; do \
92                 mawk -f debian/gen-README.Patches $$file >> \
93                         $D/usr/share/doc/mutt/README.Patches; \
94         done
95         dh_installexamples \
96                 $B/contrib/*rc $B/contrib/sample.muttrc-tlr \
97                 extra/ray.muttrc extra/colors.angdraug
98         dh_installman \
99                 $B/doc/mutt.man $B/doc/dotlock.man \
100                 $B/doc/muttrc.man $B/doc/mbox.man
101
102         install --mode=755 extra/debian-ldap-query extra/mailspell \
103                 extra/source-muttrc.d $D/usr/lib/mutt/
104         cp extra/mutt.xpm $D/usr/share/pixmaps/
105
106 #       some fixes to the package structure
107         mv $D/usr/bin/pgp* $D/usr/lib/mutt/
108         mv $D/usr/share/man/man1/dotlock.1 $D/usr/share/man/man1/mutt_dotlock.1
109         rm $D/etc/mime.types $D/usr/bin/muttbug $D/usr/bin/flea
110
111 #       I think the default config file with the embedded manual is too big
112         mv $D/etc/Muttrc $D/usr/share/doc/mutt/examples/
113         cp $B/Muttrc.head $D/etc/Muttrc
114         echo "# GnuPG configuration" >> $D/etc/Muttrc
115         grep ^set $B/contrib/gpg.rc \
116                 | sed -e 's#pgpewrap#/usr/lib/mutt/pgpewrap#' \
117                 | sed -e 's#/usr/bin/gpg#gpg#' \
118                 >> $D/etc/Muttrc
119         cat extra/smime-paths.rc extra/source-Muttrc.d.rc >> $D/etc/Muttrc
120
121         dh_installchangelogs $B/ChangeLog
122         dh_strip
123         dh_compress
124         dh_fixperms --exclude=usr/bin/mutt_dotlock
125         dh_installdeb
126         dh_shlibdeps
127         dh_gencontrol
128         dh_builddeb
129
130 binary: binary-arch
131
132 extra-clean:
133         find -type f \( -name "*.orig" -o -name "*.rej" \) -exec rm -v {} \;
134
135 checkroot:
136         test root = "`whoami`"
137
138 .PHONY: binary binary-arch build clean configure checkroot extra-clean