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_VERSION
:=606d7e904603ad8792ac1a7ba825618df97b5a4e
11 PKG_VERSION
:=2016-06-28-$(PKG_SOURCE_VERSION
)
15 PKG_SOURCE_URL
:=https
://github.com
/sbyx
/hnetd.git
16 PKG_MAINTAINER
:=Steven Barth
<cyrus@openwrt.org
>
19 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
20 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
22 include $(INCLUDE_DIR
)/package.mk
23 include $(INCLUDE_DIR
)/cmake.mk
25 # Spammy debug builds for now
26 CMAKE_OPTIONS
+= -DL_LEVEL
=7
29 CMAKE_OPTIONS
+= -DBACKEND
=openwrt
31 ifeq ($(BUILD_VARIANT
),openssl
)
32 CMAKE_OPTIONS
+= -DDTLS_OPENSSL
=1
35 define Package
/hnetd
/Default
38 TITLE
:=HNCP Homenet daemon
- $(2)
39 URL
:=https
://github.com
/sbyx
/hnetd
40 DEPENDS
:=+odhcpd
+odhcp6c
+netifd
$(3)
45 Package
/hnetd-nossl
=$(call Package
/hnetd
/Default
,nossl
,no authentication
)
46 Package
/hnetd-openssl
=$(call Package
/hnetd
/Default
,openssl
,authentication via OpenSSL
,+libopenssl
)
48 define Package
/hnet-full
51 TITLE
:=HNCP Homenet metapackage
52 URL
:=https
://github.com
/sbyx
/hnetd
53 DEPENDS
:=+hnetd-nossl
+luci-app-hnet
+ip
57 DEPENDS
+=+ohybridproxy
+zonestitcher
58 # Distributed PCP support
59 DEPENDS
+=+miniupnpd
+minimalist-pcproxy
62 define Package
/hnet-full-secure
65 TITLE
:=HNCP Homenet metapackage
(w
/ SSL
)
66 URL
:=https
://github.com
/sbyx
/hnetd
67 DEPENDS
:=+hnetd-openssl
+luci-app-hnet
+ip
71 DEPENDS
+=+ohybridproxy
+zonestitcher
72 # Distributed PCP support
73 DEPENDS
+=+miniupnpd
+minimalist-pcproxy
76 define Package
/hnet-full-l2tp
79 TITLE
:=HNCP Homenet metapackage
(w
/ L2TP
)
80 URL
:=https
://github.com
/sbyx
/hnetd
81 DEPENDS
:=+hnetd-nossl
+luci-app-hnet
+ip-full
+kmod-l2tp-eth
85 DEPENDS
+=+ohybridproxy
+zonestitcher
86 # Distributed PCP support
87 DEPENDS
+=+miniupnpd
+minimalist-pcproxy
90 define Package
/luci-app-hnet
93 SUBMENU
:=3. Applications
94 TITLE
:=HNCP Homenet configuration and visualization
96 # TBD - how to express dependency on 'some' hnetd?
99 define Package
/hnetd-
$(BUILD_VARIANT
)/description
100 This package provides a daemon which implementats distributed
prefix assignment
101 and service discovery for a home network consisting of multiple routers
102 connected to multiple service providers. It provides a netifd protocol
"hnet"
103 for use in
/etc
/config
/network.
106 define Package
/hnetd-
$(BUILD_VARIANT
)/install
107 $(INSTALL_DIR
) $(1)/usr
/sbin
/
108 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hnetd
$(1)/usr
/sbin
/
109 $(INSTALL_DIR
) $(1)/lib
/netifd
/proto
110 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/openwrt
/hnet.sh
$(1)/lib
/netifd
/proto
111 ln
-s hnetd
$(1)/usr
/sbin
/hnet-ifresolve
112 ln
-s hnetd
$(1)/usr
/sbin
/hnet-trust
113 ln
-s hnetd
$(1)/usr
/sbin
/hnet-dump
114 $(INSTALL_DIR
) $(1)/etc
/init.d
115 $(INSTALL_BIN
) .
/files
/hnetd.init
$(1)/etc
/init.d
/hnetd
116 $(INSTALL_DIR
) $(1)/etc
/config
117 $(INSTALL_DATA
) .
/files
/hnet.config
$(1)/etc
/config
/hnet
118 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/ohp.script
$(1)/usr
/sbin
/hnetd-ohp-script
119 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/ddz.script
$(1)/usr
/sbin
/hnetd-ddz-script
120 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/pcp.script
$(1)/usr
/sbin
/hnetd-pcp-script
121 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/hnetd-routing
$(1)/usr
/sbin
/hnetd-routing
122 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
123 $(INSTALL_BIN
) .
/files
/hnetd.defaults
$(1)/etc
/uci-defaults
/x-hnetd.defaults
124 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/multicast.script
$(1)/usr
/sbin
/hnet-multicast
125 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/openwrt
/autowifi.script
$(1)/usr
/sbin
/autowifi
128 define Package
/hnet-full
/install
132 define Package
/hnet-full-secure
/install
136 define Package
/hnet-full-l2tp
/install
137 $(INSTALL_DIR
) $(1)/usr
/sbin
/
138 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/generic
/tunnel.script
$(1)/usr
/sbin
/hnetd-tunnel
141 define Package
/luci-app-hnet
/install
142 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
/luci
143 $(INSTALL_DIR
) $(1)/www
144 $(CP
) -R
$(PKG_BUILD_DIR
)/openwrt
/luci
/luasrc
/* $(1)/usr
/lib
/lua
/luci
/
145 $(CP
) -R
$(PKG_BUILD_DIR
)/openwrt
/luci
/htdocs
/* $(1)/www
/
148 define Package
/hnetd-
$(BUILD_VARIANT
)/postinst
150 [ -n
"$${IPKG_INSTROOT}" ] ||
{
151 (.
/etc
/uci-defaults
/x-hnetd.defaults
) && rm -f
/etc
/uci-defaults
/x-hnetd.defaults
152 [ -x
/etc
/init.d
/dnsmasq
] && /etc
/init.d
/dnsmasq restart
153 /etc
/init.d
/hnetd enable
154 /etc
/init.d
/hnetd start
158 $(eval
$(call BuildPackage
,hnetd-nossl
))
159 $(eval
$(call BuildPackage
,hnetd-openssl
))
160 $(eval
$(call BuildPackage
,hnet-full
))
161 $(eval
$(call BuildPackage
,hnet-full-secure
))
162 $(eval
$(call BuildPackage
,hnet-full-l2tp
))
163 $(eval
$(call BuildPackage
,luci-app-hnet
))