1
|
# Created by: vanhu
|
2
|
# $FreeBSD: head/security/ipsec-tools/Makefile 344766 2014-02-17 14:50:47Z bapt $
|
3
|
|
4
|
# TODO: - libipsec issue ?
|
5
|
# - cleanup...
|
6
|
# - SYSCONFDIR
|
7
|
# - $LOCALBASE/sbin/setkey Vs /usr/sbin/setkey
|
8
|
|
9
|
PORTNAME= ipsec-tools
|
10
|
PORTVERSION= 0.8.1
|
11
|
PORTREVISION= 4
|
12
|
CATEGORIES= security
|
13
|
MASTER_SITES= SF
|
14
|
|
15
|
MAINTAINER= vanhu@netasq.com
|
16
|
COMMENT= KAME racoon IKE daemon, ipsec-tools version
|
17
|
|
18
|
CONFLICTS= racoon-[0-9]*
|
19
|
|
20
|
USE_RC_SUBR= racoon
|
21
|
USE_OPENSSL= yes
|
22
|
USE_BZIP2= yes
|
23
|
|
24
|
INSTALL_TARGET= install-strip
|
25
|
|
26
|
USES= libtool
|
27
|
GNU_CONFIGURE= yes
|
28
|
USE_LDCONFIG= yes
|
29
|
CONFIGURE_ARGS= --enable-shared --sysconfdir=${PREFIX}/etc/racoon \
|
30
|
--localstatedir=${STATEDIR:S/\/racoon//} \
|
31
|
--with-pkgversion=freebsd-${PORTVERSION} \
|
32
|
--with-openssl=/usr/local
|
33
|
|
34
|
STATEDIR= /var/db/racoon
|
35
|
SUB_LIST+= STATEDIR=${STATEDIR}
|
36
|
PLIST_SUB+= STATEDIR=${STATEDIR}
|
37
|
|
38
|
OPTIONS_DEFINE= DEBUG IPV6 ADMINPORT STATS DPD NATT NATTF FRAG HYBRID PAM \
|
39
|
RADIUS LDAP GSSAPI SAUNSPEC RC5 IDEA DOCS
|
40
|
OPTIONS_DEFAULT= DEBUG DPD NATT FRAG HYBRID
|
41
|
|
42
|
ADMINPORT_DESC= Enable Admin port
|
43
|
STATS_DESC= Statistics logging function
|
44
|
DPD_DESC= Dead Peer Detection
|
45
|
NATT_DESC= NAT-Traversal (kernel-patch required)
|
46
|
NATTF_DESC= require NAT-Traversal (fail without kernel-patch)
|
47
|
FRAG_DESC= IKE fragmentation payload support
|
48
|
HYBRID_DESC= Hybrid, Xauth and Mode-cfg support
|
49
|
SAUNSPEC_DESC= Unspecified SA mode
|
50
|
RC5_DESC= RC5 encryption (patented)
|
51
|
IDEA_DESC= IDEA encryption (patented)
|
52
|
PAM_DESC= PAM authentication (Xauth server)
|
53
|
RADIUS_DESC= Radius authentication (Xauth server)
|
54
|
LDAP_DESC= LDAP authentication (Xauth server)
|
55
|
|
56
|
PORTDOCS= *
|
57
|
|
58
|
.include <bsd.port.pre.mk>
|
59
|
|
60
|
.if ${OSVERSION} < 900007
|
61
|
EXTRA_PATCHES= ${FILESDIR}/patch8-utmp.diff
|
62
|
.endif
|
63
|
EXTRA_PATCHES+=${FILESDIR}/patch9-external_script.diff ${FILESDIR}/patch10-show_users.diff ${FILESDIR}/ipsec-nat.diff ${FILESDIR}/patch12-dosfix.diff ${FILESDIR}/patch91-correct_general.diff
|
64
|
|
65
|
.if ${PORT_OPTIONS:MDEBUG}
|
66
|
CONFIGURE_ARGS+= --enable-debug
|
67
|
.else
|
68
|
CONFIGURE_ARGS+= --disable-debug
|
69
|
.endif
|
70
|
|
71
|
.if ${PORT_OPTIONS:MIPV6}
|
72
|
CONFIGURE_ARGS+= --enable-ipv6
|
73
|
.else
|
74
|
CONFIGURE_ARGS+= --disable-ipv6
|
75
|
.endif
|
76
|
|
77
|
.if ${PORT_OPTIONS:MADMINPORT}
|
78
|
CONFIGURE_ARGS+= --enable-adminport
|
79
|
.else
|
80
|
CONFIGURE_ARGS+= --disable-adminport
|
81
|
.endif
|
82
|
|
83
|
.if ${PORT_OPTIONS:MSTATS}
|
84
|
CONFIGURE_ARGS+= --enable-stats
|
85
|
.else
|
86
|
CONFIGURE_ARGS+= --disable-stats
|
87
|
.endif
|
88
|
|
89
|
.if ${PORT_OPTIONS:MDPD}
|
90
|
CONFIGURE_ARGS+= --enable-dpd
|
91
|
.else
|
92
|
CONFIGURE_ARGS+= --disable-dpd
|
93
|
.endif
|
94
|
|
95
|
.if ${PORT_OPTIONS:MNATT}
|
96
|
. if ${PORT_OPTIONS:MNATTF}
|
97
|
CONFIGURE_ARGS+= --enable-natt=yes
|
98
|
. else
|
99
|
CONFIGURE_ARGS+= --enable-natt=kernel
|
100
|
. endif
|
101
|
.else
|
102
|
CONFIGURE_ARGS+= --disable-natt
|
103
|
.endif
|
104
|
|
105
|
.if ${PORT_OPTIONS:MFRAG}
|
106
|
CONFIGURE_ARGS+= --enable-frag
|
107
|
.else
|
108
|
CONFIGURE_ARGS+= --disable-frag
|
109
|
.endif
|
110
|
|
111
|
.if ${PORT_OPTIONS:MHYBRID}
|
112
|
CONFIGURE_ARGS+= --enable-hybrid
|
113
|
.else
|
114
|
CONFIGURE_ARGS+= --disable-hybrid
|
115
|
.endif
|
116
|
|
117
|
.if ${PORT_OPTIONS:MPAM}
|
118
|
CONFIGURE_ARGS+= --with-libpam
|
119
|
.else
|
120
|
CONFIGURE_ARGS+= --without-libpam
|
121
|
.endif
|
122
|
|
123
|
.if ${PORT_OPTIONS:MGSSAPI}
|
124
|
USES+= iconv
|
125
|
CFLAGS+= -I${LOCALBASE}/include
|
126
|
LDFLAGS+= -L${LOCALBASE}/lib
|
127
|
CONFIGURE_ARGS+= --enable-gssapi
|
128
|
.else
|
129
|
CONFIGURE_ARGS+= --disable-gssapi
|
130
|
.endif
|
131
|
|
132
|
.if ${PORT_OPTIONS:MRADIUS}
|
133
|
CONFIGURE_ARGS+= --with-libradius
|
134
|
.else
|
135
|
CONFIGURE_ARGS+= --without-libradius
|
136
|
.endif
|
137
|
|
138
|
.if ${PORT_OPTIONS:MLDAP}
|
139
|
USE_OPENLDAP= YES
|
140
|
CONFIGURE_ARGS+= --with-libldap=${LOCALBASE}
|
141
|
.else
|
142
|
CONFIGURE_ARGS+= --without-libldap
|
143
|
.endif
|
144
|
|
145
|
.if ${PORT_OPTIONS:MSAUNSPEC}
|
146
|
CONFIGURE_ARGS+= --enable-samode-unspec
|
147
|
.else
|
148
|
CONFIGURE_ARGS+= --disable-samode-unspec
|
149
|
.endif
|
150
|
|
151
|
.if ${PORT_OPTIONS:MRC5}
|
152
|
CONFIGURE_ARGS+= --enable-rc5
|
153
|
.else
|
154
|
CONFIGURE_ARGS+= --disable-rc5
|
155
|
.endif
|
156
|
|
157
|
.if ${PORT_OPTIONS:MIDEA}
|
158
|
CONFIGURE_ARGS+= --enable-idea
|
159
|
.else
|
160
|
CONFIGURE_ARGS+= --disable-idea
|
161
|
.endif
|
162
|
|
163
|
post-patch:
|
164
|
@${REINPLACE_CMD} -e "s/-Werror//g ; s/-R$$libdir/-Wl,-rpath=$$libdir/g" ${WRKSRC}/configure
|
165
|
|
166
|
post-install:
|
167
|
@${MKDIR} ${STAGEDIR}/${PREFIX}/etc/racoon
|
168
|
@if [ -z `/sbin/sysctl -a | ${GREP} -q ipsec && ${ECHO_CMD} ipsec` ]; then \
|
169
|
${ECHO_MSG} "WARNING: IPsec feature is disabled on this host"; \
|
170
|
${ECHO_MSG} " You must build the kernel if you want to run racoon on the host"; \
|
171
|
fi ;
|
172
|
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
|
173
|
@${RM} -f ${WRKSRC}/src/racoon/samples/*.in
|
174
|
@${CP} -r ${WRKSRC}/src/racoon/samples/* ${STAGEDIR}${EXAMPLESDIR}
|
175
|
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
176
|
@${INSTALL_DATA} ${WRKSRC}/src/racoon/doc/* ${STAGEDIR}${DOCSDIR}
|
177
|
|
178
|
pre-package:
|
179
|
@${CP} -va ${WRKSRC}/src/racoon/libracoon.la ${STAGEDIR}/usr/local/lib/
|
180
|
@${CP} -va ${WRKSRC}/src/libipsec/libipsec.la ${STAGEDIR}/usr/local/lib/
|
181
|
@${LS} -l ${STAGEDIR}/usr/local/lib/
|
182
|
|
183
|
.include <bsd.port.post.mk>
|