2014-03-01 01:09:15 +08:00
|
|
|
#
|
2014-11-25 19:29:13 +08:00
|
|
|
# Copyright (C) 2012-2014 OpenWrt.org
|
2014-03-01 01:09:15 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=hnetd
|
2020-12-16 09:58:15 +08:00
|
|
|
PKG_SOURCE_DATE:=2018-12-21
|
|
|
|
PKG_SOURCE_VERSION:=c43766610ed30194b048bc070a3c433aec731c40
|
|
|
|
PKG_RELEASE:=1
|
2014-03-01 01:09:15 +08:00
|
|
|
|
|
|
|
PKG_SOURCE_PROTO:=git
|
2020-12-16 09:58:15 +08:00
|
|
|
PKG_SOURCE_URL:=https://github.com/sbyx/hnetd
|
2024-04-07 23:35:58 +08:00
|
|
|
PKG_MIRROR_HASH:=3b3bfff16b99dfd23b74932ac6a74af18cb9f8fd029980f1bd3788ddfb0414bb
|
2020-12-16 09:58:15 +08:00
|
|
|
|
2014-03-01 01:09:15 +08:00
|
|
|
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
|
2020-12-16 09:58:15 +08:00
|
|
|
PKG_LICENSE:=GPL-2.0-only
|
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
2014-03-01 01:09:15 +08:00
|
|
|
|
2020-12-16 09:58:15 +08:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
2014-03-01 01:09:15 +08:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
include $(INCLUDE_DIR)/cmake.mk
|
|
|
|
|
|
|
|
# Spammy debug builds for now
|
|
|
|
CMAKE_OPTIONS += -DL_LEVEL=7
|
|
|
|
|
|
|
|
# OpenWRT target
|
|
|
|
CMAKE_OPTIONS += -DBACKEND=openwrt
|
|
|
|
|
2015-04-11 00:57:25 +08:00
|
|
|
ifeq ($(BUILD_VARIANT),openssl)
|
|
|
|
CMAKE_OPTIONS += -DDTLS_OPENSSL=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
define Package/hnetd/Default
|
2014-03-01 01:09:15 +08:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2015-04-11 00:57:25 +08:00
|
|
|
TITLE:=HNCP Homenet daemon - $(2)
|
2014-03-01 01:09:15 +08:00
|
|
|
URL:=https://github.com/sbyx/hnetd
|
2015-07-28 18:06:25 +08:00
|
|
|
DEPENDS:=+odhcpd +odhcp6c +netifd $(3)
|
2016-06-05 08:13:13 +08:00
|
|
|
DEPENDS+=@IPV6
|
2015-04-11 00:57:25 +08:00
|
|
|
VARIANT:=$1
|
2014-03-01 01:09:15 +08:00
|
|
|
endef
|
|
|
|
|
2015-04-11 00:57:25 +08:00
|
|
|
Package/hnetd-nossl=$(call Package/hnetd/Default,nossl,no authentication)
|
|
|
|
Package/hnetd-openssl=$(call Package/hnetd/Default,openssl,authentication via OpenSSL,+libopenssl)
|
|
|
|
|
2014-03-01 01:09:15 +08:00
|
|
|
define Package/hnet-full
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2014-05-26 22:19:42 +08:00
|
|
|
TITLE:=HNCP Homenet metapackage
|
2014-03-01 01:09:15 +08:00
|
|
|
URL:=https://github.com/sbyx/hnetd
|
2015-07-28 18:06:25 +08:00
|
|
|
DEPENDS:=+hnetd-nossl +luci-app-hnet +ip
|
2015-04-11 00:57:25 +08:00
|
|
|
# Routing
|
2015-05-28 14:18:55 +08:00
|
|
|
DEPENDS+=+babeld
|
2015-04-11 00:57:25 +08:00
|
|
|
# Service discovery
|
2015-09-29 18:11:48 +08:00
|
|
|
DEPENDS+=+ohybridproxy +zonestitcher
|
2015-04-11 00:57:25 +08:00
|
|
|
# Distributed PCP support
|
|
|
|
DEPENDS+=+miniupnpd +minimalist-pcproxy
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/hnet-full-secure
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2015-07-28 18:06:25 +08:00
|
|
|
TITLE:=HNCP Homenet metapackage (w/ SSL)
|
2015-04-11 00:57:25 +08:00
|
|
|
URL:=https://github.com/sbyx/hnetd
|
2015-07-28 18:06:25 +08:00
|
|
|
DEPENDS:=+hnetd-openssl +luci-app-hnet +ip
|
|
|
|
# Routing
|
|
|
|
DEPENDS+=+babeld
|
|
|
|
# Service discovery
|
2015-09-29 18:11:48 +08:00
|
|
|
DEPENDS+=+ohybridproxy +zonestitcher
|
2015-07-28 18:06:25 +08:00
|
|
|
# Distributed PCP support
|
|
|
|
DEPENDS+=+miniupnpd +minimalist-pcproxy
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/hnet-full-l2tp
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
TITLE:=HNCP Homenet metapackage (w/ L2TP)
|
|
|
|
URL:=https://github.com/sbyx/hnetd
|
|
|
|
DEPENDS:=+hnetd-nossl +luci-app-hnet +ip-full +kmod-l2tp-eth
|
2014-05-26 22:19:42 +08:00
|
|
|
# Routing
|
2015-05-28 14:18:55 +08:00
|
|
|
DEPENDS+=+babeld
|
2014-05-26 22:19:42 +08:00
|
|
|
# Service discovery
|
2015-09-29 18:11:48 +08:00
|
|
|
DEPENDS+=+ohybridproxy +zonestitcher
|
2014-05-26 22:19:42 +08:00
|
|
|
# Distributed PCP support
|
|
|
|
DEPENDS+=+miniupnpd +minimalist-pcproxy
|
2014-03-01 01:09:15 +08:00
|
|
|
endef
|
|
|
|
|
2014-06-11 04:58:10 +08:00
|
|
|
define Package/luci-app-hnet
|
|
|
|
SECTION:=luci
|
|
|
|
CATEGORY:=LuCI
|
|
|
|
SUBMENU:=3. Applications
|
|
|
|
TITLE:=HNCP Homenet configuration and visualization
|
2015-04-11 00:57:25 +08:00
|
|
|
# DEPENDS:=+hnetd
|
|
|
|
# TBD - how to express dependency on 'some' hnetd?
|
2014-06-11 04:58:10 +08:00
|
|
|
endef
|
|
|
|
|
2015-04-11 00:57:25 +08:00
|
|
|
define Package/hnetd-$(BUILD_VARIANT)/description
|
2014-03-01 01:09:15 +08:00
|
|
|
This package provides a daemon which implementats distributed prefix assignment
|
|
|
|
and service discovery for a home network consisting of multiple routers
|
|
|
|
connected to multiple service providers. It provides a netifd protocol "hnet"
|
|
|
|
for use in /etc/config/network.
|
|
|
|
endef
|
|
|
|
|
2015-04-11 00:57:25 +08:00
|
|
|
define Package/hnetd-$(BUILD_VARIANT)/install
|
2014-03-01 01:09:15 +08:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin/
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hnetd $(1)/usr/sbin/
|
|
|
|
$(INSTALL_DIR) $(1)/lib/netifd/proto
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/hnet.sh $(1)/lib/netifd/proto
|
2014-07-18 06:09:16 +08:00
|
|
|
ln -s hnetd $(1)/usr/sbin/hnet-ifresolve
|
2015-04-11 00:57:25 +08:00
|
|
|
ln -s hnetd $(1)/usr/sbin/hnet-trust
|
|
|
|
ln -s hnetd $(1)/usr/sbin/hnet-dump
|
2014-03-01 01:09:15 +08:00
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(INSTALL_BIN) ./files/hnetd.init $(1)/etc/init.d/hnetd
|
2014-06-06 23:03:57 +08:00
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
|
|
|
$(INSTALL_DATA) ./files/hnet.config $(1)/etc/config/hnet
|
2015-09-15 16:53:49 +08:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/ohp.script $(1)/usr/sbin/hnetd-ohp-script
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/ddz.script $(1)/usr/sbin/hnetd-ddz-script
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/pcp.script $(1)/usr/sbin/hnetd-pcp-script
|
2014-03-01 01:09:15 +08:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/hnetd-routing $(1)/usr/sbin/hnetd-routing
|
|
|
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
|
|
|
$(INSTALL_BIN) ./files/hnetd.defaults $(1)/etc/uci-defaults/x-hnetd.defaults
|
2015-08-18 23:42:48 +08:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/multicast.script $(1)/usr/sbin/hnet-multicast
|
2015-08-21 20:12:23 +08:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/autowifi.script $(1)/usr/sbin/autowifi
|
2014-03-01 01:09:15 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/hnet-full/install
|
|
|
|
true
|
|
|
|
endef
|
|
|
|
|
2015-04-11 00:57:25 +08:00
|
|
|
define Package/hnet-full-secure/install
|
|
|
|
true
|
|
|
|
endef
|
|
|
|
|
2015-07-28 18:06:25 +08:00
|
|
|
define Package/hnet-full-l2tp/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin/
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/tunnel.script $(1)/usr/sbin/hnetd-tunnel
|
|
|
|
endef
|
|
|
|
|
2014-06-11 04:58:10 +08:00
|
|
|
define Package/luci-app-hnet/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
|
|
|
|
$(INSTALL_DIR) $(1)/www
|
|
|
|
$(CP) -R $(PKG_BUILD_DIR)/openwrt/luci/luasrc/* $(1)/usr/lib/lua/luci/
|
|
|
|
$(CP) -R $(PKG_BUILD_DIR)/openwrt/luci/htdocs/* $(1)/www/
|
|
|
|
endef
|
|
|
|
|
2015-04-11 00:57:25 +08:00
|
|
|
define Package/hnetd-$(BUILD_VARIANT)/postinst
|
2014-03-01 01:09:15 +08:00
|
|
|
#!/bin/sh
|
2014-03-01 23:04:34 +08:00
|
|
|
[ -n "$${IPKG_INSTROOT}" ] || {
|
|
|
|
(. /etc/uci-defaults/x-hnetd.defaults) && rm -f /etc/uci-defaults/x-hnetd.defaults
|
|
|
|
[ -x /etc/init.d/dnsmasq ] && /etc/init.d/dnsmasq restart
|
|
|
|
/etc/init.d/hnetd enable
|
|
|
|
/etc/init.d/hnetd start
|
|
|
|
}
|
2014-03-01 01:09:15 +08:00
|
|
|
endef
|
|
|
|
|
2015-04-11 00:57:25 +08:00
|
|
|
$(eval $(call BuildPackage,hnetd-nossl))
|
|
|
|
$(eval $(call BuildPackage,hnetd-openssl))
|
2014-03-01 01:09:15 +08:00
|
|
|
$(eval $(call BuildPackage,hnet-full))
|
2015-04-11 00:57:25 +08:00
|
|
|
$(eval $(call BuildPackage,hnet-full-secure))
|
2015-07-28 18:06:25 +08:00
|
|
|
$(eval $(call BuildPackage,hnet-full-l2tp))
|
2014-06-11 04:58:10 +08:00
|
|
|
$(eval $(call BuildPackage,luci-app-hnet))
|