Set download url to sourceforge
[openwrt.git] / openwrt / package / freeradius / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=freeradius
6 PKG_VERSION:=1.0.2
7 PKG_RELEASE:=2
8 PKG_MD5SUM:=f5dfce4efbb03bbc47ceae08270a875e
9
10 PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/radius/
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 PKG_CONFIGURE_OPTIONS := \
18 --enable-shared \
19 --disable-static \
20 --disable-ltdl-install \
21 --with-ltdl-include="$(STAGING_DIR)/usr/include" \
22 --with-ltdl-lib="$(STAGING_DIR)/usr/lib" \
23 --with-openssl-includes="$(STAGING_DIR)/usr/include" \
24 --with-openssl-libraries="$(STAGING_DIR)/usr/lib" \
25 --enable-strict-dependencies \
26 --with-raddbdir=/etc/freeradius \
27 --without-edir \
28 --without-snmp \
29 --with-experimental-modules \
30 --without-rlm_attr-rewrite \
31 --without-rlm_checkval \
32 --without-rlm_counter \
33 --without-rlm_dbm \
34 --with-rlm_eap \
35 --without-rlm_eap_sim \
36 --without-rlm_example \
37 --without-rlm_ippool \
38 --without-rlm_krb5 \
39 --without-rlm_pam \
40 --without-rlm_perl \
41 --without-rlm_python \
42 --without-rlm_radutmp \
43 --without-rlm_smb \
44 --with-rlm_sql \
45 --with-rlm_sqlcounter \
46 --without-rlm_sql_db2 \
47 --without-rlm_sql_freetds \
48 --without-rlm_sql_iodbc \
49 --without-rlm_sql_oracle \
50 --without-rlm_sql_sybase \
51 --without-rlm_sql_unixodbc \
52 --without-rlm_unix \
53 --without-rlm_x99-token \
54
55 ifneq ($(BR2_PACKAGE_FREERADIUS_MOD_LDAP),)
56 PKG_CONFIGURE_OPTIONS += \
57 --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
58 --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
59 else
60 PKG_CONFIGURE_OPTIONS += --without-rlm_ldap
61 endif
62 ifneq ($(BR2_PACKAGE_FREERADIUS_MOD_SQL_MYSQL),)
63 PKG_CONFIGURE_OPTIONS += \
64 --with-mysql-include-dir="$(STAGING_DIR)/usr/include/mysql" \
65 --with-mysql-lib-dir="$(STAGING_DIR)/usr/lib/mysql"
66 else
67 PKG_CONFIGURE_OPTIONS += --without-rlm_sql_mysql
68 endif
69 ifneq ($(BR2_PACKAGE_FREERADIUS_MOD_SQL_PGSQL),)
70 PKG_CONFIGURE_OPTIONS += \
71 --with-rlm_sql_postgresql-include-dir="$(STAGING_DIR)/usr/include" \
72 --with-rlm_sql_postgresql-lib-dir="$(STAGING_DIR)/usr/lib"
73 else
74 PKG_CONFIGURE_OPTIONS += --without-rlm_sql_postgresql
75 endif
76
77 include $(TOPDIR)/package/rules.mk
78
79 define PKG_mod_template
80
81 $$(IPKG_$(1)):
82 [ -z "$(2)" ] || install -d -m0755 $$(IDIR_$(1))/usr/lib/freeradius
83 for m in $(2); do \
84 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/freeradius/$$$${m}{,-*}.so \
85 $$(IDIR_$(1))/usr/lib/freeradius/ ; \
86 done
87 [ -z "$(3)" ] || install -d -m0755 $$(IDIR_$(1))/etc/freeradius
88 for f in $(3); do \
89 cp -fpR $(PKG_INSTALL_DIR)/etc/freeradius/$$$${f} \
90 $$(IDIR_$(1))/etc/freeradius/ ; \
91 done
92 $(RSTRIP) $$(IDIR_$(1))
93 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
94
95 endef
96
97 $(eval $(call PKG_template,FREERADIUS,freeradius,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
98 $(eval $(call PKG_template,FREERADIUS_DEMOCERTS,freeradius-democerts,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
99 $(eval $(call PKG_template,FREERADIUS_MOD_CHAP,freeradius-mod-chap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
100 $(eval $(call PKG_template,FREERADIUS_MOD_EAP,freeradius-mod-eap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
101 $(eval $(call PKG_template,FREERADIUS_MOD_EAP_GTC,freeradius-mod-eap-gtc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
102 $(eval $(call PKG_template,FREERADIUS_MOD_EAP_MD5,freeradius-mod-eap-md5,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
103 $(eval $(call PKG_template,FREERADIUS_MOD_EAP_MSCHAPV2,freeradius-mod-eap-mschapv2,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
104 $(eval $(call PKG_template,FREERADIUS_MOD_EAP_PEAP,freeradius-mod-eap-peap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
105 $(eval $(call PKG_template,FREERADIUS_MOD_EAP_TLS,freeradius-mod-eap-tls,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
106 $(eval $(call PKG_template,FREERADIUS_MOD_EAP_TTLS,freeradius-mod-eap-ttls,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
107 $(eval $(call PKG_template,FREERADIUS_MOD_FILES,freeradius-mod-files,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
108 $(eval $(call PKG_template,FREERADIUS_MOD_LDAP,freeradius-mod-ldap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
109 $(eval $(call PKG_template,FREERADIUS_MOD_MSCHAP,freeradius-mod-mschap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
110 $(eval $(call PKG_template,FREERADIUS_MOD_PAP,freeradius-mod-pap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
111 $(eval $(call PKG_template,FREERADIUS_MOD_SQL,freeradius-mod-sql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
112 $(eval $(call PKG_template,FREERADIUS_MOD_SQL_MYSQL,freeradius-mod-sql-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
113 $(eval $(call PKG_template,FREERADIUS_MOD_SQL_PGSQL,freeradius-mod-sql-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
114 $(eval $(call PKG_template,FREERADIUS_MOD_SQLCOUNTER,freeradius-mod-sqlcounter,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
115 $(eval $(call PKG_template,FREERADIUS_UTILS,freeradius-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
116
117 $(eval $(call PKG_mod_template,FREERADIUS_MOD_CHAP,rlm_chap,))
118 $(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP,libeap rlm_eap,eap.conf))
119 $(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_GTC,rlm_eap_gtc,))
120 $(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_MD5,rlm_eap_md5,))
121 $(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_MSCHAPV2,rlm_eap_mschapv2,))
122 $(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_PEAP,rlm_eap_peap,))
123 $(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_TLS,rlm_eap_tls,))
124 $(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_TTLS,rlm_eap_ttls,))
125 $(eval $(call PKG_mod_template,FREERADIUS_MOD_FILES,rlm_files,acct_users preproxy_users users))
126 $(eval $(call PKG_mod_template,FREERADIUS_MOD_LDAP,rlm_ldap,ldap.attrmap))
127 $(eval $(call PKG_mod_template,FREERADIUS_MOD_MSCHAP,rlm_mschap,))
128 $(eval $(call PKG_mod_template,FREERADIUS_MOD_PAP,rlm_pap,))
129 $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL,rlm_sql,sql.conf))
130 $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_MYSQL,rlm_sql_mysql,))
131 $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_PGSQL,rlm_sql_postgresql,))
132 $(eval $(call PKG_mod_template,FREERADIUS_MOD_SQLCOUNTER,rlm_sqlcounter,))
133
134 $(PKG_BUILD_DIR)/.configured:
135 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
136 $(TARGET_CONFIGURE_OPTS) \
137 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
138 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
139 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
140 sys_lib_dlsearch_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
141 sys_lib_search_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
142 MYSQL_CONFIG="no" \
143 ./configure \
144 --target=$(GNU_TARGET_NAME) \
145 --host=$(GNU_TARGET_NAME) \
146 --build=$(GNU_HOST_NAME) \
147 --program-prefix="" \
148 --program-suffix="" \
149 --prefix=/usr \
150 --exec-prefix=/usr \
151 --bindir=/usr/bin \
152 --datadir=/usr/share \
153 --includedir=/usr/include \
154 --infodir=/usr/share/info \
155 --libdir=/usr/lib/freeradius \
156 --libexecdir=/usr/lib/freeradius \
157 --localstatedir=/var \
158 --mandir=/usr/share/man \
159 --sbindir=/usr/sbin \
160 --sysconfdir=/etc \
161 $(DISABLE_LARGEFILE) \
162 $(DISABLE_NLS) \
163 $(PKG_CONFIGURE_OPTIONS) \
164 )
165 touch $@
166
167 $(PKG_BUILD_DIR)/.built:
168 rm -rf $(PKG_INSTALL_DIR)
169 mkdir -p $(PKG_INSTALL_DIR)
170 $(MAKE) -C $(PKG_BUILD_DIR) \
171 R="$(PKG_INSTALL_DIR)" \
172 INSTALLSTRIP="" \
173 all install
174 touch $@
175
176 $(IPKG_FREERADIUS):
177 install -m0755 -d $(IDIR_FREERADIUS)/etc/init.d
178 install -m0755 ./files/radiusd.init $(IDIR_FREERADIUS)/etc/init.d/radiusd
179 install -m0755 -d $(IDIR_FREERADIUS)/etc/freeradius
180 for f in clients.conf dictionary radiusd.conf; do \
181 cp -fpR $(PKG_INSTALL_DIR)/etc/freeradius/$${f} \
182 $(IDIR_FREERADIUS)/etc/freeradius/ ; \
183 done
184 install -m0755 -d $(IDIR_FREERADIUS)/usr/share/freeradius
185 cp -fpR $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary \
186 $(IDIR_FREERADIUS)/usr/share/freeradius/
187 for f in cisco freeradius microsoft tunnel wispr; do \
188 cp -fpR $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary.$${f} \
189 $(IDIR_FREERADIUS)/usr/share/freeradius/ ; \
190 done
191 install -m0755 -d $(IDIR_FREERADIUS)/usr/lib/freeradius
192 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/freeradius/libradius{,-*}.so \
193 $(IDIR_FREERADIUS)/usr/lib/freeradius/
194 install -m0755 -d $(IDIR_FREERADIUS)/usr/sbin
195 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/radiusd \
196 $(IDIR_FREERADIUS)/usr/sbin/
197 $(RSTRIP) $(IDIR_FREERADIUS)
198 $(IPKG_BUILD) $(IDIR_FREERADIUS) $(PACKAGE_DIR)
199
200 $(IPKG_FREERADIUS_DEMOCERTS):
201 install -m0755 -d $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius
202 cp -fpR $(PKG_INSTALL_DIR)/etc/freeradius/certs \
203 $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/
204 rm -rf $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/certs/README
205 rm -rf $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/certs/new*
206 rm -rf $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/certs/demoCA/index*
207 rm -rf $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/certs/demoCA/serial*
208 $(RSTRIP) $(IDIR_FREERADIUS_DEMOCERTS)
209 $(IPKG_BUILD) $(IDIR_FREERADIUS_DEMOCERTS) $(PACKAGE_DIR)
210
211 $(IPKG_FREERADIUS_UTILS):
212 install -m0755 -d $(IDIR_FREERADIUS_UTILS)/usr/bin
213 for f in radclient radeapclient; do \
214 cp -fpR $(PKG_INSTALL_DIR)/usr/bin/$${f} \
215 $(IDIR_FREERADIUS_UTILS)/usr/bin/ ; \
216 done
217 $(RSTRIP) $(IDIR_FREERADIUS_UTILS)
218 $(IPKG_BUILD) $(IDIR_FREERADIUS_UTILS) $(PACKAGE_DIR)
219
This page took 0.046402 seconds and 5 git commands to generate.