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/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