Remove .la libtool file installed in STAGING_DIR
[openwrt.git] / 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 -L$(PKG_INSTALL_DIR)/usr/lib/freeradius" \
129 lt_sys_lib_search_path_spec="$(STAGING_DIR)/usr/lib" \
130 MYSQL_CONFIG="no" \
131 ./configure \
132 --target=$(GNU_TARGET_NAME) \
133 --host=$(GNU_TARGET_NAME) \
134 --build=$(GNU_HOST_NAME) \
135 --program-prefix="" \
136 --program-suffix="" \
137 --prefix=/usr \
138 --exec-prefix=/usr \
139 --bindir=/usr/bin \
140 --datadir=/usr/share \
141 --includedir=/usr/include \
142 --infodir=/usr/share/info \
143 --libdir=/usr/lib/freeradius \
144 --libexecdir=/usr/lib/freeradius \
145 --localstatedir=/var \
146 --mandir=/usr/share/man \
147 --sbindir=/usr/sbin \
148 --sysconfdir=/etc \
149 $(DISABLE_LARGEFILE) \
150 $(DISABLE_NLS) \
151 $(PKG_CONFIGURE_OPTIONS) \
152 )
153 touch $@
154
155 $(PKG_BUILD_DIR)/.built:
156 rm -rf $(PKG_INSTALL_DIR)
157 mkdir -p $(PKG_INSTALL_DIR)
158 $(MAKE) -C $(PKG_BUILD_DIR) \
159 R="$(PKG_INSTALL_DIR)" \
160 INSTALLSTRIP="" \
161 all install
162 touch $@
163
164 $(IPKG_FREERADIUS):
165 install -m0755 -d $(IDIR_FREERADIUS)/etc/init.d
166 install -m0755 ./files/radiusd.init $(IDIR_FREERADIUS)/etc/init.d/radiusd
167 install -m0755 -d $(IDIR_FREERADIUS)/etc/freeradius
168 for f in clients.conf dictionary radiusd.conf; do \
169 cp -fpR $(PKG_INSTALL_DIR)/etc/freeradius/$${f} \
170 $(IDIR_FREERADIUS)/etc/freeradius/ ; \
171 done
172 install -m0755 -d $(IDIR_FREERADIUS)/usr/share/freeradius
173 cp -fpR $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary \
174 $(IDIR_FREERADIUS)/usr/share/freeradius/
175 for f in cisco freeradius microsoft tunnel wispr; do \
176 cp -fpR $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary.$${f} \
177 $(IDIR_FREERADIUS)/usr/share/freeradius/ ; \
178 done
179 install -m0755 -d $(IDIR_FREERADIUS)/usr/lib/freeradius
180 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/freeradius/libradius{,-*}.so \
181 $(IDIR_FREERADIUS)/usr/lib/freeradius/
182 install -m0755 -d $(IDIR_FREERADIUS)/usr/sbin
183 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/radiusd \
184 $(IDIR_FREERADIUS)/usr/sbin/
185 $(RSTRIP) $(IDIR_FREERADIUS)
186 $(IPKG_BUILD) $(IDIR_FREERADIUS) $(PACKAGE_DIR)
187
188 $(IPKG_FREERADIUS_DEMOCERTS):
189 install -m0755 -d $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius
190 cp -fpR $(PKG_INSTALL_DIR)/etc/freeradius/certs \
191 $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/
192 rm -rf $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/certs/README
193 rm -rf $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/certs/new*
194 rm -rf $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/certs/demoCA/index*
195 rm -rf $(IDIR_FREERADIUS_DEMOCERTS)/etc/freeradius/certs/demoCA/serial*
196 $(RSTRIP) $(IDIR_FREERADIUS_DEMOCERTS)
197 $(IPKG_BUILD) $(IDIR_FREERADIUS_DEMOCERTS) $(PACKAGE_DIR)
198
199 $(IPKG_FREERADIUS_UTILS):
200 install -m0755 -d $(IDIR_FREERADIUS_UTILS)/usr/bin
201 for f in radclient radeapclient; do \
202 cp -fpR $(PKG_INSTALL_DIR)/usr/bin/$${f} \
203 $(IDIR_FREERADIUS_UTILS)/usr/bin/ ; \
204 done
205 $(RSTRIP) $(IDIR_FREERADIUS_UTILS)
206 $(IPKG_BUILD) $(IDIR_FREERADIUS_UTILS) $(PACKAGE_DIR)
207
This page took 0.0585 seconds and 5 git commands to generate.