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