[packages] Add missing libtool fixups
[openwrt/svn-archive/archive.git] / net / freeradius / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=freeradius
11 PKG_VERSION:=1.1.8
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/radius/old/ \
16 http://freeradius.portal-to-web.de/ \
17 ftp://ftp.uk.freeradius.org/pub/radius/
18 PKG_MD5SUM:=d367452a837bbe8d9c8731e21dc43593
19
20 PKG_FIXUP:=libtool
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/freeradius/Default
25 SECTION:=net
26 CATEGORY:=Network
27 URL:=http://freeradius.org/
28 endef
29
30 define Package/freeradius
31 $(call Package/freeradius/Default)
32 DEPENDS:=+libltdl +libopenssl +libpthread +libreadline
33 TITLE:=A flexible RADIUS server
34 MENU:=1
35 endef
36
37 define Package/freeradius/conffiles
38 /etc/freeradius/clients.conf
39 /etc/freeradius/radiusd.conf
40 endef
41
42 define Package/freeradius-democerts
43 $(call Package/freeradius/Default)
44 DEPENDS:=freeradius
45 TITLE:=Demo certificates to test the server
46 endef
47
48 define Package/freeradius-mod-chap
49 $(call Package/freeradius/Default)
50 DEPENDS:=freeradius
51 TITLE:=CHAP module
52 endef
53
54 define Package/freeradius-mod-detail
55 $(call Package/freeradius/Default)
56 DEPENDS:=freeradius
57 TITLE:=Detailed accounting module
58 endef
59
60 define Package/freeradius-mod-eap
61 $(call Package/freeradius/Default)
62 DEPENDS:=freeradius
63 TITLE:=Base EAP module
64 endef
65
66 define Package/freeradius-mod-eap/conffiles
67 /etc/freeradius/eap.conf
68 endef
69
70 define Package/freeradius-mod-eap-gtc
71 $(call Package/freeradius/Default)
72 DEPENDS:=freeradius-mod-eap
73 TITLE:=EAP/GTC module
74 endef
75
76 define Package/freeradius-mod-eap-md5
77 $(call Package/freeradius/Default)
78 DEPENDS:=freeradius-mod-eap
79 TITLE:=EAP/MD5 module
80 endef
81
82 define Package/freeradius-mod-eap-mschapv2
83 $(call Package/freeradius/Default)
84 DEPENDS:=freeradius-mod-eap
85 TITLE:=EAP/MS-CHAPv2 module
86 endef
87
88 define Package/freeradius-mod-eap-peap
89 $(call Package/freeradius/Default)
90 DEPENDS:=freeradius-mod-eap
91 TITLE:=EAP/PEAP module
92 endef
93
94 define Package/freeradius-mod-eap-tls
95 $(call Package/freeradius/Default)
96 DEPENDS:=freeradius-mod-eap
97 TITLE:=EAP/TLS module
98 endef
99
100 define Package/freeradius-mod-eap-ttls
101 $(call Package/freeradius/Default)
102 DEPENDS:=freeradius-mod-eap-tls
103 TITLE:=EAP/TTLS module
104 endef
105
106 define Package/freeradius-mod-exec
107 $(call Package/freeradius/Default)
108 DEPENDS:=freeradius
109 TITLE:=EXEC module
110 endef
111
112 define Package/freeradius-mod-attr-rewrite
113 $(call Package/freeradius/Default)
114 DEPENDS:=freeradius
115 TITLE:=ATTR rewrite module
116 endef
117
118 define Package/freeradius-mod-files
119 $(call Package/freeradius/Default)
120 DEPENDS:=freeradius
121 TITLE:=Module using local files for authorization
122 endef
123
124 define Package/freeradius-mod-files/conffiles
125 /etc/freeradius/acct_users
126 /etc/freeradius/preproxy_users
127 /etc/freeradius/users
128 endef
129
130 define Package/freeradius-mod-ldap
131 $(call Package/freeradius/Default)
132 DEPENDS:=freeradius +libopenldap
133 TITLE:=LDAP module
134 endef
135
136 define Package/freeradius-mod-ldap/conffiles
137 /etc/freeradius/ldap.attrmap
138 endef
139
140 define Package/freeradius-mod-mschap
141 $(call Package/freeradius/Default)
142 DEPENDS:=freeradius
143 TITLE:=MS-CHAP and MS-CHAPv2 module
144 endef
145
146 define Package/freeradius-mod-pap
147 $(call Package/freeradius/Default)
148 DEPENDS:=freeradius
149 TITLE:=PAP module
150 endef
151
152 define Package/freeradius-mod-preprocess
153 $(call Package/freeradius/Default)
154 DEPENDS:=freeradius
155 TITLE:=Request pre-processing module
156 endef
157
158 define Package/freeradius-mod-preprocess/conffiles
159 /etc/freeradius/hints
160 /etc/freeradius/huntgroups
161 endef
162
163 define Package/freeradius-mod-realm
164 $(call Package/freeradius/Default)
165 DEPENDS:=freeradius
166 TITLE:=Realms handling module
167 endef
168
169 define Package/freeradius-mod-realm/conffiles
170 /etc/freeradius/proxy.conf
171 endef
172
173 define Package/freeradius-mod-sql
174 $(call Package/freeradius/Default)
175 DEPENDS:=freeradius
176 TITLE:=Base SQL module
177 endef
178
179 define Package/freeradius-mod-sql-mysql
180 $(call Package/freeradius/Default)
181 DEPENDS:=freeradius-mod-sql +libmysqlclient
182 TITLE:=MySQL module
183 endef
184
185 define Package/freeradius-mod-sql-pgsql
186 $(call Package/freeradius/Default)
187 DEPENDS:=freeradius-mod-sql +libpq
188 TITLE:=PostgreSQL module
189 endef
190
191 define Package/freeradius-mod-sqlcounter
192 $(call Package/freeradius/Default)
193 DEPENDS:=freeradius-mod-sql
194 TITLE:=Generic SQL Counter module
195 endef
196
197 define Package/freeradius-mod-radutmp
198 $(call Package/freeradius/Default)
199 DEPENDS:=freeradius
200 TITLE:=Radius UTMP module
201 endef
202
203 define Package/freeradius-utils
204 $(call Package/freeradius/Default)
205 DEPENDS:=freeradius
206 TITLE:=Misc. client utilities
207 endef
208
209 CONFIGURE_ARGS+= \
210 --libdir=/usr/lib/freeradius \
211 --libexecdir=/usr/lib/freeradius \
212 --enable-shared \
213 --disable-static \
214 --disable-developer \
215 --with-openssl-includes="$(STAGING_DIR)/usr/include" \
216 --with-openssl-libraries="$(STAGING_DIR)/usr/lib" \
217 --with-system-libtool \
218 --disable-ltdl-install \
219 --enable-strict-dependencies \
220 --with-raddbdir=/etc/freeradius \
221 --without-edir \
222 --without-snmp \
223 --with-experimental-modules \
224 --without-rlm_checkval \
225 --without-rlm_counter \
226 --without-rlm_dbm \
227 --with-rlm_eap \
228 --without-rlm_eap_sim \
229 --without-rlm_example \
230 --without-rlm_ippool \
231 --without-rlm_krb5 \
232 --without-rlm_otp \
233 --without-rlm_pam \
234 --without-rlm_perl \
235 --without-rlm_python \
236 --without-rlm_smb \
237 --with-rlm_sql \
238 --with-rlm_sqlcounter \
239 --without-rlm_sqlhpwippool \
240 --without-rlm_sqlippool \
241 --without-rlm_sql_db2 \
242 --without-rlm_sql_firebird \
243 --without-rlm_sql_freetds \
244 --without-rlm_sql_iodbc \
245 --without-rlm_sql_oracle \
246 --without-rlm_sql_sybase \
247 --without-rlm_sql_unixodbc \
248 --without-rlm_sql_log \
249 --without-rlm_unix \
250
251 PKG_DICTIONARIES:= \
252 freeradius freeradius.internal \
253 rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
254 rfc4372 rfc4675 rfc4679 \
255 microsoft \
256 wispr \
257
258 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius-mod-ldap),)
259 CONFIGURE_ARGS+= \
260 --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
261 --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
262 CONFIGURE_LIBS+= -lcrypto -lssl
263 else
264 CONFIGURE_ARGS+= --without-rlm_ldap
265 endif
266
267 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius-mod-sql-mysql),)
268 CONFIGURE_ARGS+= \
269 --with-mysql-include-dir="$(STAGING_DIR)/usr/include" \
270 --with-mysql-lib-dir="$(STAGING_DIR)/usr/lib/mysql" \
271 --without-threads
272 CONFIGURE_LIBS+= -lz
273 else
274 CONFIGURE_ARGS+= --without-rlm_sql_mysql
275 endif
276
277 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius-mod-sql-pgsql),)
278 CONFIGURE_ARGS+= \
279 --with-rlm_sql_postgresql-include-dir="$(STAGING_DIR)/usr/include" \
280 --with-rlm_sql_postgresql-lib-dir="$(STAGING_DIR)/usr/lib"
281 else
282 CONFIGURE_ARGS+= --without-rlm_sql_postgresql
283 endif
284
285 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius-mod-eap-peap),)
286 CONFIGURE_ARGS+= --with-rlm_eap_peap
287 CONFIGURE_LIBS+= -lcrypto -lssl
288 else
289 CONFIGURE_ARGS+= --without-rlm_eap_peap
290 endif
291
292 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius-mod-eap-tls),)
293 CONFIGURE_ARGS+= --with-rlm_eap_tls
294 CONFIGURE_LIBS+= -lcrypto -lssl
295 else
296 CONFIGURE_ARGS+= --without-rlm_eap_tls
297 endif
298
299 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius-mod-eap-ttls),)
300 CONFIGURE_ARGS+= --with-rlm_eap_ttls
301 CONFIGURE_LIBS+= -lcrypto -lssl
302 else
303 CONFIGURE_ARGS+= --without-rlm_eap_ttls
304 endif
305
306 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius-mod-attr-rewrite),)
307 CONFIGURE_ARGS+= --with-rlm_attr-rewrite
308 else
309 CONFIGURE_ARGS+= --without-rlm_attr-rewrite
310 endif
311
312 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius-mod-radutmp),)
313 CONFIGURE_ARGS+= --with-rlm_radutmp
314 else
315 CONFIGURE_ARGS+= --without-rlm_radutmp
316 endif
317
318 CONFIGURE_VARS+= \
319 LDFLAGS="$$$$LDFLAGS -L$(PKG_INSTALL_DIR)/usr/lib/freeradius" \
320 LIBS="$(CONFIGURE_LIBS)" \
321 MYSQL_CONFIG="no" \
322
323 define Build/Compile
324 $(MAKE) -C $(PKG_BUILD_DIR) \
325 R="$(PKG_INSTALL_DIR)" \
326 INSTALLSTRIP="" \
327 all install
328 endef
329
330 define Package/freeradius/install
331 $(INSTALL_DIR) $(1)/etc/freeradius
332 for f in clients.conf dictionary radiusd.conf; do \
333 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius/$$$${f} $(1)/etc/freeradius/ ; \
334 done
335 $(INSTALL_DIR) $(1)/usr/share/freeradius
336 $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary $(1)/usr/share/freeradius/
337 $(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius/dictionary
338 for f in $(PKG_DICTIONARIES); do \
339 $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary.$$$${f} $(1)/usr/share/freeradius/ ; \
340 $(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\),\1,g" $(1)/usr/share/freeradius/dictionary ; \
341 done
342 $(INSTALL_DIR) $(1)/usr/lib/freeradius
343 $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius/libradius{,-*}.so $(1)/usr/lib/
344 $(INSTALL_DIR) $(1)/usr/sbin
345 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
346 $(INSTALL_DIR) $(1)/etc/init.d
347 $(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
348 endef
349
350 define Package/freeradius-democerts/install
351 $(INSTALL_DIR) $(1)/etc/freeradius
352 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius/certs $(1)/etc/freeradius/
353 rm -rf $(1)/etc/freeradius/certs/README
354 rm -rf $(1)/etc/freeradius/certs/new*
355 rm -rf $(1)/etc/freeradius/certs/demoCA/index*
356 rm -rf $(1)/etc/freeradius/certs/demoCA/serial*
357 endef
358
359 define Package/freeradius-utils/install
360 $(INSTALL_DIR) $(1)/usr/bin
361 for f in radclient radeapclient; do \
362 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ ; \
363 done
364 endef
365
366 define BuildPlugin
367 define Package/$(1)/install
368 [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib
369 for m in $(2); do \
370 $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius/$$$$$$$${m}{,-*}.so $$(1)/usr/lib/ ; \
371 done
372 [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius
373 for f in $(3); do \
374 $(CP) $(PKG_INSTALL_DIR)/etc/freeradius/$$$$$$$${f} $$(1)/etc/freeradius/ ; \
375 done
376 endef
377
378 $$(eval $$(call BuildPackage,$(1)))
379 endef
380
381 $(eval $(call BuildPackage,freeradius))
382 $(eval $(call BuildPackage,freeradius-democerts))
383 $(eval $(call BuildPlugin,freeradius-mod-chap,rlm_chap,))
384 $(eval $(call BuildPlugin,freeradius-mod-detail,rlm_detail,))
385 $(eval $(call BuildPlugin,freeradius-mod-eap,libeap rlm_eap,eap.conf))
386 $(eval $(call BuildPlugin,freeradius-mod-eap-gtc,rlm_eap_gtc,))
387 $(eval $(call BuildPlugin,freeradius-mod-eap-md5,rlm_eap_md5,))
388 $(eval $(call BuildPlugin,freeradius-mod-eap-mschapv2,rlm_eap_mschapv2,))
389 $(eval $(call BuildPlugin,freeradius-mod-eap-peap,rlm_eap_peap,))
390 $(eval $(call BuildPlugin,freeradius-mod-eap-tls,rlm_eap_tls,))
391 $(eval $(call BuildPlugin,freeradius-mod-eap-ttls,rlm_eap_ttls,))
392 $(eval $(call BuildPlugin,freeradius-mod-exec,rlm_exec,))
393 $(eval $(call BuildPlugin,freeradius-mod-attr-rewrite,rlm_attr_rewrite))
394 $(eval $(call BuildPlugin,freeradius-mod-files,rlm_files,acct_users preproxy_users users))
395 $(eval $(call BuildPlugin,freeradius-mod-ldap,rlm_ldap,ldap.attrmap))
396 $(eval $(call BuildPlugin,freeradius-mod-mschap,rlm_mschap,))
397 $(eval $(call BuildPlugin,freeradius-mod-pap,rlm_pap,))
398 $(eval $(call BuildPlugin,freeradius-mod-preprocess,rlm_preprocess,hints huntgroups))
399 $(eval $(call BuildPlugin,freeradius-mod-realm,rlm_realm,proxy.conf))
400 $(eval $(call BuildPlugin,freeradius-mod-sql,rlm_sql,sql.conf))
401 $(eval $(call BuildPlugin,freeradius-mod-sql-mysql,rlm_sql_mysql,))
402 $(eval $(call BuildPlugin,freeradius-mod-sql-pgsql,rlm_sql_postgresql,))
403 $(eval $(call BuildPlugin,freeradius-mod-sqlcounter,rlm_sqlcounter,))
404 $(eval $(call BuildPlugin,freeradius-mod-radutmp,rlm_radutmp,))
405 $(eval $(call BuildPackage,freeradius-utils))