aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2020-08-15 16:52:17 +0100
committerDaniel Golle <daniel@makrotopia.org>2020-08-15 16:54:54 +0100
commit6d8a3aa71d4a6bd553c340187c897d512055ae70 (patch)
tree729bef9db2dc61929c9dd124706ccd24799a385b
parent8bb7659f08c3fcb0646864c0164224539176267e (diff)
hs20: add Hotspot 2.0 OSU client and server implementation
Add hs20-server and hs20-client packages correspoding to the hs20/client and hs20/server folder in hostap.git. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--net/hs20/Makefile86
-rw-r--r--net/hs20/files/hs20.config14
2 files changed, 100 insertions, 0 deletions
diff --git a/net/hs20/Makefile b/net/hs20/Makefile
new file mode 100644
index 000000000..159f721ee
--- /dev/null
+++ b/net/hs20/Makefile
@@ -0,0 +1,86 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=hs20
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://w1.fi/hostap.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_DATE:=2020-06-08
+PKG_SOURCE_VERSION:=5a8b366233f5585e68a4ffbb604fbb4a848eb325
+
+PKG_SOURCE_NAME:=hostapd
+PKG_MIRROR_HASH:=1b2a4947034142587a3f81eac2ea27dd64650e77f8943d973623b47533be2393
+PKG_MIRROR_VERSION:=$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))
+PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_MIRROR_VERSION).tar.xz
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_SOURCE_NAME)-$(PKG_MIRROR_VERSION)
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=BSD-3-Clause
+PKG_CPE_ID:=cpe:/a:w1.fi:hostapd
+
+PKG_BUILD_PARALLEL:=1
+PKG_ASLR_PIE_REGULAR:=1
+
+ifdef CONFIG_USE_GLIBC
+ TARGET_LDFLAGS += -lrt
+ TARGET_LDFLAGS_C += -lrt
+endif
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/hs20-client
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=WirelessAPD
+ TITLE:=Hotspot 2.0 OSU client
+ URL:=http://hostap.epitest.fi/
+ DEPENDS:=+libopenssl +libcurl +libxml2
+endef
+
+define Package/hs20-server
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=WirelessAPD
+ TITLE:=Hotspot 2.0 OSU server
+ URL:=http://hostap.epitest.fi/
+ DEPENDS:=+libopenssl +libsqlite3 +libxml2 +php7 +php7-cgi +php7-mod-xml +openssl-util +sqlite3-cli
+endef
+
+define Build/Configure
+ cp "./files/hs20.config" "$(PKG_BUILD_DIR)/hostapd/.config"
+endef
+
+define Build/RunMake
+ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+ $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
+ $(TARGET_CONFIGURE_OPTS) \
+ LIBS="$(TARGET_LDFLAGS) $(2)" \
+ LIBS_c="$(TARGET_LDFLAGS_C)" \
+ AR="$(TARGET_CROSS)gcc-ar" \
+ BCHECK= CONFIG_NO_BROWSER=y \
+ $(3)
+endef
+
+define Build/Compile
+ $(call Build/RunMake,hostapd,-lssl -lcrypto -lsqlite3,hostapd hlr_auc_gw)
+ $(call Build/RunMake,hs20/server,-lsqlite3 -lxml2,all)
+ $(call Build/RunMake,hs20/client,-lssl -lcrypto -lcurl -lxml2,all)
+endef
+
+define Package/hs20-client/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/hs20/client/hs20-osu-client $(1)/usr/sbin/
+endef
+
+define Package/hs20-server/install
+ $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hs20/ca $(1)/www/hs20
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/hostapd-hs20-radius-server
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hlr_auc_gw $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/hs20/server/hs20_spp_server $(1)/usr/sbin/
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/www/* $(1)/www/hs20
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/*.txt $(1)/usr/share/hs20
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/ca/* $(1)/usr/share/hs20/ca
+endef
+
+$(eval $(call BuildPackage,hs20-client))
+$(eval $(call BuildPackage,hs20-server))
diff --git a/net/hs20/files/hs20.config b/net/hs20/files/hs20.config
new file mode 100644
index 000000000..417d2ce09
--- /dev/null
+++ b/net/hs20/files/hs20.config
@@ -0,0 +1,14 @@
+CONFIG_DRIVER_NONE=y
+CONFIG_PKCS12=y
+CONFIG_RADIUS_SERVER=y
+CONFIG_EAP=y
+CONFIG_EAP_TLS=y
+CONFIG_EAP_MSCHAPV2=y
+CONFIG_EAP_PEAP=y
+CONFIG_EAP_GTC=y
+CONFIG_EAP_TTLS=y
+CONFIG_EAP_SIM=y
+CONFIG_EAP_AKA=y
+CONFIG_EAP_AKA_PRIME=y
+CONFIG_SQLITE=y
+CONFIG_HS20=y