2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=http
://hostap.epitest.fi
/releases
/
17 PKG_MD5SUM
:=40416b48cae9c78e5a2452caf214aff3
21 ifeq ($(shell grep
"CONFIG_PACKAGE_kmod-madwifi is not set" $(TOPDIR
)/.config
),)
22 PKG_BUILD_DEPENDS
+=madwifi
24 ifeq ($(shell grep
"CONFIG_PACKAGE_kmod-mac80211 is not set" $(TOPDIR
)/.config
),)
25 PKG_BUILD_DEPENDS
+=mac80211
28 include $(INCLUDE_DIR
)/package.mk
30 define Package
/hostapd
/Default
33 TITLE
:=IEEE
802.1x Authenticator
34 URL
:=http
://hostap.epitest.fi
/
37 define Package
/hostapd
38 $(call Package
/hostapd
/Default
)
39 DEPENDS
:=+libopenssl @
!TARGET_avr32 @
!TARGET_etrax
43 define Package
/hostapd
/conffiles
47 define Package
/hostapd
/description
48 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
52 define Package
/hostapd-mini
53 $(call Package
/hostapd
/Default
)
54 DEPENDS
:=@
!TARGET_AVR32 @
!TARGET_ETRAX
55 TITLE
+= (WPA-PSK only
)
58 define Package
/hostapd-mini
/conffiles
62 define Package
/hostapd-mini
/description
63 This package contains a minimal IEEE
802.1x
/WPA
/EAP
/RADIUS Authenticator
67 define Package
/hostapd-utils
68 $(call Package
/hostapd
/Default
)
69 DEPENDS
:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
73 define Package
/hostapd-utils
/description
74 This package contains a command line utility to control the
75 IEEE
802.1x
/WPA
/EAP
/RADIUS Authenticator.
78 define Build
/ConfigureTarget
79 $(CP
) $(PKG_BUILD_DIR
) $(PKG_BUILD_DIR
)_
$(1)
80 $(CP
) .
/files
/$(1).config
$(PKG_BUILD_DIR
)_
$(1)/.config
81 ifneq ($(CONFIG_PACKAGE_kmod-madwifi
),)
82 echo
"CONFIG_DRIVER_MADWIFI=y" >> $(PKG_BUILD_DIR
)_
$(1)/.config
84 ifneq ($(CONFIG_PACKAGE_kmod-mac80211
),)
85 echo
"CONFIG_DRIVER_DEVICESCAPE=y" >> $(PKG_BUILD_DIR
)_
$(1)/.config
89 define Build
/CompileTarget
90 $(MAKE
) -C
$(PKG_BUILD_DIR
)_
$(1) \
91 $(TARGET_CONFIGURE_OPTS
) \
92 OPTFLAGS
="$(TARGET_CFLAGS)" \
93 CPPFLAGS
="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/madwifi -I$(STAGING_DIR)/usr/include/mac80211" \
94 LDFLAGS
="$(TARGET_LDFLAGS)" \
96 $(CP
) $(PKG_BUILD_DIR
)_
$(1)/hostapd_cli
$(PKG_BUILD_DIR
)/
99 define Package
/InstallTemplate
100 if
[ \
! -f
"$(PKG_BUILD_DIR)_$(2)/hostapd" ]; then \
101 rm -f
$(PKG_BUILD_DIR
)/.built
; \
102 $(MAKE
) $(PKG_BUILD_DIR
)/.built
; \
104 $(INSTALL_DIR
) $$(1)/lib
/wifi
105 $(INSTALL_DATA
) .
/files
/hostapd.sh
$$(1)/lib
/wifi
/hostapd.sh
106 $(INSTALL_DIR
) $$(1)/etc
107 ifneq ($(CONFIG_PACKAGE_kmod-madwifi
),)
108 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)_
$(2)/madwifi.conf
$$(1)/etc
/hostapd.conf
110 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)_
$(2)/hostapd.conf
$$(1)/etc
/hostapd.conf
112 $(INSTALL_DIR
) $$(1)/usr
/sbin
113 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)_
$(2)/hostapd
$$(1)/usr
/sbin
/
116 define Package
/Template
117 ifneq ($(CONFIG_PACKAGE_
$(1)),)
118 define Build
/Configure
/$(2)
119 $(call Build
/ConfigureTarget
,$(2))
121 define Build
/Compile
/$(2)
122 $(call Build
/CompileTarget
,$(2))
124 define Package
/$(1)/install
125 $(call Package
/InstallTemplate
,$(1),$(2))
130 define Build
/Configure
131 $(call Build
/Configure
/default
)
132 $(call Build
/Configure
/mini
)
136 $(call Build
/Compile
/default
)
137 $(call Build
/Compile
/mini
)
141 rm -rf
$(PKG_BUILD_DIR
)_default
142 rm -rf
$(PKG_BUILD_DIR
)_mini
145 define Package
/hostapd-utils
/install
146 $(INSTALL_DIR
) $(1)/usr
/sbin
147 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd_cli
$(1)/usr
/sbin
/
150 $(eval
$(call Package
/Template
,hostapd
,default
))
151 $(eval
$(call Package
/Template
,hostapd-mini
,mini
))
153 $(eval
$(call BuildPackage
,hostapd
))
154 $(eval
$(call BuildPackage
,hostapd-mini
))
155 $(eval
$(call BuildPackage
,hostapd-utils
))