Ticket #4930: Makefile.3

File Makefile.3, 15.2 KB (added by jake1981 <oskari.rauta@…>, 9 years ago)

Removed uci dependancy

Line 
1#
2# Copyright (C) 2008 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# $Id: $
8
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=freeradius2
12PKG_VERSION:=2.1.4
13PKG_RELEASE:=2
14
15PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
16PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/freeradius/
17PKG_MD5SUM:=ba1fd573222ed5c8bead1cce1383a7a9
18
19PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
20
21include $(INCLUDE_DIR)/package.mk
22
23define Package/freeradius2/Default
24  SECTION:=net
25  CATEGORY:=Network
26  URL:=http://www.freeradius2.org/
27endef
28
29define Package/freeradius2
30  $(call Package/freeradius2/Default)
31  DEPENDS:=+libltdl +libopenssl +libpthread +libreadline
32  TITLE:=A flexible RADIUS server (version 2)
33  MENU:=1
34endef
35
36define Package/freeradius2/conffiles
37/etc/freeradius2/clients.conf
38/etc/freeradius2/radiusd.conf
39/etc/freeradius2/sites/default
40endef
41
42define Package/freeradius2-democerts
43  $(call Package/freeradius2/Default)
44  DEPENDS:=freeradius2
45  TITLE:=Demo certificates to test the server
46endef
47
48define Package/freeradius2-mod-chap
49  $(call Package/freeradius2/Default)
50  DEPENDS:=freeradius2
51  TITLE:=CHAP module
52endef
53
54define Package/freeradius2-mod-chap/conffiles
55/etc/freeradius2/modules/chap
56endef
57
58define Package/freeradius2-mod-detail
59  $(call Package/freeradius2/Default)
60  DEPENDS:=freeradius2
61  TITLE:=Detailed accounting module
62endef
63
64define Package/freeradius2-mod-detail/conffiles
65/etc/freeradius2/modules/detail
66endef
67
68define Package/freeradius2-mod-eap
69  $(call Package/freeradius2/Default)
70  DEPENDS:=freeradius2
71  TITLE:=Base EAP module
72endef
73
74define Package/freeradius2-mod-eap/conffiles
75/etc/freeradius2/eap.conf
76endef
77
78define Package/freeradius2-mod-eap-gtc
79  $(call Package/freeradius2/Default)
80  DEPENDS:=freeradius2-mod-eap
81  TITLE:=EAP/GTC module
82endef
83
84define Package/freeradius2-mod-eap-md5
85  $(call Package/freeradius2/Default)
86  DEPENDS:=freeradius2-mod-eap
87  TITLE:=EAP/MD5 module
88endef
89
90define Package/freeradius2-mod-eap-mschapv2
91  $(call Package/freeradius2/Default)
92  DEPENDS:=freeradius2-mod-eap
93  TITLE:=EAP/MS-CHAPv2 module
94endef
95
96define Package/freeradius2-mod-eap-peap
97  $(call Package/freeradius2/Default)
98  DEPENDS:=freeradius2-mod-eap
99  TITLE:=EAP/PEAP module
100endef
101
102define Package/freeradius2-mod-eap-tls
103  $(call Package/freeradius2/Default)
104  DEPENDS:=freeradius2-mod-eap
105  TITLE:=EAP/TLS module
106endef
107
108define Package/freeradius2-mod-eap-ttls
109  $(call Package/freeradius2/Default)
110  DEPENDS:=freeradius2-mod-eap-tls
111  TITLE:=EAP/TTLS module
112endef
113
114define Package/freeradius2-mod-exec
115  $(call Package/freeradius2/Default)
116  DEPENDS:=freeradius2
117  TITLE:=EXEC module
118endef
119
120define Package/freeradius2-mod-exec/conffiles
121/etc/freeradius2/modules/exec
122endef
123
124define Package/freeradius2-mod-expiration
125  $(call Package/freeradius2/Default)
126  DEPENDS:=freeradius2
127  TITLE:=Expiration module
128endef
129
130define Package/freeradius2-mod-expiration/conffiles
131/etc/freeradius2/modules/expiration
132endef
133
134define Package/freeradius2-mod-expr
135  $(call Package/freeradius2/Default)
136  DEPENDS:=freeradius2
137  TITLE:=EXPR module
138endef
139
140define Package/freeradius2-mod-expr/conffiles
141/etc/freeradius2/modules/expr
142endef
143
144define Package/freeradius2-mod-attr-filter
145  $(call Package/freeradius2/Default)
146  DEPENDS:=freeradius2
147  TITLE:=ATTR filter module
148endef
149
150define Package/freeradius2-mod-attr-filter/conffiles
151/etc/freeradius2/modules/attr_filter
152/etc/freeradius2/attrs
153/etc/freeradius2/attrs.access_reject
154/etc/freeradius2/attrs.accounting_response
155/etc/freeradius2/attrs.pre-proxy
156endef
157
158define Package/freeradius2-mod-attr-rewrite
159  $(call Package/freeradius2/Default)
160  DEPENDS:=freeradius2
161  TITLE:=ATTR rewrite module
162endef
163
164define Package/freeradius2-mod-attr-rewrite/conffiles
165/etc/freeradius2/modules/attr_rewrite
166endef
167
168define Package/freeradius2-mod-files
169  $(call Package/freeradius2/Default)
170  DEPENDS:=freeradius2
171  TITLE:=Module using local files for authorization
172endef
173
174define Package/freeradius2-mod-files/conffiles
175/etc/freeradius2/acct_users
176/etc/freeradius2/preproxy_users
177/etc/freeradius2/users
178/etc/freeradius2/modules/files
179endef
180
181define Package/freeradius2-mod-ldap
182  $(call Package/freeradius2/Default)
183  DEPENDS:=freeradius2 +libopenldap
184  TITLE:=LDAP module
185endef
186
187define Package/freeradius2-mod-ldap/conffiles
188/etc/freeradius2/ldap.attrmap
189/etc/freeradius2/modules/ldap
190endef
191
192define Package/freeradius2-mod-logintime
193  $(call Package/freeradius2/Default)
194  DEPENDS:=freeradius2
195  TITLE:=Logintime module
196endef
197
198define Package/freeradius2-mod-logintime/conffiles
199/etc/freeradius2/modules/logintime
200endef
201
202define Package/freeradius2-mod-mschap
203  $(call Package/freeradius2/Default)
204  DEPENDS:=freeradius2
205  TITLE:=MS-CHAP and MS-CHAPv2 module
206endef
207
208define Package/freeradius2-mod-mschap/conffiles
209/etc/freeradius2/modules/mschap
210endef
211
212define Package/freeradius2-mod-pap
213  $(call Package/freeradius2/Default)
214  DEPENDS:=freeradius2
215  TITLE:=PAP module
216endef
217
218define Package/freeradius2-mod-pap/conffiles
219/etc/freeradius2/modules/pap
220endef
221
222define Package/freeradius2-mod-preprocess
223  $(call Package/freeradius2/Default)
224  DEPENDS:=freeradius2
225  TITLE:=Request pre-processing module
226endef
227
228define Package/freeradius2-mod-preprocess/conffiles
229/etc/freeradius2/hints
230/etc/freeradius2/huntgroups
231/etc/freeradius2/modules/preprocess
232endef
233
234define Package/freeradius2-mod-realm
235  $(call Package/freeradius2/Default)
236  DEPENDS:=freeradius2
237  TITLE:=Realms handling module
238endef
239
240define Package/freeradius2-mod-realm/conffiles
241/etc/freeradius2/proxy.conf
242/etc/freeradius2/modules/realm
243endef
244
245define Package/freeradius2-mod-sql
246  $(call Package/freeradius2/Default)
247  DEPENDS:=freeradius2
248  TITLE:=Base SQL module
249endef
250
251define Package/freeradius2-mod-sql/conffiles
252/etc/freeradius2/sql.conf
253endef
254
255define Package/freeradius2-mod-sql-mysql
256  $(call Package/freeradius2/Default)
257  DEPENDS:=freeradius2-mod-sql +libmysqlclient
258  TITLE:=MySQL module
259endef
260
261define Package/freeradius2-mod-sql-pgsql
262  $(call Package/freeradius2/Default)
263  DEPENDS:=freeradius2-mod-sql +libpq
264  TITLE:=PostgreSQL module
265endef
266
267define Package/freeradius2-mod-sqlcounter
268  $(call Package/freeradius2/Default)
269  DEPENDS:=freeradius2-mod-sql
270  TITLE:=Generic SQL Counter module
271endef
272
273define Package/freeradius2-mod-radutmp
274  $(call Package/freeradius2/Default)
275  DEPENDS:=freeradius2
276  TITLE:=Radius UTMP module
277endef
278
279define Package/freeradius2-mod-radutmp/conffiles
280/etc/freeradius2/modules/radutmp
281/etc/freeradius2/modules/sradutmp
282endef
283
284define Package/freeradius2-utils
285  $(call Package/freeradius2/Default)
286  DEPENDS:=freeradius2
287  TITLE:=Misc. client utilities
288endef
289
290CONFIGURE_ARGS+= \
291        --libdir=/usr/lib/freeradius2 \
292        --libexecdir=/usr/lib/freeradius2 \
293        --enable-shared \
294        --disable-static \
295        --disable-developer \
296        --with-openssl-includes="$(STAGING_DIR)/usr/include" \
297        --with-openssl-libraries="$(STAGING_DIR)/usr/lib" \
298        --enable-strict-dependencies \
299        --with-raddbdir=/etc/freeradius2 \
300        --with-radacctdir=/var/db/radacct \
301        --with-logdir=/var/log \
302        --without-edir \
303        --without-snmp \
304        --without-rlm_checkval \
305        --without-rlm_dbm \
306        --without-rlm_counter \
307        --with-rlm_expr \
308        --with-rlm_eap \
309        --without-rlm_eap_sim \
310        --without-rlm_example \
311        --without-rlm_ippool \
312        --without-rlm_krb5 \
313        --without-rlm_otp \
314        --without-rlm_smsotp \
315        --without-rlm_pam \
316        --without-rlm_perl \
317        --without-rlm_python \
318        --without-rlm_smb \
319        --with-rlm_sql \
320        --with-rlm_sqlcounter \
321        --without-rlm_sqlhpwippool \
322        --without-rlm_sqlippool \
323        --without-rlm_sql_db2 \
324        --without-rlm_sql_firebird \
325        --without-rlm_sql_freetds \
326        --without-rlm_sql_iodbc \
327        --without-rlm_sql_oracle \
328        --without-rlm_sql_sybase \
329        --without-rlm_sql_unixodbc \
330        --without-rlm_sql_log \
331        --without-rlm_sql_sqlite \
332        --without-rlm_unix \
333        --without-rlm_eap_tnc \
334        --without-rlm_eap_ikev2 \
335        --without-rlm_opendirectory \
336        --without-rlm_wimax \
337
338PKG_DICTIONARIES:= \
339        freeradius freeradius.internal \
340        rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
341        rfc4372 rfc4675 rfc4679 \
342        microsoft \
343        wispr \
344
345ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-ldap),)
346  CONFIGURE_ARGS+= \
347                --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
348                --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
349  CONFIGURE_LIBS+= -lcrypto -lssl
350else
351  CONFIGURE_ARGS+= --without-rlm_ldap
352endif
353
354ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-mysql),)
355  CONFIGURE_ARGS+= \
356                --with-mysql-include-dir="$(STAGING_DIR)/usr/include" \
357                --with-mysql-lib-dir="$(STAGING_DIR)/usr/lib/mysql" \
358                --without-threads
359  CONFIGURE_LIBS+= -lz
360else
361  CONFIGURE_ARGS+= --without-rlm_sql_mysql
362endif
363
364ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-pgsql),)
365  CONFIGURE_ARGS+= \
366                --with-rlm_sql_postgresql-include-dir="$(STAGING_DIR)/usr/include" \
367                --with-rlm_sql_postgresql-lib-dir="$(STAGING_DIR)/usr/lib"
368else
369  CONFIGURE_ARGS+= --without-rlm_sql_postgresql
370endif
371
372ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-peap),)
373  CONFIGURE_ARGS+= \
374                --with-rlm_eap_peap \
375                --with-rlm_eap_peap-include-dir="$(STAGING_DIR)/usr/include" \
376                --with-rlm_eap_peap-lib-dir="$(STAGING_DIR)/usr/lib"
377  CONFIGURE_LIBS+= -lcrypto -lssl
378else
379  CONFIGURE_ARGS+= --without-rlm_eap_peap
380endif
381
382ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-tls),)
383  CONFIGURE_ARGS+= \
384                --with-rlm_eap_tls \
385                --with-rlm_eap_tls-include-dir="$(STAGING_DIR)/usr/include" \
386                --with-rlm_eap_tls-lib-dir="$(STAGING_DIR)/usr/lib"
387  CONFIGURE_LIBS+= -lcrypto -lssl
388else
389  CONFIGURE_ARGS+= --without-rlm_eap_tls
390endif
391
392ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-ttls),)
393  CONFIGURE_ARGS+= \
394                --with-rlm_eap_ttls \
395                --with-rlm_eap_ttls-include-dir="$(STAGING_DIR)/usr/include" \
396                --with-rlm_eap_ttls-lib-dir="$(STAGING_DIR)/usr/lib"
397  CONFIGURE_LIBS+= -lcrypto -lssl
398else
399  CONFIGURE_ARGS+= --without-rlm_eap_ttls
400endif
401
402ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-attr-rewrite),)
403  CONFIGURE_ARGS+= --with-rlm_attr-rewrite
404else
405  CONFIGURE_ARGS+= --without-rlm_attr-rewrite
406endif
407
408ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-radutmp),)
409  CONFIGURE_ARGS+= --with-rlm_radutmp
410else
411  CONFIGURE_ARGS+= --without-rlm_radutmp
412endif
413
414ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-logintime),)
415  CONFIGURE_ARGS+= --with-rlm_logintime
416else
417  CONFIGURE_ARGS+= --without-rlm_logintime
418endif
419
420ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-expiration),)
421  CONFIGURE_ARGS+= --with-rlm_expiration
422else
423  CONFIGURE_ARGS+= --without-rlm_expiration
424endif
425
426CONFIGURE_VARS+= \
427        LDFLAGS="$$$$LDFLAGS" \
428        LIBS="$(CONFIGURE_LIBS)" \
429        MYSQL_CONFIG="no" \
430        ac_cv_lib_readline=no \
431
432define Build/Compile
433        $(MAKE) -C $(PKG_BUILD_DIR) \
434                R="$(PKG_INSTALL_DIR)" \
435                INSTALLSTRIP="" \
436                all certs install
437endef
438
439define Package/freeradius2/install
440        $(INSTALL_DIR) $(1)/etc/freeradius2
441        $(INSTALL_DIR) $(1)/etc/freeradius2/modules
442        $(INSTALL_DIR) $(1)/etc/freeradius2/sites
443        for f in clients.conf dictionary radiusd.conf policy.conf; do \
444                $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$${f} $(1)/etc/freeradius2/ ; \
445        done
446        $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/sites-available/default $(1)/etc/freeradius2/sites/default
447        $(INSTALL_DIR) $(1)/usr/share/freeradius2
448        $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary $(1)/usr/share/freeradius2/
449        $(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius2/dictionary
450        for f in $(PKG_DICTIONARIES); do \
451                $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary.$$$${f} $(1)/usr/share/freeradius2/ ; \
452                $(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\),\1,g" $(1)/usr/share/freeradius2/dictionary ; \
453        done
454        $(INSTALL_DIR) $(1)/usr/lib/freeradius2
455        $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-radius{,-*}.so $(1)/usr/lib/freeradius2
456        $(INSTALL_DIR) $(1)/usr/sbin
457        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
458        $(INSTALL_DIR) $(1)/etc/init.d
459        $(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
460endef
461
462define Package/freeradius2-democerts/install
463        $(INSTALL_DIR) $(1)/etc/freeradius2
464        $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/certs $(1)/etc/freeradius2/
465        rm -rf $(1)/etc/freeradius2/certs/README
466        rm -rf $(1)/etc/freeradius2/certs/new*
467        rm -rf $(1)/etc/freeradius2/certs/demoCA/index*
468        rm -rf $(1)/etc/freeradius2/certs/demoCA/serial*
469        rm -rf $(1)/etc/freeradius2/certs/bootstrap
470        rm -rf $(1)/etc/freeradius2/certs/Makefile
471        rm -rf $(1)/etc/freeradius2/certs/ca.cnf
472        rm -rf $(1)/etc/freeradius2/certs/client.cnf
473        rm -rf $(1)/etc/freeradius2/certs/server.cnf
474endef
475
476define Package/freeradius2-utils/install
477        $(INSTALL_DIR) $(1)/usr/bin
478        for f in radclient radeapclient; do \
479                $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ ; \
480        done
481endef
482
483define BuildPlugin
484  define Package/$(1)/install
485        [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeradius2
486        for m in $(2); do \
487                $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/$$$$$$$${m}{,-*}.so $$(1)/usr/lib/freeradius2 ; \
488        done
489        [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius2
490        [ -z "$(4)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius2/$(4)
491        for f in $(3); do \
492                $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$$$$$${f} $$(1)/etc/freeradius2/$$$$$$$${f} ; \
493        done
494  endef
495
496  $$(eval $$(call BuildPackage,$(1)))
497endef
498
499$(eval $(call BuildPackage,freeradius2))
500$(eval $(call BuildPackage,freeradius2-democerts))
501$(eval $(call BuildPlugin,freeradius2-mod-chap,rlm_chap,modules/chap,modules,))
502$(eval $(call BuildPlugin,freeradius2-mod-detail,rlm_detail,modules/detail,modules,))
503$(eval $(call BuildPlugin,freeradius2-mod-eap,libfreeradius-eap rlm_eap,eap.conf))
504$(eval $(call BuildPlugin,freeradius2-mod-eap-gtc,rlm_eap_gtc,))
505$(eval $(call BuildPlugin,freeradius2-mod-eap-md5,rlm_eap_md5,))
506$(eval $(call BuildPlugin,freeradius2-mod-eap-mschapv2,rlm_eap_mschapv2,))
507$(eval $(call BuildPlugin,freeradius2-mod-eap-peap,rlm_eap_peap,))
508$(eval $(call BuildPlugin,freeradius2-mod-eap-tls,rlm_eap_tls,))
509$(eval $(call BuildPlugin,freeradius2-mod-eap-ttls,rlm_eap_ttls,))
510$(eval $(call BuildPlugin,freeradius2-mod-exec,rlm_exec,modules/exec modules/echo ,modules,))
511$(eval $(call BuildPlugin,freeradius2-mod-attr-rewrite,rlm_attr_rewrite,modules/attr_rewrite,modules,))
512$(eval $(call BuildPlugin,freeradius2-mod-files,rlm_files,acct_users preproxy_users users modules/files,modules,))
513$(eval $(call BuildPlugin,freeradius2-mod-ldap,rlm_ldap,ldap.attrmap modules/ldap,modules,))
514$(eval $(call BuildPlugin,freeradius2-mod-mschap,rlm_mschap,modules/mschap,modules,))
515$(eval $(call BuildPlugin,freeradius2-mod-pap,rlm_pap,modules/pap,modules,))
516$(eval $(call BuildPlugin,freeradius2-mod-preprocess,rlm_preprocess,hints huntgroups modules/preprocess,modules,))
517$(eval $(call BuildPlugin,freeradius2-mod-realm,rlm_realm,proxy.conf modules/realm modules/inner-eap,modules,))
518$(eval $(call BuildPlugin,freeradius2-mod-sql,rlm_sql,sql.conf,))
519$(eval $(call BuildPlugin,freeradius2-mod-sql-mysql,rlm_sql_mysql,))
520$(eval $(call BuildPlugin,freeradius2-mod-sql-pgsql,rlm_sql_postgresql,))
521$(eval $(call BuildPlugin,freeradius2-mod-sqlcounter,rlm_sqlcounter,))
522$(eval $(call BuildPlugin,freeradius2-mod-radutmp,rlm_radutmp,modules/radutmp modules/sradutmp,modules,))
523$(eval $(call BuildPlugin,freeradius2-mod-logintime,rlm_logintime,modules/logintime,modules,))
524$(eval $(call BuildPlugin,freeradius2-mod-expr,rlm_expr,modules/expr,modules,))
525$(eval $(call BuildPlugin,freeradius2-mod-attr-filter,rlm_attr_filter,modules/attr_filter attrs attrs.access_reject attrs.accounting_response attrs.pre-proxy,modules,,))
526$(eval $(call BuildPlugin,freeradius2-mod-expiration,rlm_expiration,modules/expiration,modules,))
527$(eval $(call BuildPackage,freeradius2-utils))