[PATCH] Add support for CM109 USB VoIP phone
[openwrt.git] / package / hostapd / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=hostapd
11 PKG_VERSION:=0.6.9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://hostap.epitest.fi/releases/
16 PKG_SOURCE_SUBDIR:=hostapd-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=$(PKG_REV)
18 PKG_MD5SUM:=83630d11fa66ade9091f1b304fccd74c
19 PKG_BUILD_DEPENDS:=PACKAGE_kmod-madwifi:madwifi PACKAGE_kmod-mac80211:mac80211 PACKAGE_kmod-mac80211:libnl
20
21 include $(INCLUDE_DIR)/package.mk
22
23 PKG_CONFDEPS := \
24 CONFIG_PACKAGE_kmod-ath9k \
25 CONFIG_PACKAGE_kmod-mac80211 \
26 CONFIG_PACKAGE_kmod-madwifi \
27 CONFIG_PACKAGE_hostapd \
28 CONFIG_PACKAGE_hostapd-mini
29
30 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,$(PKG_CONFDEPS))
31
32 DRIVER_MAKEOPTS= \
33 CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-mac80211) \
34 CONFIG_DRIVER_MADWIFI=$(CONFIG_PACKAGE_kmod-madwifi) \
35 CONFIG_IEEE80211N=$(CONFIG_PACKAGE_kmod-ath9k)
36
37 define Package/hostapd/Default
38 SECTION:=net
39 CATEGORY:=Network
40 TITLE:=IEEE 802.1x Authenticator
41 URL:=http://hostap.epitest.fi/
42 DEPENDS:=@!TARGET_avr32 @!TARGET_etrax
43 endef
44
45 define Package/hostapd
46 $(call Package/hostapd/Default)
47 TITLE+= (full)
48 DEPENDS+= +PACKAGE_hostapd:libopenssl
49 endef
50
51 #define Package/hostapd/conffiles
52 #/etc/hostapd.conf
53 #endef
54
55 define Package/hostapd/description
56 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
57 Authenticator.
58 endef
59
60 define Package/hostapd-mini
61 $(call Package/hostapd/Default)
62 TITLE+= (WPA-PSK only)
63 endef
64
65 #define Package/hostapd-mini/conffiles
66 #/etc/hostapd.conf
67 #endef
68
69 define Package/hostapd-mini/description
70 This package contains a minimal IEEE 802.1x/WPA/EAP/RADIUS Authenticator
71 (WPA-PSK only).
72 endef
73
74 define Package/hostapd-utils
75 $(call Package/hostapd/Default)
76 TITLE+= (utils)
77 DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
78 endef
79
80 define Package/hostapd-utils/description
81 This package contains a command line utility to control the
82 IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
83 endef
84
85 define Build/ConfigureTarget
86 rm -rf $(PKG_BUILD_DIR)/hostapd.$(1)
87 mkdir -p $(PKG_BUILD_DIR)/hostapd.$(1)
88 $(CP) \
89 $(PKG_BUILD_DIR)/hostapd \
90 $(PKG_BUILD_DIR)/src \
91 $(PKG_BUILD_DIR)/hostapd.$(1)/
92 $(CP) ./files/$(1).config $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/.config
93 endef
94
95 define Build/CompileTarget
96 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/madwifi -I$(STAGING_DIR)/usr/include/mac80211 -I$(STAGING_DIR)/usr/include/libnl $(TARGET_CPPFLAGS)" \
97 $(MAKE) -C $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd \
98 $(TARGET_CONFIGURE_OPTS) \
99 $(DRIVER_MAKEOPTS) \
100 LIBS="$(TARGET_LDFLAGS) \
101 $(if $(CONFIG_PACKAGE_kmod-mac80211),-lm $(STAGING_DIR)/usr/lib/libnl.a) \
102 $(if $(findstring default,$(1)),-lssl -lcrypto)" \
103 hostapd hostapd_cli
104 $(CP) $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/hostapd_cli $(PKG_BUILD_DIR)/
105 endef
106
107 define Package/InstallTemplate
108 $(INSTALL_DIR) $$(1)/lib/wifi
109 $(INSTALL_DATA) ./files/hostapd.sh $$(1)/lib/wifi/hostapd.sh
110 $(INSTALL_DIR) $$(1)/usr/sbin
111 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd.$(2)/hostapd/hostapd $$(1)/usr/sbin/
112 # config is managed through uci
113 # $(INSTALL_DIR) $$(1)/etc
114 # $(INSTALL_CONF) $(PKG_BUILD_DIR)/hostapd.$(2)/hostapd/hostapd.conf $$(1)/etc/hostapd.conf
115 endef
116
117 define Package/Template
118 ifneq ($(CONFIG_PACKAGE_$(1)),)
119 define Build/Configure/$(2)
120 $(call Build/ConfigureTarget,$(2))
121 endef
122 define Build/Compile/$(2)
123 $(call Build/CompileTarget,$(2))
124 endef
125 define Package/$(1)/install
126 $(call Package/InstallTemplate,$(1),$(2))
127 endef
128 endif
129 endef
130
131 define Build/Configure
132 rm -f $(PKG_BUILD_DIR)/.configured*
133 $(call Build/Configure/default)
134 $(call Build/Configure/mini)
135 endef
136
137 define Build/Compile
138 $(call Build/Compile/default)
139 $(call Build/Compile/mini)
140 endef
141
142 define Build/Clean
143 rm -rf $(PKG_BUILD_DIR)_default
144 rm -rf $(PKG_BUILD_DIR)_mini
145 endef
146
147 define Package/hostapd-utils/install
148 $(INSTALL_DIR) $(1)/usr/sbin
149 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd_cli $(1)/usr/sbin/
150 endef
151
152 $(eval $(call Package/Template,hostapd,default))
153 $(eval $(call Package/Template,hostapd-mini,mini))
154
155 $(eval $(call BuildPackage,hostapd))
156 $(eval $(call BuildPackage,hostapd-mini))
157 $(eval $(call BuildPackage,hostapd-utils))
This page took 0.063519 seconds and 5 git commands to generate.