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