File: rules

package info (click to toggle)
maildrop 1.3.7-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,776 kB
  • ctags: 2,107
  • sloc: ansic: 17,156; cpp: 9,694; makefile: 641; sh: 605; perl: 454
file content (63 lines) | stat: -rwxr-xr-x 2,116 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh -e

export DH_COMPAT=2
tmp=`pwd`/debian/maildrop

CFLAGS="-O2 -D_GNU_SOURCE"
if echo $DEB_BUILD_OPTIONS | grep -q debug; then
CFLAGS="$CFLAGS -g"
fi

case "$1" in
  build)
    dh_testdir
# trust on the auto-detect of qmail failing (for sendmail compability)
    [ -f config.status ] || CPPFLAGS="$CFLAGS" ./configure --prefix=/usr \
       --mandir='${prefix}/share/man' --libexecdir='${prefix}/lib/maildrop' \
       --enable-use-dotlock=1 --enable-use-flock=1 \
       --enable-sendmail=/usr/sbin/sendmail --enable-maildirquota
    [ -f maildrop/maildrop ] || make
    ;;
  clean)
    dh_testdir
    dh_testroot
    [ ! -f Makefile ] || make distclean
    rm -rf .deps
    dh_clean stamp-build
    ;;
  binary-arch|binary)
    [ -f config.status -a -f maildrop/maildrop ] || $0 build
    dh_testdir
    dh_testroot
    dh_clean -k
    dh_installdirs usr/bin usr/sbin usr/share/doc/maildrop etc
    make DESTDIR=$tmp install
# we use update-alternatives to manage these, because they're shared
# by other packages, notably qmail, courier-imap, mutt, mush
    (cd $tmp/usr/bin && mv maildirmake maildirmake.maildrop)
    (cd $tmp/usr/bin && mv dotlock dotlock.maildrop)
    (cd $tmp/usr/bin && mv deliverquota ../sbin/deliverquota.maildrop)
    (cd $tmp/usr/share/man/man1 && mv maildirmake.1 maildirmake.maildrop.1)
    (cd $tmp/usr/share/man/man8 && mv deliverquota.8 deliverquota.maildrop.8)
    (cd $tmp/usr/share/man/man1 && mv dotlock.1 dotlock.maildrop.1)
    install -m 644 -p debian/maildroprc $tmp/etc
    find $tmp/usr -type d -empty | xargs -r rmdir -p --ignore-fail-on-non-empty
    dh_installdocs README README.html AUTHORS INSTALL INSTALL.html maildroptips.txt
    dh_installchangelogs ChangeLog
# NB PAM config installed manually
#    dh_installpam
    if echo $DEB_BUILD_OPTIONS | grep -vq nostrip; then
      dh_strip
    fi
    dh_compress
    dh_fixperms
    (cd $tmp/usr/bin && chgrp mail maildrop dotlock.maildrop)
    (cd $tmp/usr/bin && chmod g+s maildrop dotlock.maildrop)
    dh_installdeb
    dh_perl
    dh_shlibdeps
    dh_gencontrol
    dh_md5sums
    dh_builddeb
    ;;
esac