Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=hostapd
  10. PKG_VERSION:=0.5.8
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://hostap.epitest.fi/releases/
  14. PKG_MD5SUM:=40416b48cae9c78e5a2452caf214aff3
  15. PKG_BUILD_DEPENDS:= mac80211 madwifi
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/hostapd/Default
  18. SECTION:=net
  19. CATEGORY:=Network
  20. TITLE:=IEEE 802.1x Authenticator
  21. URL:=http://hostap.epitest.fi/
  22. DEPENDS:=@!TARGET_avr32 @!TARGET_etrax
  23. endef
  24. define Package/hostapd
  25. $(call Package/hostapd/Default)
  26. TITLE+= (full)
  27. DEPENDS+= +libopenssl
  28. endef
  29. define Package/hostapd/conffiles
  30. /etc/hostapd.conf
  31. endef
  32. define Package/hostapd/description
  33. This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
  34. Authenticator.
  35. endef
  36. define Package/hostapd-mini
  37. $(call Package/hostapd/Default)
  38. TITLE+= (WPA-PSK only)
  39. endef
  40. define Package/hostapd-mini/conffiles
  41. /etc/hostapd.conf
  42. endef
  43. define Package/hostapd-mini/description
  44. This package contains a minimal IEEE 802.1x/WPA/EAP/RADIUS Authenticator
  45. (WPA-PSK only).
  46. endef
  47. define Package/hostapd-utils
  48. $(call Package/hostapd/Default)
  49. TITLE+= (utils)
  50. DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
  51. endef
  52. define Package/hostapd-utils/description
  53. This package contains a command line utility to control the
  54. IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
  55. endef
  56. define Build/ConfigureTarget
  57. $(CP) $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)_$(1)
  58. $(CP) ./files/$(1).config $(PKG_BUILD_DIR)_$(1)/.config
  59. ifneq ($(CONFIG_PACKAGE_kmod-madwifi),)
  60. echo "CONFIG_DRIVER_MADWIFI=y" >> $(PKG_BUILD_DIR)_$(1)/.config
  61. endif
  62. ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
  63. echo "CONFIG_DRIVER_DEVICESCAPE=y" >> $(PKG_BUILD_DIR)_$(1)/.config
  64. endif
  65. endef
  66. define Build/CompileTarget
  67. $(MAKE) -C $(PKG_BUILD_DIR)_$(1) \
  68. $(TARGET_CONFIGURE_OPTS) \
  69. OPTFLAGS="$(TARGET_CFLAGS)" \
  70. CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/madwifi -I$(STAGING_DIR)/usr/include/mac80211" \
  71. LDFLAGS="$(TARGET_LDFLAGS)" \
  72. hostapd hostapd_cli
  73. $(CP) $(PKG_BUILD_DIR)_$(1)/hostapd_cli $(PKG_BUILD_DIR)/
  74. endef
  75. define Package/InstallTemplate
  76. if [ \! -f "$(PKG_BUILD_DIR)_$(2)/hostapd" ]; then \
  77. rm -f $(PKG_BUILD_DIR)/.built; \
  78. $(MAKE) $(PKG_BUILD_DIR)/.built; \
  79. fi
  80. $(INSTALL_DIR) $$(1)/lib/wifi
  81. $(INSTALL_DATA) ./files/hostapd.sh $$(1)/lib/wifi/hostapd.sh
  82. $(INSTALL_DIR) $$(1)/etc
  83. ifneq ($(CONFIG_PACKAGE_kmod-madwifi),)
  84. $(INSTALL_CONF) $(PKG_BUILD_DIR)_$(2)/madwifi.conf $$(1)/etc/hostapd.conf
  85. else
  86. $(INSTALL_CONF) $(PKG_BUILD_DIR)_$(2)/hostapd.conf $$(1)/etc/hostapd.conf
  87. endif
  88. $(INSTALL_DIR) $$(1)/usr/sbin
  89. $(INSTALL_BIN) $(PKG_BUILD_DIR)_$(2)/hostapd $$(1)/usr/sbin/
  90. endef
  91. define Package/Template
  92. ifneq ($(CONFIG_PACKAGE_$(1)),)
  93. define Build/Configure/$(2)
  94. $(call Build/ConfigureTarget,$(2))
  95. endef
  96. define Build/Compile/$(2)
  97. $(call Build/CompileTarget,$(2))
  98. endef
  99. define Package/$(1)/install
  100. $(call Package/InstallTemplate,$(1),$(2))
  101. endef
  102. endif
  103. endef
  104. define Build/Configure
  105. $(call Build/Configure/default)
  106. $(call Build/Configure/mini)
  107. endef
  108. define Build/Compile
  109. $(call Build/Compile/default)
  110. $(call Build/Compile/mini)
  111. endef
  112. define Build/Clean
  113. rm -rf $(PKG_BUILD_DIR)_default
  114. rm -rf $(PKG_BUILD_DIR)_mini
  115. endef
  116. define Package/hostapd-utils/install
  117. $(INSTALL_DIR) $(1)/usr/sbin
  118. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd_cli $(1)/usr/sbin/
  119. endef
  120. $(eval $(call Package/Template,hostapd,default))
  121. $(eval $(call Package/Template,hostapd-mini,mini))
  122. $(eval $(call BuildPackage,hostapd))
  123. $(eval $(call BuildPackage,hostapd-mini))
  124. $(eval $(call BuildPackage,hostapd-utils))