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