aboutsummaryrefslogtreecommitdiffstats
path: root/security/vpnc/Makefile
blob: 9629a8d51f60821a89cdfdeea36bf51856cae424 (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
# Created by: Christian Lackas
# $FreeBSD$

PORTNAME=   vpnc
PORTVERSION=    0.5.3
PORTREVISION=   11
CATEGORIES= security
MASTER_SITES=   http://www.unix-ag.uni-kl.de/~massar/vpnc/ \
        LOCAL/ehaupt

MAINTAINER= ehaupt@FreeBSD.org
COMMENT=    Client for Cisco 3000 VPN Concentrator

LIB_DEPENDS=    libgcrypt.so:security/libgcrypt
RUN_DEPENDS=    vpnc-script:sysutils/vpnc-scripts

USES=       shebangfix gmake perl5
USE_PERL5=  build
USE_RC_SUBR=    vpnc

LEGAL_TEXT= Redistribution is not allowed if linked against OpenSSL

ALL_TARGET= all
SHEBANG_FILES=  makeman.pl

PORTDOCS=   README TODO
MANPAGE8=   vpnc.8

MAKE_ENV+=  BINS="${EXTRABUILDS}"

OPTIONS_DEFINE= DECRYPT SSL CISCOVERSION DOCS

DECRYPT_DESC=       cisco-decypt password decrypt utility
CISCOVERSION_DESC=  Mask linux presentation string

OPTIONS_DEFAULT=DECRYPT

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDECRYPT}
MANPAGE1=   cisco-decrypt.1
EXTRABUILDS+=   cisco-decrypt
PLIST_SUB+= DECRYPT=""
.else
PLIST_SUB+= DECRYPT="@comment "
.endif

.if ${PORT_OPTIONS:MSSL}
NO_PACKAGE= binary linked against OpenSSL must not be redistributed
CFLAGS+=    -DOPENSSL_GPL_VIOLATION
LDFLAGS+=   -lcrypto
.endif

.if ${PORT_OPTIONS:MCISCOVERSION}
CFLAGS+=    -DCISCO_PATCH_VERSION
.endif

post-patch:
.if ${OSVERSION} >= 1100042
    @${REINPLACE_CMD} \
        -e 's|.*%%FREEBSD_IPLEN_FIX%%.*|#define NEED_IPLEN_FIX 1|' \
        ${WRKSRC}/sysdep.h
.endif
    @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/config.c
    @${REINPLACE_CMD} -e 's|\(/etc/vpnc\)|${PREFIX}\1|' \
        ${WRKSRC}/${MANPAGE8}.template

do-install:
    ${INSTALL_PROGRAM} -m 751 ${WRKSRC}/vpnc ${STAGEDIR}${PREFIX}/sbin/vpnc
.if ${PORT_OPTIONS:MDECRYPT}
    ${INSTALL_PROGRAM} ${WRKSRC}/cisco-decrypt ${STAGEDIR}${PREFIX}/bin
    ${INSTALL_MAN} ${WRKSRC}/${MANPAGE1} ${STAGEDIR}${MANPREFIX}/man/man1
.endif
    ${INSTALL_SCRIPT} -m 751 ${WRKSRC}/vpnc-disconnect \
        ${STAGEDIR}${PREFIX}/sbin/vpnc-disconnect
    ${INSTALL_DATA} -m 600 ${WRKSRC}/vpnc.conf \
        ${STAGEDIR}${PREFIX}/etc/vpnc.conf.sample
.if !exists(${STAGEDIR}${PREFIX}/etc/vpnc.conf)
    ${INSTALL_DATA} -m 600 ${WRKSRC}/vpnc.conf ${STAGEDIR}${PREFIX}/etc
.endif
    ${INSTALL_MAN} ${WRKSRC}/${MANPAGE8} ${STAGEDIR}${MANPREFIX}/man/man8
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>