cjdns: update source, bump release
[feed/routing.git] / cjdns / Makefile
1 #
2 # Copyright (C) 2014,2015 Hyperboria.net
3 #
4 # You may redistribute this program and/or modify it under the terms of
5 # the GNU General Public License as published by the Free Software Foundation,
6 # either version 3 of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 #
16
17 include $(TOPDIR)/rules.mk
18
19 PKG_NAME:=cjdns
20 PKG_VERSION:=0.17
21 PKG_RELEASE:=2
22
23 PKG_SOURCE_URL:=https://github.com/hyperboria/cjdns.git
24 PKG_SOURCE_PROTO:=git
25 PKG_SOURCE_VERSION:=40e87d9419c19063e772e39c7c59a8a8771c5ee8
26 PKG_LICENSE:=GPL-3.0
27 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
28 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
29 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
30
31 include $(INCLUDE_DIR)/package.mk
32
33
34 define Package/cjdns
35 SECTION:=net
36 CATEGORY:=Network
37 SUBMENU:=Routing and Redirection
38 TITLE:=Encrypted near-zero-conf mesh routing protocol
39 URL:=https://github.com/hyperboria/cjdns
40 MAINTAINER:=Lars Gierth <larsg@systemli.org>
41 DEPENDS:=+kmod-tun +kmod-ipv6 +libnl-tiny +libpthread +librt \
42 +libuci-lua +lua-bencode +dkjson +luasocket +lua-sha2
43 endef
44
45 define Package/cjdns/description
46 Cjdns implements an encrypted IPv6 network using public-key cryptography \
47 for address allocation and a distributed hash table for routing. \
48 This provides near-zero-configuration networking, and prevents many \
49 of the security and scalability issues that plague existing networks.
50 endef
51
52 define Build/Configure
53 endef
54
55 PKG_DO_VARS:=CJDNS_RELEASE_VERSION=$(PKG_SOURCE_VERSION)
56
57 ifneq ($(CONFIG_KERNEL_SECCOMP_FILTER),y)
58 PKG_DO_VARS+= Seccomp_NO=1
59 endif
60
61 ifneq ($(CONFIG_USE_UCLIBC),)
62 PKG_DO_VARS+= UCLIBC=1
63 endif
64
65 define Build/Compile
66 CROSS="true" \
67 CC="$(TARGET_CC)" \
68 CFLAGS="$(TARGET_CFLAGS)" \
69 LDFLAGS="$(TARGET_LDFLAGS)" \
70 SYSTEM="linux" \
71 TARGET_ARCH="$(CONFIG_ARCH)" \
72 SSP_SUPPORT="$(CONFIG_SSP_SUPPORT)" \
73 $(PKG_DO_VARS) \
74 $(PKG_BUILD_DIR)/do
75 endef
76
77 define Package/cjdns/install
78 $(INSTALL_DIR) \
79 $(1)/usr/sbin \
80 $(1)/usr/bin \
81 $(1)/etc/config \
82 $(1)/etc/init.d \
83 $(1)/etc/uci-defaults \
84 $(1)/usr/lib/lua/cjdns
85
86 $(INSTALL_BIN) \
87 ./files/cjdrouteconf \
88 $(1)/usr/bin
89
90 $(INSTALL_BIN) \
91 $(PKG_BUILD_DIR)/cjdroute \
92 $(1)/usr/sbin
93
94 $(INSTALL_BIN) \
95 $(PKG_BUILD_DIR)/publictoip6 \
96 $(1)/usr/bin
97
98 $(INSTALL_BIN) \
99 ./files/cjdns.init \
100 $(1)/etc/init.d/cjdns
101
102 $(INSTALL_BIN) \
103 ./files/cjdns.defaults \
104 $(1)/etc/uci-defaults/cjdns
105
106 $(CP) \
107 ./lua/cjdns/* \
108 $(1)/usr/lib/lua/cjdns
109 endef
110
111 define Package/cjdns/postinst
112 #!/bin/sh
113 if [ -z $${IPKG_INSTROOT} ] ; then
114 ( . /etc/uci-defaults/cjdns ) && rm -f /etc/uci-defaults/cjdns
115 # TODO: we should have an 'Enable' button instead
116 /etc/init.d/cjdns enabled || /etc/init.d/cjdns enable
117 exit 0
118 fi
119 endef
120
121 $(eval $(call BuildPackage,cjdns))