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