aboutsummaryrefslogtreecommitdiffstats
path: root/security/racoon2/Makefile
blob: 1a703530dcad5a32e0d8bac308c1fb40a39d1ba0 (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
93
94
95
96
97
98
99
100
101
102
103
104
# Created by: sumikawa
# $FreeBSD$

PORTNAME=   racoon2
PORTVERSION=    ${RACOON2_COMMIT_DATE}
PORTREVISION=   1
CATEGORIES= security net ipv6
HASH=       5c4af73
RACOON2_COMMIT_DATE=20181215

MAINTAINER= cy@FreeBSD.org
COMMENT=    Racoon2 IPsec daemon

BROKEN_FreeBSD_11=  Requires openssl111 to build

CONFLICTS=  racoon2-legacy-*

USE_GITHUB=     yes
GH_ACCOUNT=     zoulasc
GH_TAGNAME=     ${HASH}

USES=       autoreconf:build perl5 tar:tgz ssl
CONFIGURE_ARGS+=    --enable-natt \
            --prefix=${PREFIX}

GNU_CONFIGURE=  yes
CONFIGURE_ENV=  YACC=/usr/bin/yacc perl_bindir=${LOCALBASE}/bin/perl5

# MAKE_ENV= DESTDIR=${DESTDIR}

CFLAGS=     -DHAVE_CONFIG_H

OPTIONS_DEFINE= DOCS
OPTIONS_DEFAULT=    DOCS NO_KRB
OPTIONS_SINGLE= KERBEROS
OPTIONS_SINGLE_KERBEROS=    NO_KRB KRB5 HEIMDAL_PORT HEIMDAL_BASE
NO_KRB_DESC=    No Kerberos support
KRB5_DESC=  Build with Kerberos (security/krb5)
HEIMDAL_PORT_DESC=  Build with Heimdal in ports (security/heimdal)
HEIMDAL_BASE_DESC=  Build with Heimdal in base

NO_KRB_CONFIGURE_ON=    --disable-kinkd
NO_KRB_MAKE_ENV=    WITH_KINK=no
NO_KRB_PLIST_SUB=   KINK="@comment "
NO_KRB_VARS=        KINK=no

KRB5_USES=      gssapi:mit
KRB5_CONFIGURE_ON=  --enable-kinkd
KRB5_MAKE_ENV=      WITH_KINK=yes
KRB5_PLIST_SUB=     KINK=""
KRB5_LIB_DEPENDS=   libkrb5support.so:security/krb5
KRB5_RUN_DEPENDS=   kinit:security/krb5
KRB5_VARS=      KINK=yes

HEIMDAL_PORT_USES=  gssapi:heimdal
HEIMDAL_PORT_CONFIGURE_ON=  --enable-kinkd
HEIMDAL_PORT_MAKE_ENV=  WITH_KINK=yes
HEIMDAL_PORT_PLIST_SUB= KINK=""
HEIMDAL_PORT_VARS=  KINK=yes

HEIMDAL_BASE_USES=  gssapi:base
HEIMDAL_BASE_CONFIGURE_ON=  --enable-kinkd
HEIMDAL_BASE_MAKE_ENV=  WITH_KINK=yes
HEIMDAL_BASE_PLIST_SUB= KINK=""
HEIMDAL_BASE_VARS=  KINK=yes

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOCS}
PORTDOCS+=  INSTALL USAGE config-usage.ja.txt config-usage.txt
PORTDOCS+=  iked-memo.ja.txt libracoon.ja.txt specification.ja.txt
PORTDOCS+=  spmif.txt style.txt system-message.ja.txt
.if defined(KINK)
PORTDOCS+=  kinkd-data-struct.obj kinkd-impl.ja.txt
PORTDOCS+=  kinkd-install.ja.txt kinkd-state-txn.obj
.endif
.endif

post-patch:
    # @${REINPLACE_CMD} 's|/var/run/racoon2|$$(STAGEDIR)&|' \
        ${WRKSRC}/samples/Makefile.in
    @${LN} -sf ${LOCALBASE}/share/automake-1.16/ylwrap ${WRKSRC}/lib

post-patch-DOCS-on:
.for FILE in ${PORTDOCS}
    @${REINPLACE_CMD} -e 's|/usr/local/racoon2|${PREFIX}|' ${WRKSRC}/doc/${FILE}
.endfor

post-install:
    @if [ -z `/sbin/sysctl -a | ${GREP} -q ipsec && echo ipsec` ]; then \
        ${ECHO_MSG} "WARNING: IPsec feature is disabled on this host"; \
        ${ECHO_MSG} "         You must build the kernel if you want to run racoon on the host"; \
    fi ;

post-install-DOCS-on:
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/COPYRIGHT ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/COPYRIGHT.jp ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
.for FILE in ${PORTDOCS}
    ${INSTALL_DATA} ${WRKSRC}/doc/${FILE} ${STAGEDIR}${DOCSDIR}
.endfor

.include <bsd.port.mk>