summaryrefslogtreecommitdiff
path: root/net/freeradius/Makefile
blob: 1ce546819df9c0e895c4007bf4762cb690a45bc2 (plain)
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# $NetBSD: Makefile,v 1.39 2005/12/05 23:55:13 rillig Exp $

DISTNAME=	freeradius-1.0.5
PKGREVISION=	2
CATEGORIES=	net
MASTER_SITES=	ftp://ftp.freeradius.org/pub/radius/ \
		ftp://ftp.Awfulhak.org/pub/radius/

MAINTAINER=	adrianp@NetBSD.org
HOMEPAGE=	http://www.freeradius.org/
COMMENT=	Free RADIUS server implementation

.include "../../mk/bsd.prefs.mk"

CONFLICTS+=		radiusd-cistron*
USE_TOOLS+=		gmake perl:run
GNU_CONFIGURE=		YES
USE_PKGINSTALL=		YES
LIBTOOLIZE_PLIST=	NO
PLIST_SRC=		${WRKDIR}/.PLIST_SRC
FILES_SUBST+=		ROOT_USER=${ROOT_USER:Q}
FILES_SUBST+=		ROOT_GROUP=${ROOT_GROUP:Q}
USE_OLD_DES_API=	YES

BUILDLINK_DEPENDS.openssl+=	openssl>=0.9.7

# This package currently breaks using our libtool.  It does not appear to use
# libtool properly/fully and as a result the daemon does not compile correctly.
#
#USE_LIBTOOL=		YES
#LIBTOOL_OVERRIDE=	libtool

CONFIGURE_ARGS+=	--with-logdir=${VARBASE}/log
CONFIGURE_ARGS+=	--localstatedir=${VARBASE:Q}
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFBASEDIR:Q}
CONFIGURE_ARGS+=	--disable-ltdl-install
CONFIGURE_ARGS+=	--with-ltdl-lib=${PREFIX}/lib
CONFIGURE_ARGS+=	--with-ltdl-include=${PREFIX}/include
CONFIGURE_ARGS+=        --without-rlm_ippool
CONFIGURE_ARGS+=        --without-rlm_smb
CONFIGURE_ARGS+=	--without-rlm_krb5
CONFIGURE_ARGS+=	--without-rlm_pam
CONFIGURE_ARGS+=	--without-rlm_sql_iodbc
CONFIGURE_ARGS+=	--without-rlm_sql_oracle
CONFIGURE_ARGS+=	--without-rlm_sql_unixodbc

SUBST_CLASSES+=		make
SUBST_STAGE.make=	post-patch
SUBST_FILES.make=	src/modules/rlm_ldap/Makefile.in \
			src/modules/rlm_mschap/Makefile \
			src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile.in
SUBST_SED.make= 	-e "s|RLM_LDFLAGS	=|RLM_LDFLAGS 	= \
				-L../../../src/lib/.libs/ -lradius|g" \
			-e "s|RLM_SQL_LIBS	=|RLM_SQL_LIBS	= \
				-L${PREFIX}/lib|g"
SUBST_MESSAGE.make=	"Fixing Makefiles."

.include "options.mk"

RCD_SCRIPTS=		radiusd

OWN_DIRS=		${VARBASE}/run/radiusd

PKG_SYSCONFSUBDIR=	raddb
EGDIR=			${PREFIX}/share/examples/freeradius

EGFILES=	acct_users attrs certs/demoCA/index.txt.old \
		certs/demoCA/cacert.pem certs/demoCA/index.txt \
		certs/demoCA/serial.old certs/demoCA/serial \
		certs/newcert.pem certs/README certs/dh \
		certs/cert-clt.der certs/cert-clt.p12 certs/cert-clt.pem \
		certs/cert-srv.der certs/cert-srv.p12 certs/cert-srv.pem \
		certs/newreq.pem certs/random certs/root.der certs/root.p12 \
		certs/root.pem clients clients.conf dictionary.in eap.conf \
		experimental.conf hints huntgroups ldap.attrmap mssql.conf \
		naslist naspasswd oraclesql.conf pgsql-voip.conf \
		postgresql.conf preproxy_users proxy.conf radiusd.conf.in \
		realms snmp.conf sql.conf users x99.conf x99passwd.sample \
		radiusd.conf dictionary

.for f in ${EGFILES}
CONF_FILES+= 	${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f}
.endfor

.include "../../security/openssl/buildlink3.mk"
.include "../../devel/libltdl/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"

.if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "none"
CONFIGURE_ARGS+=	--without-threads
.endif

.if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "pth"
.include "../../devel/pthread-sem/buildlink3.mk"
SUBST_SED.make+= 	-e "s|@ldap_ldflags@|@ldap_ldflags@ \
				-lpthread -lsemaphore|g"
.endif

.if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "native"
SUBST_SED.make+= 	-e "s|@ldap_ldflags@|@ldap_ldflags@ \
				-lpthread|g"
.endif

.if ${MACHINE_ARCH} == "amd64"
CFLAGS+= -fPIC
.endif

pre-build:
	cd ${WRKSRC} && ${LN} -s src/lib lib

post-build:
	@${CP} ${PKGDIR}/PLIST ${WRKDIR}/.PLIST_SRC

post-install:
	${INSTALL_DATA_DIR} ${EGDIR}
	${INSTALL_DATA_DIR} ${EGDIR}/certs
	${INSTALL_DATA_DIR} ${EGDIR}/certs/demoCA
.for f in ${EGFILES}
	${INSTALL_DATA} ${WRKSRC}/raddb/${f} ${EGDIR}/${f}
.endfor
	@${MKDIR} ${PKG_SYSCONFDIR}/certs
	@${MKDIR} ${PKG_SYSCONFDIR}/certs/demoCA
	cd ${WRKSRC} && ${FIND} . -name .libs | ${XARGS} ${RM} -rf

.include "../../mk/bsd.pkg.mk"