summaryrefslogtreecommitdiff
path: root/packages/mail-filter/dcc/dcc.exlib
blob: ff112b8514b14c2b13b8156630d0764aa6c2f5b4 (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
62
63
64
# Copyright 2018 Gluzskiy Alexandr <sss@sss.chaoslab.ru>
# Distributed under the terms of the GNU General Public License v2

SUMMARY="Distributed Checksum Clearinghouse"
HOMEPAGE="http://www.rhyolite.com/anti-spam/dcc/"
DOWNLOADS="http://www.rhyolite.com/anti-spam/dcc/source/old/${PNV}.tar.Z"

LICENCES="DCC GPL-2"
SLOT="0"

export_exlib_phases src_configure src_prepare src_install

MYOPTIONS="
    cgi
    milter
"

DEPENDENCIES="
    build+run:
        milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
"

dcc_src_prepare(){
    default
    edo sed -e "s/\/usr\/local\/bin/usr\/$(exhost --target)\/bin/g" -i "${WORK}"/configure
    edo sed -e "s/exec_prefix=NONE/exec_prefix=\/usr\/$(exhost --target)/g" -i "${WORK}"/configure
    edo sed -e "s/libexecdir='${exec_prefix}\/libexec'/libexecdir='\/usr\/$(exhost --target)\/libexec'/g" -i "${WORK}"/configure
}

dcc_src_configure(){
    local params=(
        "--homedir=${IMAGE}/var/dcc"
        "--mandir=${IMAGE}/usr/share/man"
        "--bindir=${IMAGE}/usr/$(exhost --target)/bin"
        "--libexecdir=${IMAGE}/usr/$(exhost --target)/libexec"
        "--with-updatedcc_pfile=${IMAGE}/var/dcc/updatecc.pfile"
        "--with-DDC-MD5"
        "--with-uid=root"
        "--enable-server"
        "--enable-dccifd"
        "--with-rundir=${IMAGE}/var/run/dcc"
        "--with-db-memory=64"
        "--with-max-db-mem=128"
        "--with-max-log-size=0"
        "--enable-ipv6"
    )
    option cgi && params+=("--with-cgibin=${IMAGE}/var/www/localhost/cgi-bin/dcc") || params+=("--without-cgibin")
    option milter && params+=("--with-sendmail"  "--enable-dccm") || params+=("--without-sendmail" "--disable-dccm")
    DCC_MANDIR="${IMAGE}"/usr/share/man DCC_HOMEDIR="${IMAGE}"/var/dcc edo ./configure "${params[@]}"
}

DEFAULT_SRC_COMPILE_PARAMS=(
    DESTDIR="${IMAGE}"
    DCC_BINDIR="${IMAGE}"/usr/$(exhost --target)/bin
    MANDIR="${IMAGE}"/usr/share/man
    DCC_MANDIR="${IMAGE}"/usr/share/man
    DCC_HOMEDIR="${IMAGE}"/var/dcc
)

dcc_src_install(){
    default
    keepdir /var/dcc/log
}