diff --git a/general/package/Config.in b/general/package/Config.in index 5b94002e1..1dd0341b0 100644 --- a/general/package/Config.in +++ b/general/package/Config.in @@ -65,6 +65,7 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/mini/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/motors/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/msposd/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/mt7601u-openipc/Config.in" +source "$BR2_EXTERNAL_GENERAL_PATH/package/n3n-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/nabto/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/node-exporter/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/novatek-osdrv-nt9856x/Config.in" diff --git a/general/package/n3n-openipc/Config.in b/general/package/n3n-openipc/Config.in new file mode 100644 index 000000000..adf0e8968 --- /dev/null +++ b/general/package/n3n-openipc/Config.in @@ -0,0 +1,12 @@ +# +# Copyright (c) OpenIPC https://openipc.org MIT License +# +# Config.in — Buildroot package Kconfig menu +# +config BR2_PACKAGE_N3N_OPENIPC + bool "n3n-openipc" + help + n3n is a light VPN software which makes it easy to create + virtual networks bypassing intermediate firewalls + + https://github.com/n42n/n3n diff --git a/general/package/n3n-openipc/files/S89edge b/general/package/n3n-openipc/files/S89edge new file mode 100755 index 000000000..6ad46fe49 --- /dev/null +++ b/general/package/n3n-openipc/files/S89edge @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Copyright (c) OpenIPC https://openipc.org MIT License +# +# S89edge — SysV init script for edge +# + +DAEMON="n3n-edge" +PIDFILE="/var/run/$DAEMON.pid" +DAEMON_ARGS="start" + +start() { + echo -n "Starting $DAEMON: " + modprobe tun + start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_ARGS + if [ $? -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi +} + +stop() { + echo -n "Stopping $DAEMON: " + start-stop-daemon -K -q -p "$PIDFILE" + if [ $? -eq 0 ]; then + rm -f "$PIDFILE" + echo "OK" + else + echo "FAIL" + fi +} + +case "$1" in + start|stop) + $1 + ;; + + restart) + stop + sleep 3 + start + ;; + + reload) + killall -1 "$DAEMON" + ;; + + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 + ;; +esac diff --git a/general/package/n3n-openipc/n3n-openipc.mk b/general/package/n3n-openipc/n3n-openipc.mk new file mode 100644 index 000000000..5d6156a22 --- /dev/null +++ b/general/package/n3n-openipc/n3n-openipc.mk @@ -0,0 +1,37 @@ +################################################################################ +# +# Copyright (c) OpenIPC https://openipc.org MIT License +# +# n3n-openipc — n3n-openipc Buildroot package +# +################################################################################ + +N3N_OPENIPC_SITE = $(call github,n42n,n3n,$(N3N_OPENIPC_VERSION)) +N3N_OPENIPC_VERSION = 44b93f02f30a12187a6802b0268f614c08b41077 +# N3N_OPENIPC_VERSION = HEAD + +N3N_OPENIPC_LICENSE = GPL-2.0 +N3N_OPENIPC_LICENSE_FILES = LICENSE +N3N_OPENIPC_INSTALL_STAGING = YES + +N3N_OPENIPC_CFLAGS = $(TARGET_CFLAGS) -fno-strict-aliasing + +define N3N_OPENIPC_RUN_AUTOGEN + cd $(@D) && PATH=$(BR_PATH) ./autogen.sh +endef + +N3N_OPENIPC_PRE_CONFIGURE_HOOKS += N3N_OPENIPC_RUN_AUTOGEN + +#N3N_OPENIPC_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release +N3N_OPENIPC_MAKE_OPTS += VERBOSE=1 + +define N3N_OPENIPC_INSTALL_TARGET_CMDS + $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d + $(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(N3N_OPENIPC_PKGDIR)/files/S89edge + + $(INSTALL) -m 755 -d $(TARGET_DIR)/usr/sbin + $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/apps/n3n-edge +# $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/apps/n3n-supernode +endef + +$(eval $(autotools-package))