use the static version of libnl for hostapd
[openwrt.git] / package / hostapd / Makefile
1 #
2 # Copyright (C) 2006 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
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=hostapd
12 PKG_REV:=03ec0ec5cdb974d51a4a2a566bea4c4568138576
13 PKG_VERSION:=20071107_$(PKG_REV)
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
18 PKG_SOURCE_SUBDIR:=hostapd-$(PKG_VERSION)
19 PKG_SOURCE_VERSION:=$(PKG_REV)
20 PKG_BUILD_DEPENDS:=madwifi mac80211
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/hostapd/Default
25 SECTION:=net
26 CATEGORY:=Network
27 TITLE:=IEEE 802.1x Authenticator
28 URL:=http://hostap.epitest.fi/
29 DEPENDS:=@!TARGET_avr32 @!TARGET_etrax $(if $(DUMP)$(CONFIG_LINUX_2_6_23),+libnl)
30 endef
31
32 define Package/hostapd
33 $(call Package/hostapd/Default)
34 TITLE+= (full)
35 DEPENDS+= +libopenssl
36 endef
37
38 #define Package/hostapd/conffiles
39 #/etc/hostapd.conf
40 #endef
41
42 define Package/hostapd/description
43 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
44 Authenticator.
45 endef
46
47 define Package/hostapd-mini
48 $(call Package/hostapd/Default)
49 TITLE+= (WPA-PSK only)
50 endef
51
52 #define Package/hostapd-mini/conffiles
53 #/etc/hostapd.conf
54 #endef
55
56 define Package/hostapd-mini/description
57 This package contains a minimal IEEE 802.1x/WPA/EAP/RADIUS Authenticator
58 (WPA-PSK only).
59 endef
60
61 define Package/hostapd-utils
62 $(call Package/hostapd/Default)
63 TITLE+= (utils)
64 DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
65 endef
66
67 define Package/hostapd-utils/description
68 This package contains a command line utility to control the
69 IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
70 endef
71
72 define Build/ConfigureTarget
73 rm -rf $(PKG_BUILD_DIR)/hostapd.$(1)
74 $(CP) $(PKG_BUILD_DIR)/hostapd $(PKG_BUILD_DIR)/hostapd.$(1)
75 $(CP) ./files/$(1).config $(PKG_BUILD_DIR)/hostapd.$(1)/.config
76 [ -d $(STAGING_DIR)/usr/include/mac80211 ] || $(SED) 's,^CONFIG_DRIVER_DEVICESCAPE,#CONFIG_DRIVER_DEVICESCAPE,g' $(PKG_BUILD_DIR)/hostapd.$(1)/.config
77 [ -d $(STAGING_DIR)/usr/include/madwifi ] || $(SED) 's,^CONFIG_DRIVER_MADWIFI,#CONFIG_DRIVER_MADWIFI,g' $(PKG_BUILD_DIR)/hostapd.$(1)/.config
78 endef
79
80 define Build/CompileTarget
81 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/madwifi -I$(STAGING_DIR)/usr/include/mac80211 -I$(STAGING_DIR)/usr/include" \
82 $(MAKE) -C $(PKG_BUILD_DIR)/hostapd.$(1) \
83 $(TARGET_CONFIGURE_OPTS) \
84 LIBS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib \
85 $(if $(wildcard $(STAGING_DIR)/usr/include/mac80211/*),-lm $(STAGING_DIR)/usr/lib/libnl.a)" \
86 hostapd hostapd_cli
87 $(CP) $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd_cli $(PKG_BUILD_DIR)/
88 endef
89
90 define Package/InstallTemplate
91 $(INSTALL_DIR) $$(1)/lib/wifi
92 $(INSTALL_DATA) ./files/hostapd.sh $$(1)/lib/wifi/hostapd.sh
93 # config is managed through uci
94 # $(INSTALL_DIR) $$(1)/etc
95 # $(INSTALL_CONF) $(PKG_BUILD_DIR)/hostapd.$(2)/hostapd.conf $$(1)/etc/hostapd.conf
96 $(INSTALL_DIR) $$(1)/usr/sbin
97 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd.$(2)/hostapd $$(1)/usr/sbin/
98 endef
99
100 define Package/Template
101 ifneq ($(CONFIG_PACKAGE_$(1)),)
102 define Build/Configure/$(2)
103 $(call Build/ConfigureTarget,$(2))
104 endef
105 define Build/Compile/$(2)
106 $(call Build/CompileTarget,$(2))
107 endef
108 define Package/$(1)/install
109 $(call Package/InstallTemplate,$(1),$(2))
110 endef
111 endif
112 endef
113
114 define Build/Configure
115 $(call Build/Configure/default)
116 $(call Build/Configure/mini)
117 endef
118
119 define Build/Compile
120 $(call Build/Compile/default)
121 $(call Build/Compile/mini)
122 endef
123
124 define Build/Clean
125 rm -rf $(PKG_BUILD_DIR)_default
126 rm -rf $(PKG_BUILD_DIR)_mini
127 endef
128
129 define Package/hostapd-utils/install
130 $(INSTALL_DIR) $(1)/usr/sbin
131 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd_cli $(1)/usr/sbin/
132 endef
133
134 $(eval $(call Package/Template,hostapd,default))
135 $(eval $(call Package/Template,hostapd-mini,mini))
136
137 $(eval $(call BuildPackage,hostapd))
138 $(eval $(call BuildPackage,hostapd-mini))
139 $(eval $(call BuildPackage,hostapd-utils))
This page took 0.046492 seconds and 5 git commands to generate.