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.

143 lines
4.4 KiB

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