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