aboutsummaryrefslogtreecommitdiffstats
path: root/security/drweb-postfix/Makefile
blob: b46d7cd7b10d557dccfaa6f38d9bb278a44853a3 (plain) (blame)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# New ports collection makefile for:   drweb_postfix
# Date created:        5 December 2002
# Whom:                zhuravlev alexander <zaa@ulstu.ru>
#
# $FreeBSD$
#

PORTNAME=   drweb_postfix
PORTVERSION=    4.29.12f
CATEGORIES= security mail
MASTER_SITES=   ftp://ftp.drweb.ru/pub/unix/
DISTNAME=   drweb-clients-4.29.12-F-sources

MAINTAINER= zaa@ulstu.ru
COMMENT=    Postfix message filter for virus processing through DrWeb daemon

RUN_DEPENDS=    ${LOCALBASE}/etc/rc.d/drweb-0.sh:${PORTSDIR}/security/drwebd

WRKSRC=     ${WRKDIR}/${DISTNAME}

INST_PREFIX=    ${PREFIX}/${PORTNAME}
DOC_DIR=    ${PREFIX}/share/doc/drweb-postfix

LANGS=en-ru
CONFS=drweb_postfix users viruses addresses
TMPLS=archive-admin archive-sender error-admin error-sender skip-sender \
      virus-admin virus-rcpts virus-sender rule-admin
DOCS=addresses_list.rus.txt addresses_list.txt conf_file.rus.txt \
    conf_file.txt notify.rus.txt notify.txt readme readme.rus \
    users_list.rus.txt users_list.txt viruses_list.rus.txt viruses_list.txt

post-patch:
    cd ${WRKSRC} && \
    ${SED} "s#%PREFIX%#${PREFIX}#g" < dw_options.c > ndwo.c && \
        ${MV} ndwo.c dw_options.c
    cd ${WRKSRC}/etc && \
    ${SED} -e "s#%PREFIX%#${PREFIX}#g" -e "s#%HOSTNAME%#${HOST}#g" \
        < drweb_postfix.conf > nconf && \
        ${MV} nconf drweb_postfix.conf

post-configure:
    cd ${WRKSRC} && { \
        ${ECHO_CMD} ${PORTVERSION}; \
        ${ECHO_CMD} n; \
        ${ECHO_CMD} n; \
        ${ECHO_CMD} n; \
        ${ECHO_CMD} n; \
        ${ECHO_CMD} y; \
        ${ECHO_CMD} n; \
        ${ECHO_CMD} n; \
        ${ECHO_CMD} y; \
        ${ECHO_CMD} ${CFLAGS} ; \
        ${ECHO_CMD} y; \
    } | ./configure

do-install:
    ${MKDIR} ${DOC_DIR}
.for LANG in ${LANGS}
    ${MKDIR} ${PREFIX}/etc/drweb/templates/${LANG}/postfix
.endfor
.for CONF in ${CONFS}
    ${INSTALL_DATA} -m 640 -o drweb -g drweb ${WRKSRC}/etc/${CONF}.conf \
        ${PREFIX}/etc/drweb/${CONF}.conf-dist
    if [ ! -f ${PREFIX}/etc/drweb/${CONF}.conf ]; then \
       ${INSTALL_DATA} -m 640 -o drweb -g drweb ${WRKSRC}/etc/${CONF}.conf \
        ${PREFIX}/etc/drweb/${CONF}.conf; \
    fi
.endfor
.for LANG in ${LANGS}
.for TMPL in ${TMPLS}
    cd ${WRKSRC}/etc/templates/${LANG}/postfix && \
        ${INSTALL_DATA} ${TMPL}.msg \
        ${PREFIX}/etc/drweb/templates/${LANG}/postfix/${TMPL}.msg-dist
    if [ ! -f ${PREFIX}/etc/drweb/templates/${LANG}/postfix/${TMPL}.msg ]; then \
        cd ${PREFIX}/etc/drweb/templates/${LANG}/postfix && \
        ${CP} ${TMPL}.msg-dist ${TMPL}.msg; \
    fi
.endfor
.endfor
    ${INSTALL_PROGRAM} ${WRKSRC}/drweb-postfix ${PREFIX}/sbin/
    ${INSTALL_PROGRAM} ${WRKSRC}/drwebdc ${PREFIX}/sbin/
    cd ${WRKSRC}/doc/postfix && \
        ${INSTALL_DATA} ${DOCS} ${DOC_DIR}

post-install:
    @${CAT} ${PKGMESSAGE}
    @echo
    @echo "Read documentation about additional Postfix tuning needed"
    @echo "in ${DOC_DIR}."
    @echo

.include <bsd.port.mk>