b7a7d5e11019af193e8ac49207cf37c369f80679
[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.7
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:=d5113247dc6ee17106e6bc7cb89aa507
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21
22 PKG_BUILD_DEPENDS:=madwifi
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/hostapd/Default
27 SECTION:=net
28 CATEGORY:=Network
29 TITLE:=IEEE 802.1x Authenticator
30 URL:=http://hostap.epitest.fi/
31 endef
32
33 define Package/hostapd
34 $(call Package/hostapd/Default)
35 DEPENDS:=+libopenssl
36 TITLE+= (full)
37 DESCRIPTION:=\
38 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS \\\
39 Authenticator.
40 endef
41
42 define Package/hostapd/conffiles
43 /etc/hostapd.conf
44 endef
45
46 define Package/hostapd-mini
47 $(call Package/hostapd/Default)
48 TITLE+= (WPA-PSK only)
49 DESCRIPTION:=\
50 This package contains a minimal IEEE 802.1x/WPA/EAP/RADIUS Authenticator \\\
51 (WPA-PSK only).
52 endef
53
54 define Package/hostapd-mini/conffiles
55 /etc/hostapd.conf
56 endef
57
58 define Package/hostapd-utils
59 $(call Package/hostapd/Default)
60 DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
61 TITLE+= (utils)
62 DESCRIPTION:=\
63 This package contains a command line utility to control the \\\
64 IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
65 endef
66
67 define Build/ConfigureTarget
68 $(CP) $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)_$(1)
69 $(CP) ./files/$(1).config $(PKG_BUILD_DIR)_$(1)/.config
70 endef
71
72 define Build/CompileTarget
73 $(MAKE) -C $(PKG_BUILD_DIR)_$(1) \
74 $(TARGET_CONFIGURE_OPTS) \
75 OPTFLAGS="$(TARGET_CFLAGS)" \
76 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include/madwifi" \
77 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
78 hostapd hostapd_cli
79 $(CP) $(PKG_BUILD_DIR)_$(1)/hostapd_cli $(PKG_BUILD_DIR)/
80 endef
81
82 define Package/InstallTemplate
83 if [ \! -f "$(PKG_BUILD_DIR)_$(2)/hostapd" ]; then \
84 rm -f $(PKG_BUILD_DIR)/.built; \
85 $(MAKE) $(PKG_BUILD_DIR)/.built; \
86 fi
87 $(INSTALL_DIR) $$(1)/etc
88 $(INSTALL_CONF) $(PKG_BUILD_DIR)_$(2)/madwifi.conf $$(1)/etc/hostapd.conf
89 $(INSTALL_DIR) $$(1)/usr/sbin
90 $(INSTALL_BIN) $(PKG_BUILD_DIR)_$(2)/hostapd $$(1)/usr/sbin/
91 endef
92
93 define Package/Template
94 ifneq ($(CONFIG_PACKAGE_$(1)),)
95 define Build/Configure/$(2)
96 $(call Build/ConfigureTarget,$(2))
97 endef
98 define Build/Compile/$(2)
99 $(call Build/CompileTarget,$(2))
100 endef
101 define Package/$(1)/install
102 $(call Package/InstallTemplate,$(1),$(2))
103 endef
104 endif
105 endef
106
107 define Build/Configure
108 $(call Build/Configure/default)
109 $(call Build/Configure/mini)
110 endef
111
112 define Build/Compile
113 $(call Build/Compile/default)
114 $(call Build/Compile/mini)
115 endef
116
117 define Build/Clean
118 rm -rf $(PKG_BUILD_DIR)_default
119 rm -rf $(PKG_BUILD_DIR)_mini
120 endef
121
122 define Package/hostapd-utils/install
123 $(INSTALL_DIR) $(1)/usr/sbin
124 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd_cli $(1)/usr/sbin/
125 endef
126
127 $(eval $(call Package/Template,hostapd,default))
128 $(eval $(call Package/Template,hostapd-mini,mini))
129
130 $(eval $(call BuildPackage,hostapd))
131 $(eval $(call BuildPackage,hostapd-mini))
132 $(eval $(call BuildPackage,hostapd-utils))
This page took 0.04233 seconds and 3 git commands to generate.