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.

144 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. include $(INCLUDE_DIR)/nls.mk
  35. define Package/hs20-common
  36. SECTION:=net
  37. CATEGORY:=Network
  38. SUBMENU:=WirelessAPD
  39. TITLE:=Hotspot 2.0 OSU common files
  40. URL:=http://hostap.epitest.fi/
  41. endef
  42. define Package/hs20-common/description
  43. Hotspot 2.0 OSU common files
  44. Hotspot 2.0 SPP and OMA DM XML schema/DTD files
  45. endef
  46. define Package/hs20-client
  47. SECTION:=net
  48. CATEGORY:=Network
  49. SUBMENU:=WirelessAPD
  50. TITLE:=Hotspot 2.0 OSU client
  51. URL:=http://hostap.epitest.fi/
  52. DEPENDS:=+hs20-common +libopenssl +libcurl +libxml2
  53. endef
  54. define Package/hs20-client/description
  55. Hotspot 2.0 OSU client
  56. endef
  57. define Package/hs20-server
  58. SECTION:=net
  59. CATEGORY:=Network
  60. SUBMENU:=WirelessAPD
  61. TITLE:=Hotspot 2.0 OSU server
  62. URL:=http://hostap.epitest.fi/
  63. DEPENDS:=+hs20-common +libopenssl +libsqlite3 +libxml2 +php7 +php7-cgi +php7-mod-xml +php7-mod-pdo-sqlite +openssl-util +sqlite3-cli +uhttpd +xxd
  64. endef
  65. define Package/hs20-server/description
  66. Hotspot 2.0 OSU server
  67. This implementation and the example configuration is meant only for
  68. testing purposes in a lab environment. This design is not secure to be
  69. installed in a publicly available Internet server without considerable
  70. amount of modification and review for security issues.
  71. endef
  72. define Build/Prepare
  73. $(call Build/Prepare/Default)
  74. $(eval $(call Download,dm-ddf-dtd))
  75. $(eval $(call Download,spp-xsd))
  76. endef
  77. define Build/Configure
  78. $(CP) ./files/hostapd.config $(PKG_BUILD_DIR)/hostapd/.config
  79. endef
  80. define Build/RunMake
  81. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  82. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
  83. $(TARGET_CONFIGURE_OPTS) \
  84. LIBS="$(TARGET_LDFLAGS) $(2)" \
  85. LIBS_c="$(TARGET_LDFLAGS_C)" \
  86. AR="$(TARGET_CROSS)gcc-ar" \
  87. BCHECK= CONFIG_NO_BROWSER=y \
  88. $(3)
  89. endef
  90. define Build/Compile
  91. $(call Build/RunMake,hostapd,-lssl -lcrypto -lsqlite3,hostapd hlr_auc_gw)
  92. $(call Build/RunMake,hs20/server,-lsqlite3 -lxml2,all)
  93. $(call Build/RunMake,hs20/client,-lssl -lcrypto -lcurl -lxml2,all)
  94. endef
  95. define Package/hs20-common/install
  96. $(INSTALL_DIR) $(1)/etc/hs20/spp
  97. $(INSTALL_DATA) $(DL_DIR)/dm_ddf-v1_3.dtd $(1)/etc/hs20/spp
  98. $(INSTALL_DATA) $(DL_DIR)/spp-v1_0.xsd $(1)/etc/hs20/spp/spp.xsd
  99. endef
  100. define Package/hs20-client/install
  101. $(INSTALL_DIR) $(1)/usr/sbin
  102. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hs20/client/hs20-osu-client $(1)/usr/sbin/
  103. endef
  104. define Package/hs20-server/install
  105. $(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
  106. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/hostapd-hs20-radius-server
  107. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hlr_auc_gw $(1)/usr/sbin/
  108. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hs20/server/hs20_spp_server $(1)/usr/sbin/
  109. $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/www/* $(1)/www/hs20
  110. $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/sql.txt $(1)/usr/share/hs20
  111. $(CP) $(PKG_BUILD_DIR)/hs20/server/ca/* $(1)/usr/share/hs20/ca
  112. $(INSTALL_BIN) ./files/hs20-server.defaults $(1)/etc/uci-defaults/hs20-server
  113. $(INSTALL_CONF) ./files/hs20.config $(1)/etc/config/hs20
  114. $(INSTALL_BIN) ./files/hs20.init $(1)/etc/init.d/hs20
  115. endef
  116. $(eval $(call BuildPackage,hs20-common))
  117. $(eval $(call BuildPackage,hs20-client))
  118. $(eval $(call BuildPackage,hs20-server))