strip the kernel version suffix from target directories, except for brcm-2.4 (the...
[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_VERSION:=0.5.8
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://hostap.epitest.fi/releases/
17 PKG_MD5SUM:=40416b48cae9c78e5a2452caf214aff3
18
19 PKG_BUILD_DEPENDS:=
20
21 ifeq ($(shell grep "CONFIG_PACKAGE_kmod-madwifi is not set" $(TOPDIR)/.config),)
22 PKG_BUILD_DEPENDS+=madwifi
23 endif
24 ifeq ($(shell grep "CONFIG_PACKAGE_kmod-mac80211 is not set" $(TOPDIR)/.config),)
25 PKG_BUILD_DEPENDS+=mac80211
26 endif
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/hostapd/Default
31 SECTION:=net
32 CATEGORY:=Network
33 TITLE:=IEEE 802.1x Authenticator
34 URL:=http://hostap.epitest.fi/
35 endef
36
37 define Package/hostapd
38 $(call Package/hostapd/Default)
39 DEPENDS:=+libopenssl @!TARGET_AVR32 @!TARGET_ETRAX
40 TITLE+= (full)
41 DESCRIPTION:=\
42 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS \\\
43 Authenticator.
44 endef
45
46 define Package/hostapd/conffiles
47 /etc/hostapd.conf
48 endef
49
50 define Package/hostapd-mini
51 $(call Package/hostapd/Default)
52 DEPENDS:=@!TARGET_AVR32 @!TARGET_ETRAX
53 TITLE+= (WPA-PSK only)
54 DESCRIPTION:=\
55 This package contains a minimal IEEE 802.1x/WPA/EAP/RADIUS Authenticator \\\
56 (WPA-PSK only).
57 endef
58
59 define Package/hostapd-mini/conffiles
60 /etc/hostapd.conf
61 endef
62
63 define Package/hostapd-utils
64 $(call Package/hostapd/Default)
65 DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
66 TITLE+= (utils)
67 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 $(CP) $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)_$(1)
74 $(CP) ./files/$(1).config $(PKG_BUILD_DIR)_$(1)/.config
75 ifneq ($(CONFIG_PACKAGE_kmod-madwifi),)
76 echo "CONFIG_DRIVER_MADWIFI=y" >> $(PKG_BUILD_DIR)_$(1)/.config
77 endif
78 ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
79 echo "CONFIG_DRIVER_DEVICESCAPE=y" >> $(PKG_BUILD_DIR)_$(1)/.config
80 endif
81 endef
82
83 define Build/CompileTarget
84 $(MAKE) -C $(PKG_BUILD_DIR)_$(1) \
85 $(TARGET_CONFIGURE_OPTS) \
86 OPTFLAGS="$(TARGET_CFLAGS)" \
87 CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/madwifi -I$(STAGING_DIR)/usr/include/mac80211" \
88 LDFLAGS="$(TARGET_LDFLAGS)" \
89 hostapd hostapd_cli
90 $(CP) $(PKG_BUILD_DIR)_$(1)/hostapd_cli $(PKG_BUILD_DIR)/
91 endef
92
93 define Package/InstallTemplate
94 if [ \! -f "$(PKG_BUILD_DIR)_$(2)/hostapd" ]; then \
95 rm -f $(PKG_BUILD_DIR)/.built; \
96 $(MAKE) $(PKG_BUILD_DIR)/.built; \
97 fi
98 $(INSTALL_DIR) $$(1)/lib/wifi
99 $(INSTALL_DATA) ./files/hostapd.sh $$(1)/lib/wifi/hostapd.sh
100 $(INSTALL_DIR) $$(1)/etc
101 ifneq ($(CONFIG_PACKAGE_kmod-madwifi),)
102 $(INSTALL_CONF) $(PKG_BUILD_DIR)_$(2)/madwifi.conf $$(1)/etc/hostapd.conf
103 else
104 $(INSTALL_CONF) $(PKG_BUILD_DIR)_$(2)/hostapd.conf $$(1)/etc/hostapd.conf
105 endif
106 $(INSTALL_DIR) $$(1)/usr/sbin
107 $(INSTALL_BIN) $(PKG_BUILD_DIR)_$(2)/hostapd $$(1)/usr/sbin/
108 endef
109
110 define Package/Template
111 ifneq ($(CONFIG_PACKAGE_$(1)),)
112 define Build/Configure/$(2)
113 $(call Build/ConfigureTarget,$(2))
114 endef
115 define Build/Compile/$(2)
116 $(call Build/CompileTarget,$(2))
117 endef
118 define Package/$(1)/install
119 $(call Package/InstallTemplate,$(1),$(2))
120 endef
121 endif
122 endef
123
124 define Build/Configure
125 $(call Build/Configure/default)
126 $(call Build/Configure/mini)
127 endef
128
129 define Build/Compile
130 $(call Build/Compile/default)
131 $(call Build/Compile/mini)
132 endef
133
134 define Build/Clean
135 rm -rf $(PKG_BUILD_DIR)_default
136 rm -rf $(PKG_BUILD_DIR)_mini
137 endef
138
139 define Package/hostapd-utils/install
140 $(INSTALL_DIR) $(1)/usr/sbin
141 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd_cli $(1)/usr/sbin/
142 endef
143
144 $(eval $(call Package/Template,hostapd,default))
145 $(eval $(call Package/Template,hostapd-mini,mini))
146
147 $(eval $(call BuildPackage,hostapd))
148 $(eval $(call BuildPackage,hostapd-mini))
149 $(eval $(call BuildPackage,hostapd-utils))
This page took 0.05964 seconds and 5 git commands to generate.