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