summaryrefslogtreecommitdiff
path: root/packages/mail-filter/procmail/procmail-3.22-r1.exheres-0
blob: cd2dbd0dbbba143d057dea5de3c19da4494621a5 (plain)
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
# Copyright 2008, 2009 Ingmar Vanhassel <ingmar@exherbo.org>
# Distributed under the terms of the GNU General Public License v2
# Based in part upon 'procmail-3.22.ebuild' from Gentoo, which is:
#     Copyright 1999-2008 Gentoo Foundation.


SUMMARY="Mail delivery agent/filter"
HOMEPAGE="http://www.procmail.org/"
DOWNLOADS="mirror://procmail/${PNV}.tar.gz"

LICENCES="|| ( Artistic GPL-2 )"
SLOT="0"
PLATFORMS="~amd64 ~x86"
MYOPTIONS=""

DEPENDENCIES="
    build:
        virtual/mta
    build+run:
        group/mail"

DEFAULT_SRC_PREPARE_PATCHES=(
    "${FILES}/${PN}-pipealloc.patch"
    "${FILES}/${PN}-maildir.patch"
    -p0 "${FILES}/${PN}-comsat-segfault.patch"
    "${FILES}/${PN}-maxprocs-fix.patch"
    -p1 "${FILES}/${PN}-glibc-2.10.1.patch"
)
DEFAULT_SRC_COMPILE_PARAMS=( CFLAGS0="${CFLAGS}" LDFLAGS0="${LDFLAGS}" STRIP="" )
DEFAULT_SRC_INSTALL_PARAMS=( BINDIR="${IMAGE}/usr/$(exhost --target)/bin" MAN1DIR="${IMAGE}/usr/share/man/man1" MAN5DIR="${IMAGE}/usr/share/man/man5" install )
DEFAULT_SRC_INSTALL_EXTRA_DOCS=( FEATURES )

src_prepare() {
    default

    edo sed -e "s:LOCKINGTEST=__defaults__:#&:" \
            -e "/LOCKINGTEST=\/tmp/s:^#::" \
            -i Makefile
}

src_install() {
    default

    edo chown root:mail "${IMAGE}"/usr/$(exhost --target)/bin/procmail
    edo chown :mail "${IMAGE}"/usr/$(exhost --target)/bin/lockfile
    edo chmod 6755 "${IMAGE}"/usr/$(exhost --target)/bin/procmail
    edo chmod 2755 "${IMAGE}"/usr/$(exhost --target)/bin/lockfile

    dodir /var/spool/${PN}/
    keepdir /var/spool/${PN}/

    insinto /etc
    hereins procmailrc <<'EOF'
# Use maildir-style mailbox in user's home directory
DEFAULT=$HOME/.maildir/
EOF

    insinto /usr/share/doc/${PNVR}/examples
    doins "${WORK}"/examples/{{1,2,3}procmailrc,{1,2,3}rmail,advanced,dirname,forward,mailstat}
}