2014-03-01 01:09:15 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2012-2013 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=hnetd
|
2014-09-26 15:33:42 +08:00
|
|
|
PKG_SOURCE_VERSION:=0c1d55d03983c726aaad010738236c2da64ca7df
|
|
|
|
PKG_VERSION:=2014-09-26-$(PKG_SOURCE_VERSION)
|
|
|
|
PKG_RELEASE:=1
|
2014-03-01 01:09:15 +08:00
|
|
|
|
|
|
|
PKG_SOURCE_PROTO:=git
|
|
|
|
PKG_SOURCE_URL:=git://github.com/sbyx/hnetd.git
|
|
|
|
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
|
2014-11-03 20:16:46 +08:00
|
|
|
PKG_LICENSE:=GPL-2.0
|
2014-03-01 01:09:15 +08:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|
|
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
define Package/hnetd
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
TITLE:=HNCP Homenet daemon
|
|
|
|
URL:=https://github.com/sbyx/hnetd
|
|
|
|
DEPENDS:=+odhcpd +odhcp6c +netifd
|
|
|
|
DEPENDS+=+@IPV6
|
|
|
|
endef
|
|
|
|
|
|
|
|
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
|
2014-07-14 21:03:44 +08:00
|
|
|
DEPENDS:=+hnetd +luci-app-hnet
|
2014-05-26 22:19:42 +08:00
|
|
|
# Routing
|
|
|
|
DEPENDS+=+babels
|
|
|
|
# Service discovery
|
|
|
|
DEPENDS+=+ohybridproxy
|
|
|
|
# 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
|
2014-07-14 21:03:44 +08:00
|
|
|
DEPENDS:=+hnetd
|
2014-06-11 04:58:10 +08:00
|
|
|
endef
|
|
|
|
|
2014-03-01 01:09:15 +08:00
|
|
|
define Package/hnetd/description
|
|
|
|
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
|
|
|
|
|
|
|
|
define Package/hnetd/install
|
|
|
|
$(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
|
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
|
2014-03-01 01:09:15 +08:00
|
|
|
$(INSTALL_BIN) ./files/ohp-script $(1)/usr/sbin/hnetd-ohp-script
|
2014-05-26 22:19:42 +08:00
|
|
|
$(INSTALL_BIN) ./files/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
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/hnet-full/install
|
|
|
|
true
|
|
|
|
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
|
|
|
|
|
2014-03-01 01:09:15 +08:00
|
|
|
define Package/hnetd/postinst
|
|
|
|
#!/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
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,hnetd))
|
|
|
|
$(eval $(call BuildPackage,hnet-full))
|
2014-06-11 04:58:10 +08:00
|
|
|
$(eval $(call BuildPackage,luci-app-hnet))
|