You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
4.6 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=hs20
  3. PKG_RELEASE:=$(AUTORELEASE)
  4. PKG_SOURCE_URL:=http://w1.fi/hostap.git
  5. PKG_SOURCE_PROTO:=git
  6. PKG_SOURCE_DATE:=2020-06-08
  7. PKG_SOURCE_VERSION:=5a8b366233f5585e68a4ffbb604fbb4a848eb325
  8. PKG_SOURCE_NAME:=hostapd
  9. PKG_MIRROR_HASH:=1b2a4947034142587a3f81eac2ea27dd64650e77f8943d973623b47533be2393
  10. PKG_MIRROR_VERSION:=$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))
  11. PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_MIRROR_VERSION).tar.xz
  12. PKG_SOURCE_SUBDIR:=$(PKG_SOURCE_NAME)-$(PKG_MIRROR_VERSION)
  13. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_SOURCE_NAME)-$(PKG_MIRROR_VERSION)
  14. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  15. PKG_LICENSE:=BSD-3-Clause
  16. PKG_CPE_ID:=cpe:/a:w1.fi:hostapd
  17. define Download/dm-ddf-dtd
  18. URL:=http://www.openmobilealliance.org/tech/DTD
  19. FILE:=dm_ddf-v1_3.dtd
  20. HASH:=9b3e1dc66a2d38fc6e1300e9fb6f06f95d042206dabc94ae989739feaeb0733e
  21. endef
  22. define Download/spp-xsd
  23. URL:=https://raw.githubusercontent.com/greearb/hostap-ct/7a7b81d0e58c81796c7408a47082c9cc7587aa21/hs20/server/examples/Fedora20/hs20/spp
  24. URL_FILE:=spp.xsd
  25. FILE:=spp-v1_0.xsd
  26. HASH:=83be16db72e96cca8d654d7f0b446cdd017090d5512a4cd5f7172204331fd8f2
  27. endef
  28. PKG_BUILD_PARALLEL:=1
  29. PKG_ASLR_PIE_REGULAR:=1
  30. ifdef CONFIG_USE_GLIBC
  31. TARGET_LDFLAGS += -lrt
  32. TARGET_LDFLAGS_C += -lrt
  33. endif
  34. include $(INCLUDE_DIR)/package.mk
  35. include $(INCLUDE_DIR)/nls.mk
  36. define Package/hs20-common
  37. SECTION:=net
  38. CATEGORY:=Network
  39. SUBMENU:=WirelessAPD
  40. TITLE:=Hotspot 2.0 OSU common files
  41. URL:=http://hostap.epitest.fi/
  42. endef
  43. define Package/hs20-common/description
  44. Hotspot 2.0 OSU common files
  45. Hotspot 2.0 SPP and OMA DM XML schema/DTD files
  46. endef
  47. define Package/hs20-client
  48. SECTION:=net
  49. CATEGORY:=Network
  50. SUBMENU:=WirelessAPD
  51. TITLE:=Hotspot 2.0 OSU client
  52. URL:=http://hostap.epitest.fi/
  53. DEPENDS:=+hs20-common +libopenssl +libcurl +libxml2
  54. endef
  55. define Package/hs20-client/description
  56. Hotspot 2.0 OSU client
  57. endef
  58. define Package/hs20-server
  59. SECTION:=net
  60. CATEGORY:=Network
  61. SUBMENU:=WirelessAPD
  62. TITLE:=Hotspot 2.0 OSU server
  63. URL:=http://hostap.epitest.fi/
  64. DEPENDS:=+hs20-common +libopenssl +libsqlite3 +libxml2 +php8 +php8-cgi +php8-mod-xml +php8-mod-pdo-sqlite +openssl-util +sqlite3-cli +uhttpd +xxd
  65. endef
  66. define Package/hs20-server/description
  67. Hotspot 2.0 OSU server
  68. This implementation and the example configuration is meant only for
  69. testing purposes in a lab environment. This design is not secure to be
  70. installed in a publicly available Internet server without considerable
  71. amount of modification and review for security issues.
  72. endef
  73. define Build/Prepare
  74. $(call Build/Prepare/Default)
  75. $(eval $(call Download,dm-ddf-dtd))
  76. $(eval $(call Download,spp-xsd))
  77. endef
  78. define Build/Configure
  79. $(CP) ./files/hostapd.config $(PKG_BUILD_DIR)/hostapd/.config
  80. endef
  81. define Build/RunMake
  82. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  83. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
  84. $(TARGET_CONFIGURE_OPTS) \
  85. LIBS="$(TARGET_LDFLAGS) $(2)" \
  86. LIBS_c="$(TARGET_LDFLAGS_C)" \
  87. AR="$(TARGET_CROSS)gcc-ar" \
  88. BCHECK= CONFIG_NO_BROWSER=y \
  89. $(3)
  90. endef
  91. define Build/Compile
  92. $(call Build/RunMake,hostapd,-lssl -lcrypto -lsqlite3,hostapd hlr_auc_gw)
  93. $(call Build/RunMake,hs20/server,-lsqlite3 -lxml2,all)
  94. $(call Build/RunMake,hs20/client,-lssl -lcrypto -lcurl -lxml2,all)
  95. endef
  96. define Package/hs20-common/install
  97. $(INSTALL_DIR) $(1)/etc/hs20/spp
  98. $(INSTALL_DATA) $(DL_DIR)/dm_ddf-v1_3.dtd $(1)/etc/hs20/spp
  99. $(INSTALL_DATA) $(DL_DIR)/spp-v1_0.xsd $(1)/etc/hs20/spp/spp.xsd
  100. endef
  101. define Package/hs20-client/install
  102. $(INSTALL_DIR) $(1)/usr/sbin
  103. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hs20/client/hs20-osu-client $(1)/usr/sbin/
  104. endef
  105. define Package/hs20-server/install
  106. $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hs20/ca $(1)/www/hs20 $(1)/etc/uci-defaults $(1)/etc/hs20/spp $(1)/etc/config $(1)/etc/init.d
  107. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/hostapd-hs20-radius-server
  108. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hlr_auc_gw $(1)/usr/sbin/
  109. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hs20/server/hs20_spp_server $(1)/usr/sbin/
  110. $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/www/* $(1)/www/hs20
  111. $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/sql.txt $(1)/usr/share/hs20
  112. $(CP) $(PKG_BUILD_DIR)/hs20/server/ca/* $(1)/usr/share/hs20/ca
  113. $(INSTALL_BIN) ./files/hs20-server.defaults $(1)/etc/uci-defaults/hs20-server
  114. $(INSTALL_CONF) ./files/hs20.config $(1)/etc/config/hs20
  115. $(INSTALL_BIN) ./files/hs20.init $(1)/etc/init.d/hs20
  116. endef
  117. define Package/hs20-server/conffiles
  118. /etc/config/hs20
  119. endef
  120. $(eval $(call BuildPackage,hs20-common))
  121. $(eval $(call BuildPackage,hs20-client))
  122. $(eval $(call BuildPackage,hs20-server))