View | Details | Raw Unified | Return to bug 147188 | Differences between
and this patch

Collapse All | Expand All

(-)freeradius2/Makefile (-33 / +13 lines)
Lines 8-15 Link Here
8
#
8
#
9
9
10
PORTNAME=	freeradius
10
PORTNAME=	freeradius
11
DISTVERSION=	2.1.8
11
DISTVERSION=	2.1.9
12
PORTREVISION=	1
13
CATEGORIES=	net
12
CATEGORIES=	net
14
MASTER_SITES=	ftp://ftp.freeradius.org/pub/freeradius/%SUBDIR%/ \
13
MASTER_SITES=	ftp://ftp.freeradius.org/pub/freeradius/%SUBDIR%/ \
15
		ftp://ftp.ntua.gr/pub/net/radius/freeradius/%SUBDIR%/ \
14
		ftp://ftp.ntua.gr/pub/net/radius/freeradius/%SUBDIR%/ \
Lines 22-30 Link Here
22
MAINTAINER=	rpsfa@rit.edu
21
MAINTAINER=	rpsfa@rit.edu
23
COMMENT=	A free RADIUS server implementation
22
COMMENT=	A free RADIUS server implementation
24
23
25
RUN_DEPENDS=	gmake:${PORTSDIR}/devel/gmake
26
LIB_DEPENDS=	gdbm.3:${PORTSDIR}/databases/gdbm
24
LIB_DEPENDS=	gdbm.3:${PORTSDIR}/databases/gdbm
27
25
26
USE_GMAKE=	yes
27
28
USE_BZIP2=	yes
28
USE_BZIP2=	yes
29
29
30
LOGDIR?=	/var/log
30
LOGDIR?=	/var/log
Lines 68-73 Link Here
68
SUB_LIST+=	RUN_AS_USER="no"
68
SUB_LIST+=	RUN_AS_USER="no"
69
.endif
69
.endif
70
70
71
# User and group to use if USER option is chosen
72
RADIUS_USER=	freeradius
73
RADIUS_GROUP=	freeradius
74
75
USERS=		${RADIUS_USER}
76
GROUPS=		${RADIUS_GROUP}
77
71
.if defined(WITH_HEIMDAL) && !defined(WITH_KERBEROS)
78
.if defined(WITH_HEIMDAL) && !defined(WITH_KERBEROS)
72
WITH_KERBEROS=	yes
79
WITH_KERBEROS=	yes
73
.endif
80
.endif
Lines 207-213 Link Here
207
214
208
# Oracle support is experimental under FreeBSD
215
# Oracle support is experimental under FreeBSD
209
.ifdef(WITH_OCI8)
216
.ifdef(WITH_OCI8)
210
EXTRA_PATCHES+=	files/extra-patch-exec.c
217
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-exec.c
211
CONFIGURE_ENV=	ORACLE_HOME="${ORACLE_HOME}"
218
CONFIGURE_ENV=	ORACLE_HOME="${ORACLE_HOME}"
212
ORACLE_HOME?=	${LOCALBASE}/oracle8-client
219
ORACLE_HOME?=	${LOCALBASE}/oracle8-client
213
BUILD_DEPENDS+=	${ORACLE_HOME}/lib/libclntst8.a:${PORTSDIR}/databases/oracle8-client
220
BUILD_DEPENDS+=	${ORACLE_HOME}/lib/libclntst8.a:${PORTSDIR}/databases/oracle8-client
Lines 237-246 Link Here
237
BROKEN=		Does not build on sparc64-6
244
BROKEN=		Does not build on sparc64-6
238
.endif
245
.endif
239
246
240
# User and group to use if USER option is chosen
241
USER=	freeradius
242
GROUP=	freeradius
243
244
FREERADIUS_LIBDIR=	lib/freeradius-${PORTVERSION}
247
FREERADIUS_LIBDIR=	lib/freeradius-${PORTVERSION}
245
PLIST_SUB+=	LIBDIR="${FREERADIUS_LIBDIR}"
248
PLIST_SUB+=	LIBDIR="${FREERADIUS_LIBDIR}"
246
USE_LDCONFIG=	${PREFIX}/${FREERADIUS_LIBDIR}
249
USE_LDCONFIG=	${PREFIX}/${FREERADIUS_LIBDIR}
Lines 280-310 Link Here
280
CONFIGURE_ARGS+=	--with-pic
283
CONFIGURE_ARGS+=	--with-pic
281
.endif
284
.endif
282
285
283
# Credentials for WITH_USER are RADIUS_USER, RADIUS_UID, RADIUS_GECOS,
286
SUB_LIST+=	RADIUS_USER="${RADIUS_USER}" \
284
# RADIUS_HOME, RADIUS_SHELL, RADIUS_GROUP and RADIUS_GID.
287
		RADIUS_GROUP="${RADIUS_GROUP}" \
285
286
# Parse ${PORTSDIR}/UIDs and GIDs for the defaults
287
USERCREDS!=	${GREP} -E '^${USER}:' ${PORTSDIR}/UIDs | \
288
		${SED} -Ee 's/^([^:]*):([^:]*):([^:]*):([^:]*)::0:0:([^:]*):([^:]*):([^:]*)$$/USER="\1" UID="\3" GECOS="\5" HOME="\6" SHELL="\7"/'
289
GROUPCREDS!=	${GREP} -E '^${GROUP}:' ${PORTSDIR}/GIDs | \
290
		${SED} -Ee 's/^([^:]*):([^:]*):([^:]*):$$/GROUP="\1" GID="\3"/'
291
292
# Apply the defaults where necessary
293
RADIUS_USER?=	${USERCREDS:MUSER*:C/^[^=]*=\"([^\"]*)\"$/\1/}
294
RADIUS_UID?=	${USERCREDS:MUID*:C/^[^=]*=\"([^\"]*)\"$/\1/}
295
RADIUS_GECOS?=	${USERCREDS:MGECOS*:C/^[^=]*=\"([^\"]*)\"$/\1/}
296
RADIUS_HOME?=	${USERCREDS:MHOME*:C/^[^=]*=\"([^\"]*)\"$/\1/}
297
RADIUS_SHELL?=	${USERCREDS:MSHELL*:C/^[^=]*=\"([^\"]*)\"$/\1/}
298
RADIUS_GROUP?=	${GROUPCREDS:MGROUP*:C/^[^=]*=\"([^\"]*)\"$/\1/}
299
RADIUS_GID?=	${GROUPCREDS:MGID*:C/^[^=]*=\"([^\"]*)\"$/\1/}
300
301
SUB_LIST+=	USER="${RADIUS_USER}" \
302
		UID="${RADIUS_UID}" \
303
		GECOS="${RADIUS_GECOS}" \
304
		HOME="${RADIUS_HOME}" \
305
		SHELL="${RADIUS_SHELL}" \
306
		GROUP="${RADIUS_GROUP}" \
307
		GID="${RADIUS_GID}" \
308
		RADDB_WORK="${WRKSRC}/raddb" \
288
		RADDB_WORK="${WRKSRC}/raddb" \
309
		RADDB="${PREFIX}/etc/raddb" \
289
		RADDB="${PREFIX}/etc/raddb" \
310
		LOGDIR="${LOGDIR}" \
290
		LOGDIR="${LOGDIR}" \
(-)freeradius2/Makefile~ (+378 lines)
Line 0 Link Here
1
# New ports collection makefile for:    freeradius
2
# Date created:         May 9 2002
3
# Whom:                 Brian Somers <brian@FreeBSD.org>
4
#
5
# $FreeBSD: ports/net/freeradius2/Makefile,v 1.85 2010/03/27 19:33:51 dougb Exp $
6
#
7
# $Id$
8
#
9
10
PORTNAME=	freeradius
11
DISTVERSION=	2.1.9
12
CATEGORIES=	net
13
MASTER_SITES=	ftp://ftp.freeradius.org/pub/freeradius/%SUBDIR%/ \
14
		ftp://ftp.ntua.gr/pub/net/radius/freeradius/%SUBDIR%/ \
15
		ftp://ftp.uk.freeradius.org/pub/radius/%SUBDIR%/ \
16
		http://ftp.cc.uoc.gr/mirrors/ftp.freeradius.org/%SUBDIR%/ \
17
		http://freeradius.portal-to-web.de/%SUBDIR%/
18
MASTER_SITE_SUBDIR=	. old
19
DISTNAME=	freeradius-server-${DISTVERSION}
20
21
MAINTAINER=	rpsfa@rit.edu
22
COMMENT=	A free RADIUS server implementation
23
24
LIB_DEPENDS=	gdbm.3:${PORTSDIR}/databases/gdbm
25
26
USE_GMAKE=	yes
27
#RUN_DEPENDS=	gmake:${PORTSDIR}/devel/gmake
28
29
USE_BZIP2=	yes
30
31
LOGDIR?=	/var/log
32
33
CONFLICTS=	gnu-radius-[0-9].* openradius-[0-9].* radiusd-cistron-[0-9].* \
34
		freeradius-mysql-[0-9].* freeradius-[013-9].*
35
36
USE_RC_SUBR=	radiusd.sh
37
USE_AUTOTOOLS=	libltdl:22 libtool:22 autoconf:262
38
USE_GMAKE=	yes
39
USE_OPENSSL=	yes
40
MAKE_ARGS+=	LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
41
CFLAGS+=	-I${LOCALBASE}/include -L${LOCALBASE}/lib
42
MAKE_JOBS_UNSAFE=	yes
43
44
PLIST_SUB=	PORTVERSION=${DISTVERSION}
45
46
OPTIONS=	USER		"Run as user freeradius, group freeradius" on \
47
		KERBEROS	"With Kerberos support" off \
48
		HEIMDAL		"With Heimdal Kerberos support" off \
49
		LDAP		"With LDAP database support" off \
50
		MYSQL		"With MySQL database support" off \
51
		PGSQL		"With PostgreSQL database support" off \
52
		UNIXODBC	"With unixODBC database support" off \
53
		FIREBIRD	"With Firebird database support (EXPERIMENTAL)" off \
54
		PERL		"With Perl support" on \
55
		PYTHON		"With Python support" on \
56
		OCI8		"With Oracle support (currently experimental)" off \
57
		RUBY		"With Ruby support (EXPERIMENTAL)" off \
58
		DHCP		"With DHCP support (EXPERIMENTAL)" off \
59
		EXPERIMENTAL	"Build experimental modules" off
60
61
.include <bsd.port.options.mk>
62
63
# Default requirements for rc script
64
_REQUIRE=	NETWORKING SERVERS
65
66
.ifdef(WITH_USER)
67
SUB_LIST+=	RUN_AS_USER="yes"
68
.else
69
SUB_LIST+=	RUN_AS_USER="no"
70
.endif
71
72
# User and group to use if USER option is chosen
73
RADIUS_USER=	freeradius
74
RADIUS_GROUP=	freeradius
75
76
USERS=		${RADIUS_USER}
77
GROUPS=		${RADIUS_GROUP}
78
79
.if defined(WITH_HEIMDAL) && !defined(WITH_KERBEROS)
80
WITH_KERBEROS=	yes
81
.endif
82
83
.ifdef(WITH_KERBEROS)
84
.ifdef(WITH_HEIMDAL)
85
LIB_DEPENDS+=	krb5.23:${PORTSDIR}/security/heimdal
86
CONFIGURE_ARGS+=--enable-heimdal-krb5
87
.else
88
LIB_DEPENDS+=	krb5.3:${PORTSDIR}/security/krb5
89
.endif
90
CONFIGURE_ARGS+=--with-rlm_krb5
91
CONFIGURE_ARGS+=--with-rlm-krb5-lib-dir=${LOCALBASE}/lib
92
CONFIGURE_ARGS+=--with-rlm-krb5-include-dir=${LOCALBASE}/include
93
PLIST_SUB+=	KRB5=""
94
.else
95
CONFIGURE_ARGS+=--without-rlm_krb5
96
PLIST_SUB+=	KRB5="@comment "
97
.endif
98
99
.ifdef(WITH_LDAP)
100
USE_OPENLDAP=	YES
101
CONFIGURE_ARGS+=--with-rlm_ldap
102
PLIST_SUB+=	LDAP=""
103
_REQUIRE+=	slapd
104
.else
105
CONFIGURE_ARGS+=--without-rlm_ldap
106
PLIST_SUB+=	LDAP="@comment "
107
.endif
108
109
.ifdef(WITH_MYSQL)
110
USE_MYSQL=	YES
111
CONFIGURE_ARGS+=--with-rlm_sql_mysql
112
PLIST_SUB+=	MYSQL=""
113
_REQUIRE+=	mysql
114
.else
115
CONFIGURE_ARGS+=--without-rlm_sql_mysql
116
PLIST_SUB+=	MYSQL="@comment "
117
.endif
118
119
.ifdef(WITH_PGSQL)
120
USE_PGSQL=	YES
121
CONFIGURE_ARGS+=--with-rlm_sql_postgresql
122
PLIST_SUB+=	PGSQL=""
123
_REQUIRE+=	postgresql
124
.else
125
CONFIGURE_ARGS+=--without-rlm_sql_postgresql
126
PLIST_SUB+=	PGSQL="@comment "
127
.endif
128
129
.ifdef(WITH_UNIXODBC)
130
CONFIGURE_ARGS+=--with-rlm_sql_unixodbc
131
PLIST_SUB+=	UNIXODBC=""
132
LIB_DEPENDS+=	odbc.1:${PORTSDIR}/databases/unixODBC
133
.else
134
CONFIGURE_ARGS+=--without-rlm_sql_unixodbc
135
PLIST_SUB+=	UNIXODBC="@comment "
136
.endif
137
138
.ifdef(WITH_FIREBIRD)
139
USE_FIREBIRD=	YES
140
CONFIGURE_ARGS+=--with-rlm_sql_firebird
141
PLIST_SUB+=	FIREBIRD=""
142
.else
143
CONFIGURE_ARGS+=--without-rlm_sql_firebird
144
PLIST_SUB+=	FIREBIRD="@comment "
145
.endif
146
147
# Firebird module is still experimental
148
.if defined(WITH_FIREBIRD) && !defined(WITH_EXPERIMENTAL)
149
WITH_EXPERIMENTAL=	yes
150
.endif
151
152
.ifdef(WITH_PERL)
153
USE_PERL5=	yes
154
CONFIGURE_ARGS+=--with-rlm_perl
155
PLIST_SUB+=	RLMPERL=""
156
# temporary workaround for libtool issue until FR 2.2.x is released
157
CFLAGS+=	-DHAVE_LT_DLADVISE_INIT
158
.else
159
CONFIGURE_ARGS+=--without-perl --without-rlm_perl
160
PLIST_SUB+=	RLMPERL="@comment "
161
.endif
162
163
.ifdef(WITH_PYTHON)
164
USE_PYTHON=	yes
165
CONFIGURE_ARGS+=--with-rlm_python \
166
		--with-rlm-python-lib-dir=${PYTHON_LIBDIR} \
167
		--with-rlm-python-include-dir=${PYTHON_INCLUDEDIR}
168
PLIST_SUB+=	RLMPYTHON=""
169
.else
170
CONFIGURE_ARGS+=--without-rlm_python
171
PLIST_SUB+=	RLMPYTHON="@comment "
172
.endif
173
174
.ifdef(WITH_RUBY)
175
USE_RUBY=	yes
176
CONFIGURE_ARGS+=--with-rlm_ruby
177
PLIST_SUB+=	RLMRUBY=""
178
.else
179
CONFIGURE_ARGS+=--without-rlm_ruby
180
PLIST_SUB+=	RLMRUBY="@comment "
181
.endif
182
183
# rlm_ruby module is still experimental
184
.if defined(WITH_RUBY) && !defined(WITH_EXPERIMENTAL)
185
WITH_EXPERIMENTAL=	yes
186
.endif
187
188
.ifdef(WITH_DHCP)
189
CONFIGURE_ARGS+=--with-dhcp
190
.else
191
CONFIGURE_ARGS+=--without-dhcp
192
.endif
193
194
# DHCP is still experimental
195
.if defined(WITH_DHCP) && !defined(WITH_EXPERIMENTAL)
196
WITH_EXPERIMENTAL=	yes
197
.endif
198
199
# No SMB option yet; rlm_smb is still unbuildable
200
.ifdef(WITH_SMB)
201
LIB_DEPENDS=	smbclient.0:${PORTSDIR}/net/samba-libsmbclient
202
CONFIGURE_ARGS+=--with-rlm_smb
203
CONFIGURE_ARGS+=--with-rlm-smb-lib-dir=${LOCALBASE}/lib
204
CONFIGURE_ARGS+=--with-rlm-smb-include-dir=${LOCALBASE}/include
205
PLIST_SUB+=	SMB=""
206
.else
207
CONFIGURE_ARGS+=--without-rlm_smb
208
PLIST_SUB+=	SMB="@comment "
209
.endif
210
211
# SMB module is still experimental
212
.if defined(WITH_SMB) && !defined(WITH_EXPERIMENTAL)
213
WITH_EXPERIMENTAL=	yes
214
.endif
215
216
# Oracle support is experimental under FreeBSD
217
.ifdef(WITH_OCI8)
218
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-exec.c
219
CONFIGURE_ENV=	ORACLE_HOME="${ORACLE_HOME}"
220
ORACLE_HOME?=	${LOCALBASE}/oracle8-client
221
BUILD_DEPENDS+=	${ORACLE_HOME}/lib/libclntst8.a:${PORTSDIR}/databases/oracle8-client
222
CONFIGURE_ARGS+=--with-oracle-home-dir=${ORACLE_HOME}/rdbms/demo
223
PLIST_SUB+=	OCI8=""
224
.else
225
CONFIGURE_ARGS+=--without-rlm_sql_oracle
226
PLIST_SUB+=	OCI8="@comment "
227
.endif
228
229
.ifdef(WITH_EXPERIMENTAL)
230
CONFIGURE_ARGS+=--with-experimental-modules
231
PLIST_SUB+=	EXPM=""
232
.else
233
PLIST_SUB+=	EXPM="@comment "
234
.endif
235
236
.ifdef(WITH_DEVELOPER)
237
CONFIGURE_ARGS+=--enable-developer
238
# Turn off compiler optimisations
239
CFLAGS!=	${ECHO} ${CFLAGS} | ${SED} -Ee 's:-O[0-9]?[[:space:]]*::g'
240
.endif
241
242
.include <bsd.port.pre.mk>
243
244
.if ${ARCH} == "sparc64" && ${OSVERSION} < 700000
245
BROKEN=		Does not build on sparc64-6
246
.endif
247
248
FREERADIUS_LIBDIR=	lib/freeradius-${PORTVERSION}
249
PLIST_SUB+=	LIBDIR="${FREERADIUS_LIBDIR}"
250
USE_LDCONFIG=	${PREFIX}/${FREERADIUS_LIBDIR}
251
252
CONFIGURE_ARGS+=--quiet \
253
		--prefix=${PREFIX} \
254
		--libdir=${PREFIX}/${FREERADIUS_LIBDIR} \
255
		--localstatedir=/var \
256
		--with-system-libtool
257
.ifdef(NOPORTDOCS)
258
CONFIGURE_ARGS+=--without-docdir
259
PLIST_SUB+=	PORTDOCS="@comment "
260
SUB_LIST+=	PORTDOCS="@comment "
261
.else
262
CONFIGURE_ARGS+=--with-docdir=${DOCSDIR}
263
PLIST_SUB+=	PORTDOCS=""
264
SUB_LIST+=	PORTDOCS=""
265
.endif
266
CONFIGURE_ARGS+=--with-logdir=${LOGDIR} \
267
		--with-openssl-includes=${OPENSSLINC}
268
# This conditionality avoids -L/usr/lib in the radiusd build step when
269
# building with base system OpenSSL
270
.if ${OPENSSLLIB} != "/usr/lib"
271
CONFIGURE_ARGS+=--with-openssl-libraries=${OPENSSLLIB}
272
.endif
273
CONFIGURE_ARGS+=--without-rlm_eap_ikev2 \
274
		--without-rlm_eap_tnc \
275
		--without-rlm_eap2 \
276
		--without-rlm_opendirectory \
277
		--without-rlm_sql_db2 \
278
		--without-rlm_sql_iodbc \
279
		--without-rlm_sql_sqlite \
280
		--without-rlm_sql_sybase \
281
		--with-vmps
282
283
.if ${ARCH} == amd64
284
CONFIGURE_ARGS+=	--with-pic
285
.endif
286
287
SUB_LIST+=	RADIUS_USER="${RADIUS_USER}" \
288
		RADIUS_GROUP="${RADIUS_GROUP}" \
289
		RADDB_WORK="${WRKSRC}/raddb" \
290
		RADDB="${PREFIX}/etc/raddb" \
291
		LOGDIR="${LOGDIR}" \
292
		LIBDIR="${PREFIX}/${FREERADIUS_LIBDIR}"
293
SUB_FILES+=	pkg-install pkg-deinstall pkg-message
294
295
MAN1=		radclient.1 radeapclient.1 radlast.1 radtest.1 radwho.1 \
296
		radzap.1
297
MAN5=		acct_users.5 clients.conf.5 dictionary.5 radiusd.conf.5 \
298
		radrelay.conf.5 rlm_acct_unique.5 rlm_always.5 \
299
		rlm_attr_filter.5 rlm_attr_rewrite.5 rlm_chap.5 rlm_counter.5 \
300
		rlm_detail.5 rlm_digest.5 rlm_expr.5 rlm_files.5 rlm_mschap.5 \
301
		rlm_pap.5 rlm_passwd.5 rlm_policy.5 rlm_realm.5 rlm_sql.5 \
302
		rlm_sql_log.5 rlm_unix.5 unlang.5 users.5
303
MAN8=		radiusd.8 radmin.8 raddebug.8 radrelay.8 radsqlrelay.8 \
304
		radwatch.8 rlm_ippool_tool.8
305
306
SUB_LIST+=	REQUIRE="${_REQUIRE}"
307
308
post-patch:
309
# Patch Makefile / Makefile.in throughout the source tree to install raddb
310
# contents in ${EXAMPLESDIR}/raddb rather than the raddbdir from configure
311
	@${FIND} -E ${WRKSRC} -regex '.*/Makefile(\.in)?$$' -exec \
312
		${REINPLACE_CMD} -e "s:\$$(R)\$$(raddbdir):${EXAMPLESDIR}/raddb:g" {} \;
313
# Clean up after the last operation (so as not to get unwanted files when installing doc/)
314
	@${FIND} -E ${WRKSRC} -regex '.*/Makefile(\.in)?\.(orig|bak)$$' -delete
315
# Patch raddb/certs/bootstrap to use gmake instead of make
316
	@${REINPLACE_CMD} -Ee "s:^make:${GMAKE}:" \
317
		${WRKSRC}/raddb/certs/bootstrap
318
# Patch raddb/certs/Makefile for the full path to the openssl binary (using
319
# ports OpenSSL if installed)
320
	@${REINPLACE_CMD} -E \
321
		-e "s:^([[:space:]])+openssl:\1${OPENSSLBASE}/bin/openssl:g" \
322
		${WRKSRC}/raddb/certs/Makefile
323
# Clean up after the last two operations (so as not to get unwanted files in
324
# raddb)
325
	@${FIND} -E ${WRKSRC}/raddb/certs \
326
		-regex '.*/(bootstrap|Makefile)\.(orig|bak)$$' \
327
		-delete
328
# If DHCPis enabled, enable the DHCP dictionary
329
.ifdef(WITH_DHCP)
330
	@${REINPLACE_CMD} -Ee 's:^#(.+ dictionary\.dhcp)$$:\1:g' \
331
		${WRKSRC}/share/dictionary
332
# Clean up (so as not to get an unwanted file in share)
333
	@${FIND} -E ${WRKSRC}/share \
334
		-regex '.*/dictionary\.(orig|bak)$$' \
335
		-delete
336
.endif
337
# Patch scripts/Makefile not to install (unnecessary) rc.radiusd
338
	@${REINPLACE_CMD} -Ee 's:^(.+rc\.radiusd.+)$$:#\1:g' \
339
		${WRKSRC}/scripts/Makefile
340
341
pre-configure:
342
# Replace -pthread with ${PTHREAD_LIBS} in configure(.in) files
343
	@${FIND} -E ${WRKSRC} -regex '.*/configure(\.in)?$$' -exec \
344
		${REINPLACE_CMD} -e "s:-pthread:${PTHREAD_LIBS}:g" {} \;
345
# Force the rebuild of some configures from configure.in, as we're patching
346
# the configure.in
347
# NOTE: ${WRKSRC}/configure is rebuilt automatically once autoconf:262 is
348
# added to USE_AUTOTOOLS
349
	@cd ${WRKSRC}/src/modules/rlm_ldap && ${AUTOCONF} -I ${WRKSRC}
350
	@cd ${WRKSRC}/src/modules/rlm_sql/drivers/rlm_sql_mysql \
351
		&& ${AUTOCONF} -I ${WRKSRC}
352
	@cd ${WRKSRC}/src/modules/rlm_perl && ${AUTOCONF} -I ${WRKSRC}
353
	@cd ${WRKSRC}/src/modules/rlm_python && ${AUTOCONF} -I ${WRKSRC}
354
355
pre-install:
356
# Run pkg-install PRE-INSTALL
357
	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} \
358
		PRE-INSTALL
359
360
post-install:
361
# If ${PREFIX}/etc/raddb isn't a directory (or a symlink), make a copy
362
# of ${EXAMPLESDIR}/raddb as ${PREFIX}/etc/raddb, then bootstrap the
363
# certificates
364
	@if ! [ -d ${PREFIX}/etc/raddb -o -L ${PREFIX}/etc/raddb ]; then \
365
		${CP} -RP ${EXAMPLESDIR}/raddb ${PREFIX}/etc/raddb; \
366
		${ECHO_MSG} '===> Bootstrapping default certificates, please wait...'; \
367
		${PREFIX}/etc/raddb/certs/bootstrap >/dev/null 2>&1; \
368
	fi
369
# Set ${PREFIX}/etc/raddb and all the files and folders in it to g-w,o-rwx
370
# (FreeRADIUS will probably complain if this is not done)
371
	@${CHMOD} -R g-w,o-rwx ${PREFIX}/etc/raddb
372
# Run pkg-install POST-INSTALL
373
	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} \
374
		POST-INSTALL
375
# Display the contents of pkg-message
376
	@${CAT} ${PKGMESSAGE}
377
378
.include <bsd.port.post.mk>
(-)freeradius2/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (freeradius-server-2.1.8.tar.bz2) = d326525490bfba273471d77560471fcb
1
MD5 (freeradius-server-2.1.9.tar.bz2) = 5e16a0869acdf448b191c7e30f6507d8
2
SHA256 (freeradius-server-2.1.8.tar.bz2) = 9329607d8082f8d7197b7ebad23a83c5239fb129c68b9cab43a3752300708d22
2
SHA256 (freeradius-server-2.1.9.tar.bz2) = b0b7c5fe334e826e2f643569485ce203520ecb1d058d42b8df2a94a73acb05b1
3
SIZE (freeradius-server-2.1.8.tar.bz2) = 2544696
3
SIZE (freeradius-server-2.1.9.tar.bz2) = 2524497
(-)freeradius2/files/pkg-deinstall.in (-4 / +4 lines)
Lines 9-23 Link Here
9
9
10
If you are not upgrading and don't intend to use
10
If you are not upgrading and don't intend to use
11
FreeRADIUS any more then you may wish to delete
11
FreeRADIUS any more then you may wish to delete
12
the %%GROUP%% group, which can be done with the
12
the %%RADIUS_GROUP%% group, which can be done with the
13
following command:
13
following command:
14
14
15
    # pw groupdel %%GROUP%%
15
    # pw groupdel %%RADIUS_GROUP%%
16
16
17
You may also wish to delete the %%USER%% user,
17
You may also wish to delete the %%RADIUS_USER%% user,
18
which can be done with the following command:
18
which can be done with the following command:
19
19
20
    # pw userdel %%USER%%
20
    # pw userdel %%RADIUS_USER%%
21
EOMSG
21
EOMSG
22
        ;;
22
        ;;
23
esac
23
esac
(-)freeradius2/files/pkg-install.in (-85 / +2 lines)
Lines 3-16 Link Here
3
3
4
PATH=/usr/sbin:/usr/bin:/bin ; export PATH
4
PATH=/usr/sbin:/usr/bin:/bin ; export PATH
5
5
6
radius_user="%%USER%%"
6
radius_user="%%RADIUS_USER%%"
7
radius_uid="%%UID%%"
7
radius_group="%%RADIUS_GROUP%%"
8
radius_gecos="%%GECOS%%"
9
radius_home="%%HOME%%"
10
radius_shell="%%SHELL%%"
11
12
radius_group="%%GROUP%%"
13
radius_gid="%%GID%%"
14
8
15
radius_raddb_work="%%RADDB_WORK%%"
9
radius_raddb_work="%%RADDB_WORK%%"
16
radius_raddb="%%RADDB%%"
10
radius_raddb="%%RADDB%%"
Lines 20-106 Link Here
20
radius_run_as_user="%%RUN_AS_USER%%"
14
radius_run_as_user="%%RUN_AS_USER%%"
21
15
22
16
23
create_group() {
24
    local user uid group gid gecos home shell
25
26
    user=$1
27
    uid=$2
28
    group=$3
29
    gid=$4
30
    gecos=$5
31
    home=$6
32
    shell=$7
33
34
35
    if pw group show -n $group >/dev/null 2>&1 ; then
36
        echo "===> Using existing group $group"
37
    else
38
        if pw groupadd -n $group -g $gid ; then
39
            echo "===> Created group $group"
40
        else
41
            cat <<-EOERRORMSG
42
*** Failed to create group $group.
43
44
Please add user $user and group $group
45
manually with the following commands:
46
47
    pw groupadd -n $group -g $gid
48
    pw useradd -n $user -u $uid -g $group -c "$gecos" \\
49
        -d $home -s $shell -h -
50
51
and retry installing this package.
52
EOERRORMSG
53
            exit 1
54
        fi
55
    fi
56
57
}
58
59
60
create_user() {
61
    local user uid group gid gecos home shell
62
63
    user=$1
64
    uid=$2
65
    group=$3
66
    gid=$4
67
    gecos=$5
68
    home=$6
69
    shell=$7
70
71
    if pw user show -n $user >/dev/null 2>&1 ; then
72
        echo "===> Using existing user $user"
73
    else
74
        if pw useradd -n $user -u $uid -g $group -c "$gecos" \
75
            -d $home -s $shell -h - ; then
76
            echo "===> Created user $user"
77
        else
78
            cat <<-EOERRORMSG
79
*** Failed to create user $user.
80
81
Please add user $user manually with the following command:
82
83
    pw useradd -n $user -u $uid -g $group -c "$gecos" \\
84
       -d $home -s $shell -h -
85
86
and retry installing this package.
87
EOERRORMSG
88
            exit 1
89
        fi
90
    fi
91
}
92
93
94
if [ ${radius_run_as_user} != "yes" ]; then exit 0; fi
17
if [ ${radius_run_as_user} != "yes" ]; then exit 0; fi
95
18
96
case $2 in
19
case $2 in
97
    PRE-INSTALL)
20
    PRE-INSTALL)
98
        # Create the radius user and group if they do not already exist
99
        create_group $radius_user $radius_uid $radius_group $radius_gid \
100
                     "$radius_gecos" $radius_home $radius_shell
101
        create_user  $radius_user $radius_uid $radius_group $radius_gid \
102
                     "$radius_gecos" $radius_home $radius_shell
103
104
        # Fix the user and group in raddb/radiusd.conf
21
        # Fix the user and group in raddb/radiusd.conf
105
	echo "===> Setting user and group in radiusd.conf"
22
	echo "===> Setting user and group in radiusd.conf"
106
	for file in ${radius_raddb_work}/radiusd.conf ${radius_raddb}/radiusd.conf; do
23
	for file in ${radius_raddb_work}/radiusd.conf ${radius_raddb}/radiusd.conf; do
(-)freeradius2/pkg-plist (+2 lines)
Lines 85-90 Link Here
85
%%EXAMPLESDIR%%/raddb/radiusd.conf
85
%%EXAMPLESDIR%%/raddb/radiusd.conf
86
%%EXAMPLESDIR%%/raddb/sites-available/README
86
%%EXAMPLESDIR%%/raddb/sites-available/README
87
%%EXAMPLESDIR%%/raddb/sites-available/buffered-sql
87
%%EXAMPLESDIR%%/raddb/sites-available/buffered-sql
88
%%EXAMPLESDIR%%/raddb/sites-available/coa
88
%%EXAMPLESDIR%%/raddb/sites-available/control-socket
89
%%EXAMPLESDIR%%/raddb/sites-available/control-socket
89
%%EXAMPLESDIR%%/raddb/sites-available/copy-acct-to-home-server
90
%%EXAMPLESDIR%%/raddb/sites-available/copy-acct-to-home-server
90
%%EXAMPLESDIR%%/raddb/sites-available/decoupled-accounting
91
%%EXAMPLESDIR%%/raddb/sites-available/decoupled-accounting
Lines 749-754 Link Here
749
%%DATADIR%%/dictionary.vqp
750
%%DATADIR%%/dictionary.vqp
750
%%DATADIR%%/dictionary.walabi
751
%%DATADIR%%/dictionary.walabi
751
%%DATADIR%%/dictionary.waverider
752
%%DATADIR%%/dictionary.waverider
753
%%DATADIR%%/dictionary.wichorus
752
%%DATADIR%%/dictionary.wimax
754
%%DATADIR%%/dictionary.wimax
753
%%DATADIR%%/dictionary.wispr
755
%%DATADIR%%/dictionary.wispr
754
%%DATADIR%%/dictionary.xedia
756
%%DATADIR%%/dictionary.xedia

Return to bug 147188