2 # Copyright (C) 2012-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
10 PKG_SOURCE_DATE
:=2018-12-21
11 PKG_SOURCE_VERSION
:=c43766610ed30194b048bc070a3c433aec731c40
15 PKG_SOURCE_URL
:=https
://github.com
/sbyx
/hnetd
16 PKG_MIRROR_HASH
:=a41baa2e3d7930cc88073b0b3f6e1fa6a4abd9fd663f2577cfde1564fa07f8f2
18 PKG_MAINTAINER
:=Steven Barth
<cyrus@openwrt.org
>
19 PKG_LICENSE
:=GPL-2.0
-only
20 PKG_LICENSE_FILES
:=LICENSE
24 include $(INCLUDE_DIR
)/package.mk
25 include $(INCLUDE_DIR
)/cmake.mk
27 # Spammy debug builds for now
28 CMAKE_OPTIONS
+= -DL_LEVEL
=7
31 CMAKE_OPTIONS
+= -DBACKEND
=openwrt
33 ifeq ($(BUILD_VARIANT
),openssl
)
34 CMAKE_OPTIONS
+= -DDTLS_OPENSSL
=1
37 define Package
/hnetd
/Default
40 TITLE
:=HNCP Homenet daemon
- $(2)
41 URL
:=https
://github.com
/sbyx
/hnetd
42 DEPENDS
:=+odhcpd
+odhcp6c
+netifd
$(3)
47 Package
/hnetd-nossl
=$(call Package
/hnetd
/Default
,nossl
,no authentication
)
48 Package
/hnetd-openssl
=$(call Package
/hnetd
/Default
,openssl
,authentication via OpenSSL
,+libopenssl
)
50 define Package
/hnet-full
53 TITLE
:=HNCP Homenet metapackage
54 URL
:=https
://github.com
/sbyx
/hnetd
55 DEPENDS
:=+hnetd-nossl
+luci-app-hnet
+ip
59 DEPENDS
+=+ohybridproxy
+zonestitcher
60 # Distributed PCP support
61 DEPENDS
+=+miniupnpd
+minimalist-pcproxy
64 define Package
/hnet-full-secure
67 TITLE
:=HNCP Homenet metapackage
(w
/ SSL
)
68 URL
:=https
://github.com
/sbyx
/hnetd
69 DEPENDS
:=+hnetd-openssl
+luci-app-hnet
+ip
73 DEPENDS
+=+ohybridproxy
+zonestitcher
74 # Distributed PCP support
75 DEPENDS
+=+miniupnpd
+minimalist-pcproxy
78 define Package
/hnet-full-l2tp
81 TITLE
:=HNCP Homenet metapackage
(w
/ L2TP
)
82 URL
:=https
://github.com
/sbyx
/hnetd
83 DEPENDS
:=+hnetd-nossl
+luci-app-hnet
+ip-full
+kmod-l2tp-eth
87 DEPENDS
+=+ohybridproxy
+zonestitcher
88 # Distributed PCP support
89 DEPENDS
+=+miniupnpd
+minimalist-pcproxy
92 define Package
/luci-app-hnet
95 SUBMENU
:=3. Applications
96 TITLE
:=HNCP Homenet configuration and visualization
98 # TBD - how to express dependency on 'some' hnetd?
101 define Package
/hnetd-
$(BUILD_VARIANT
)/description
102 This package provides a daemon which implementats distributed
prefix assignment
103 and service discovery for a home network consisting of multiple routers
104 connected to multiple service providers. It provides a netifd protocol
"hnet"
105 for use in
/etc
/config
/network.
108 define Package
/hnetd-
$(BUILD_VARIANT
)/install
109 $(INSTALL_DIR
) $(1)/usr
/sbin
/
110 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hnetd
$(1)/usr
/sbin
/
111 $(INSTALL_DIR
) $(1)/lib
/netifd
/proto
112 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/openwrt
/hnet.sh
$(1)/lib
/netifd
/proto
113 ln
-s hnetd
$(1)/usr
/sbin
/hnet-ifresolve
114 ln
-s hnetd
$(1)/usr
/sbin
/hnet-trust
115 ln
-s hnetd
$(1)/usr
/sbin
/hnet-dump
116 $(INSTALL_DIR
) $(1)/etc
/init.d
117 $(INSTALL_BIN
) .
/files
/hnetd.init
$(1)/etc
/init.d
/hnetd
118 $(INSTALL_DIR
) $(1)/etc
/config
119 $(INSTALL_DATA
) .
/files
/hnet.config
$(1)/etc
/config
/hnet
120 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/ohp.script
$(1)/usr
/sbin
/hnetd-ohp-script
121 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/ddz.script
$(1)/usr
/sbin
/hnetd-ddz-script
122 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/pcp.script
$(1)/usr
/sbin
/hnetd-pcp-script
123 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/hnetd-routing
$(1)/usr
/sbin
/hnetd-routing
124 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
125 $(INSTALL_BIN
) .
/files
/hnetd.defaults
$(1)/etc
/uci-defaults
/x-hnetd.defaults
126 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/multicast.script
$(1)/usr
/sbin
/hnet-multicast
127 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/openwrt
/autowifi.script
$(1)/usr
/sbin
/autowifi
130 define Package
/hnet-full
/install
134 define Package
/hnet-full-secure
/install
138 define Package
/hnet-full-l2tp
/install
139 $(INSTALL_DIR
) $(1)/usr
/sbin
/
140 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/tunnel.script
$(1)/usr
/sbin
/hnetd-tunnel
143 define Package
/luci-app-hnet
/install
144 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
/luci
145 $(INSTALL_DIR
) $(1)/www
146 $(CP
) -R
$(PKG_BUILD_DIR
)/openwrt
/luci
/luasrc
/* $(1)/usr
/lib
/lua
/luci
/
147 $(CP
) -R
$(PKG_BUILD_DIR
)/openwrt
/luci
/htdocs
/* $(1)/www
/
150 define Package
/hnetd-
$(BUILD_VARIANT
)/postinst
152 [ -n
"$${IPKG_INSTROOT}" ] ||
{
153 (.
/etc
/uci-defaults
/x-hnetd.defaults
) && rm -f
/etc
/uci-defaults
/x-hnetd.defaults
154 [ -x
/etc
/init.d
/dnsmasq
] && /etc
/init.d
/dnsmasq restart
155 /etc
/init.d
/hnetd enable
156 /etc
/init.d
/hnetd start
160 $(eval
$(call BuildPackage
,hnetd-nossl
))
161 $(eval
$(call BuildPackage
,hnetd-openssl
))
162 $(eval
$(call BuildPackage
,hnet-full
))
163 $(eval
$(call BuildPackage
,hnet-full-secure
))
164 $(eval
$(call BuildPackage
,hnet-full-l2tp
))
165 $(eval
$(call BuildPackage
,luci-app-hnet
))