Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 %:
4 dh $@ --with python3
5
6 # Enable hardening flags
7 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
8
9 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
10
11 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed
12
13 # Enable verbose output on the testsuite if a debug build is requested
14 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
15 RUNTESTFLAGS = -v -v -v --debug
16 endif
17
18 ifeq (,$(filter noguile,$(DEB_BUILD_PROFILES)))
19 WITH_GUILE= --with-guile
20 endif
21
22 LIBMU_SONAME = 9
23
24 override_dh_auto_configure:
25 DEFAULT_CUPS_CONFDIR=/usr/share/cups/mime \
26 MU_SIEVE_MODDIR=\$${libdir}/mailutils$(LIBMU_SONAME) \
27 dh_auto_configure -- \
28 --with-lispdir=\$${prefix}/share/emacs/site-lisp \
29 --enable-virtual-domains \
30 --enable-mh \
31 --enable-python \
32 --with-gnutls \
33 --with-berkeley-db \
34 --with-gdbm \
35 --with-kyotocabinet \
36 --with-gssapi \
37 --with-gsasl \
38 --with-mysql \
39 --with-postgres \
40 --disable-rpath \
41 --disable-static \
42 --disable-cxx \
43 --disable-nntp \
44 $(WITH_GUILE)
45
46 override_dh_auto_build:
47 dh_auto_build
48 $(MAKE) -C doc html
49
50 override_dh_auto_install:
51 dh_auto_install
52 # These binaries conflict with elm-me. We need to rename them, as
53 # we're using alternatives for them.
54 cd debian/tmp; \
55 for i in dotlock frm from messages mail movemail readmsg; do \
56 mv usr/bin/$$i usr/bin/$$i.mailutils; \
57 done
58
59 # Generate manpages, but remove the s[ug]id bits from binaries
60 # so LD_LIBRARY_PATH works.
61 chmod 755 $(CURDIR)/debian/tmp/usr/bin/dotlock.mailutils
62 chmod 755 $(CURDIR)/debian/tmp/usr/sbin/mda
63 sh debian/mangen.sh $(CURDIR)/debian/tmp/usr
64 # Restore correct perms to the binaries that need it.
65 chmod 2755 $(CURDIR)/debian/tmp/usr/bin/dotlock.mailutils
66 chmod 4755 $(CURDIR)/debian/tmp/usr/sbin/mda
67
68 # Get rid of files we don't want to install
69 find $(CURDIR)/debian/tmp -name "*.pyc" -delete
70 find $(CURDIR)/debian/tmp -name "*.la" -delete
71 find $(CURDIR)/debian/tmp/usr/share/man/man1 -name "*.1" -delete
72
73 override_dh_install:
74 dh_install -plibmailutils$(LIBMU_SONAME)t64 -Xlibmu_dbm
75 dh_install --remaining-packages
76
77 override_dh_auto_test:
78 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
79 $(MAKE) -k check RUNTESTFLAGS="$(RUNTESTFLAGS)" || true
80 endif
81
82 override_dh_fixperms:
83 dh_fixperms -Xdotlock.mailutils
84
85 override_dh_makeshlibs:
86 dh_makeshlibs -Xusr/lib/$(DEB_HOST_MULTIARCH)/mailutils$(LIBMU_SONAME) -- -c4