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