2015-05-13 01:35:13 +02:00
|
|
|
#
|
|
|
|
# Copyright (C) 2014,2015 Hyperboria.net
|
|
|
|
#
|
|
|
|
# You may redistribute this program and/or modify it under the terms of
|
|
|
|
# the GNU General Public License as published by the Free Software Foundation,
|
|
|
|
# either version 3 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
2015-04-17 14:50:16 +02:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=cjdns
|
2022-06-18 19:01:00 +02:00
|
|
|
PKG_VERSION:=v21.1
|
2022-06-20 21:31:44 +02:00
|
|
|
PKG_RELEASE:=4
|
2015-04-17 14:50:16 +02:00
|
|
|
|
2020-12-11 04:15:31 +01:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=https://codeload.github.com/cjdelisle/cjdns/tar.gz/$(PKG_NAME)-$(PKG_VERSION)?
|
2022-06-18 19:01:00 +02:00
|
|
|
PKG_HASH:=a6158ce7847159aa44e86f74ccc7b6ded6910a230ed8f3830db53cda5838f0b0
|
2020-12-11 04:15:31 +01:00
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
|
2015-04-17 14:50:16 +02:00
|
|
|
|
2019-11-10 03:40:04 +01:00
|
|
|
PKG_MAINTAINER:=William Fleurant <meshnet@protonmail.com>
|
|
|
|
PKG_LICENSE:=GPL-3.0-or-later
|
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
2015-04-17 14:50:16 +02:00
|
|
|
|
2019-11-10 03:40:04 +01:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2015-04-17 14:50:16 +02:00
|
|
|
|
|
|
|
define Package/cjdns
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
SUBMENU:=Routing and Redirection
|
|
|
|
TITLE:=Encrypted near-zero-conf mesh routing protocol
|
2017-12-20 13:10:14 +01:00
|
|
|
URL:=https://github.com/cjdelisle/cjdns
|
2019-05-28 01:48:46 +02:00
|
|
|
DEPENDS:=@!arc @IPV6 +kmod-tun +libnl-tiny +libpthread +librt \
|
2015-04-17 14:50:16 +02:00
|
|
|
+libuci-lua +lua-bencode +dkjson +luasocket +lua-sha2
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/cjdns/description
|
|
|
|
Cjdns implements an encrypted IPv6 network using public-key cryptography \
|
|
|
|
for address allocation and a distributed hash table for routing. \
|
|
|
|
This provides near-zero-configuration networking, and prevents many \
|
|
|
|
of the security and scalability issues that plague existing networks.
|
|
|
|
endef
|
|
|
|
|
2015-05-15 21:05:29 +02:00
|
|
|
define Package/cjdns-tests
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
SUBMENU:=Routing and Redirection
|
|
|
|
TITLE:=cjdns test cases
|
2017-12-20 13:10:14 +01:00
|
|
|
URL:=https://github.com/cjdelisle/cjdns
|
2019-07-29 19:38:51 +02:00
|
|
|
DEPENDS:=+libpthread +librt @!arc
|
2015-05-15 21:05:29 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/cjdns-test/description
|
2019-11-10 03:40:04 +01:00
|
|
|
Builds cjdns test cases binary test_testcjdroute_c
|
2015-05-15 21:05:29 +02:00
|
|
|
endef
|
|
|
|
|
2015-04-17 14:50:16 +02:00
|
|
|
define Build/Configure
|
|
|
|
endef
|
|
|
|
|
2016-02-06 02:02:38 +01:00
|
|
|
PKG_DO_VARS:=CJDNS_RELEASE_VERSION=$(PKG_SOURCE_VERSION)
|
2015-04-21 13:18:00 +02:00
|
|
|
|
2015-04-17 14:50:16 +02:00
|
|
|
ifneq ($(CONFIG_KERNEL_SECCOMP_FILTER),y)
|
2015-04-21 13:18:00 +02:00
|
|
|
PKG_DO_VARS+= Seccomp_NO=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_USE_UCLIBC),)
|
|
|
|
PKG_DO_VARS+= UCLIBC=1
|
2015-04-17 14:50:16 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
define Build/Compile
|
2020-12-11 04:15:31 +01:00
|
|
|
$(INSTALL_DIR) $(PKG_BUILD_DIR)/tmp
|
|
|
|
(cd $(PKG_BUILD_DIR) && \
|
2015-04-17 14:50:16 +02:00
|
|
|
CROSS="true" \
|
|
|
|
CC="$(TARGET_CC)" \
|
2015-06-23 07:50:57 +02:00
|
|
|
AR="$(TARGET_AR)" \
|
|
|
|
RANLIB="$(TARGET_RANLIB)" \
|
2021-10-19 22:09:02 +02:00
|
|
|
CFLAGS="$(TARGET_CFLAGS) -U_FORTIFY_SOURCE -Wno-error=array-bounds -Wno-error=stringop-overflow -Wno-error=stringop-overread" \
|
2015-04-17 14:50:16 +02:00
|
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
|
|
SYSTEM="linux" \
|
|
|
|
TARGET_ARCH="$(CONFIG_ARCH)" \
|
|
|
|
SSP_SUPPORT="$(CONFIG_SSP_SUPPORT)" \
|
2015-06-23 07:50:57 +02:00
|
|
|
GYP_ADDITIONAL_ARGS="-f make-linux" \
|
2020-12-11 04:15:31 +01:00
|
|
|
CJDNS_BUILD_TMPDIR="$(PKG_BUILD_DIR)/tmp" \
|
2015-04-17 14:50:16 +02:00
|
|
|
$(PKG_DO_VARS) \
|
2017-12-20 13:10:14 +01:00
|
|
|
exec ./do)
|
2015-04-17 14:50:16 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/cjdns/install
|
|
|
|
$(INSTALL_DIR) \
|
|
|
|
$(1)/usr/sbin \
|
|
|
|
$(1)/usr/bin \
|
|
|
|
$(1)/etc/config \
|
|
|
|
$(1)/etc/init.d \
|
|
|
|
$(1)/etc/uci-defaults \
|
|
|
|
$(1)/usr/lib/lua/cjdns
|
|
|
|
|
|
|
|
$(INSTALL_BIN) \
|
|
|
|
./files/cjdrouteconf \
|
|
|
|
$(1)/usr/bin
|
|
|
|
|
|
|
|
$(INSTALL_BIN) \
|
2020-12-11 04:15:31 +01:00
|
|
|
$(PKG_BUILD_DIR)/cjdroute \
|
2015-04-17 14:50:16 +02:00
|
|
|
$(1)/usr/sbin
|
|
|
|
|
|
|
|
$(INSTALL_BIN) \
|
2020-12-11 04:15:31 +01:00
|
|
|
$(PKG_BUILD_DIR)/publictoip6 \
|
2015-04-17 14:50:16 +02:00
|
|
|
$(1)/usr/bin
|
|
|
|
|
|
|
|
$(INSTALL_BIN) \
|
|
|
|
./files/cjdns.init \
|
|
|
|
$(1)/etc/init.d/cjdns
|
|
|
|
|
|
|
|
$(INSTALL_BIN) \
|
|
|
|
./files/cjdns.defaults \
|
|
|
|
$(1)/etc/uci-defaults/cjdns
|
|
|
|
|
|
|
|
$(CP) \
|
|
|
|
./lua/cjdns/* \
|
|
|
|
$(1)/usr/lib/lua/cjdns
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/cjdns/postinst
|
|
|
|
#!/bin/sh
|
|
|
|
if [ -z $${IPKG_INSTROOT} ] ; then
|
|
|
|
( . /etc/uci-defaults/cjdns ) && rm -f /etc/uci-defaults/cjdns
|
|
|
|
/etc/init.d/cjdns enabled || /etc/init.d/cjdns enable
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
2015-05-15 21:05:29 +02:00
|
|
|
define Package/cjdns-tests/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_BIN) \
|
2020-12-11 04:15:31 +01:00
|
|
|
$(PKG_BUILD_DIR)/build_linux/test_testcjdroute_c \
|
2015-05-15 21:05:29 +02:00
|
|
|
$(1)/usr/bin
|
|
|
|
endef
|
|
|
|
|
2015-04-17 14:50:16 +02:00
|
|
|
$(eval $(call BuildPackage,cjdns))
|
2015-05-15 21:05:29 +02:00
|
|
|
$(eval $(call BuildPackage,cjdns-tests))
|