move package description to a separate definition, remove it when DESCRIPTION=TITLE
[openwrt/svn-archive/archive.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 endef
42
43 define Package/hostapd/conffiles
44 /etc/hostapd.conf
45 endef
46
47 define Package/hostapd/description
48 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
49 Authenticator.
50 endef
51
52 define Package/hostapd-mini
53 $(call Package/hostapd/Default)
54 DEPENDS:=@!TARGET_AVR32 @!TARGET_ETRAX
55 TITLE+= (WPA-PSK only)
56 endef
57
58 define Package/hostapd-mini/conffiles
59 /etc/hostapd.conf
60 endef
61
62 define Package/hostapd-mini/description
63 This package contains a minimal IEEE 802.1x/WPA/EAP/RADIUS Authenticator
64 (WPA-PSK only).
65 endef
66
67 define Package/hostapd-utils
68 $(call Package/hostapd/Default)
69 DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
70 TITLE+= (utils)
71 endef
72
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.
76 endef
77
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
83 endif
84 ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
85 echo "CONFIG_DRIVER_DEVICESCAPE=y" >> $(PKG_BUILD_DIR)_$(1)/.config
86 endif
87 endef
88
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)" \
95 hostapd hostapd_cli
96 $(CP) $(PKG_BUILD_DIR)_$(1)/hostapd_cli $(PKG_BUILD_DIR)/
97 endef
98
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; \
103 fi
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
109 else
110 $(INSTALL_CONF) $(PKG_BUILD_DIR)_$(2)/hostapd.conf $$(1)/etc/hostapd.conf
111 endif
112 $(INSTALL_DIR) $$(1)/usr/sbin
113 $(INSTALL_BIN) $(PKG_BUILD_DIR)_$(2)/hostapd $$(1)/usr/sbin/
114 endef
115
116 define Package/Template
117 ifneq ($(CONFIG_PACKAGE_$(1)),)
118 define Build/Configure/$(2)
119 $(call Build/ConfigureTarget,$(2))
120 endef
121 define Build/Compile/$(2)
122 $(call Build/CompileTarget,$(2))
123 endef
124 define Package/$(1)/install
125 $(call Package/InstallTemplate,$(1),$(2))
126 endef
127 endif
128 endef
129
130 define Build/Configure
131 $(call Build/Configure/default)
132 $(call Build/Configure/mini)
133 endef
134
135 define Build/Compile
136 $(call Build/Compile/default)
137 $(call Build/Compile/mini)
138 endef
139
140 define Build/Clean
141 rm -rf $(PKG_BUILD_DIR)_default
142 rm -rf $(PKG_BUILD_DIR)_mini
143 endef
144
145 define Package/hostapd-utils/install
146 $(INSTALL_DIR) $(1)/usr/sbin
147 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd_cli $(1)/usr/sbin/
148 endef
149
150 $(eval $(call Package/Template,hostapd,default))
151 $(eval $(call Package/Template,hostapd-mini,mini))
152
153 $(eval $(call BuildPackage,hostapd))
154 $(eval $(call BuildPackage,hostapd-mini))
155 $(eval $(call BuildPackage,hostapd-utils))