]> Cypherpunks.ru repositories - nncp.git/commitdiff
Draft FreeBSD port
authorSergey Matveev <stargrave@stargrave.org>
Sun, 15 Jan 2017 17:46:13 +0000 (20:46 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 15 Jan 2017 17:48:23 +0000 (20:48 +0300)
makedist.sh
ports/nncp/Makefile [new file with mode: 0644]
ports/nncp/files/nncp-caller.in [new file with mode: 0644]
ports/nncp/files/nncp-daemon.in [new file with mode: 0644]
ports/nncp/files/nncp.newsyslog.conf.in [new file with mode: 0644]
ports/nncp/files/pkg-deinstall.in [new file with mode: 0644]
ports/nncp/files/pkg-message.in [new file with mode: 0644]
ports/nncp/pkg-descr [new file with mode: 0644]

index f752a4fe4f12dd1b1850223515fe3007dc3b6af5..896e9f0263500badd6275816babd45b25f6b4b3a 100755 (executable)
@@ -61,6 +61,7 @@ rm -fr $tmp/golang.org $tmp/includes
 find src -name .travis.yml -delete
 rm -fr src/github.com/davecgh/go-xdr/xdr
 rm -fr src/github.com/gorhill/cronexpr/cronexpr src/github.com/gorhill/cronexpr/APLv2
+rm -fr ports
 rm makedist.sh
 
 cat > doc/download.texi <<EOF
diff --git a/ports/nncp/Makefile b/ports/nncp/Makefile
new file mode 100644 (file)
index 0000000..3f43dea
--- /dev/null
@@ -0,0 +1,50 @@
+# $FreeBSD$
+
+PORTNAME=      nncp
+PORTVERSION=   0.2
+CATEGORIES=    net
+MASTER_SITES=  http://www.nncpgo.org/download/ \
+               http://sourceforge.net/projects/nncp/files/
+
+MAINTAINER=    stargrave@stargrave.org
+COMMENT=       Utilities for secure store-and-forward files and mail exchanging
+
+LICENSE=       GPLv3+
+LICENSE_FILE=  ${WRKSRC}/COPYING
+
+BUILD_DEPENDS= go:lang/go
+
+USES=          tar:xz
+MAKEFILE=      BSDmakefile
+
+USE_RC_SUBR=   nncp-caller nncp-daemon
+REQUIRE=       DAEMON
+
+SUB_FILES=     pkg-message pkg-deinstall nncp.newsyslog.conf
+
+PORTDOCS=      AUTHORS NEWS README THANKS
+INFO=          nncp
+INSTALL_TARGET=        install-strip
+
+PLIST_FILES=   bin/nncp-call \
+               bin/nncp-caller \
+               bin/nncp-check \
+               bin/nncp-daemon \
+               bin/nncp-file \
+               bin/nncp-freq \
+               bin/nncp-log \
+               bin/nncp-mail \
+               bin/nncp-newnode \
+               bin/nncp-pkt \
+               bin/nncp-stat \
+               bin/nncp-toss \
+               bin/nncp-xfer \
+               etc/newsyslog.conf.d/nncp.conf
+PLIST_DIRS=    /var/spool/nncp
+
+post-install:
+       ${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d
+       ${INSTALL_DATA} ${WRKDIR}/nncp.newsyslog.conf ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/nncp.conf
+       ${MKDIR} ${STAGEDIR}/var/spool/nncp
+
+.include <bsd.port.mk>
diff --git a/ports/nncp/files/nncp-caller.in b/ports/nncp/files/nncp-caller.in
new file mode 100644 (file)
index 0000000..89c7934
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: nncp-caller
+# REQUIRE: DAEMON NETWORKING FILESYSTEMS
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# nncp_caller_enable (bool):   Set to NO by default.
+#                              Set it to YES to enable nncp-caller.
+# nncp_caller_config (path):   Set to %%PREFIX%%/etc/nncp.yaml by default.
+
+. /etc/rc.subr
+
+name=nncp_caller
+rcvar=nncp_caller_enable
+
+load_rc_config $name
+
+: ${nncp_caller_enable:="NO"}
+: ${nncp_caller_config="%%PREFIX%%/etc/nncp.yaml"}
+
+command=%%PREFIX%%/bin/nncp-caller
+command_args="-quiet -cfg $nncp_caller_config &"
+
+run_rc_command "$1"
diff --git a/ports/nncp/files/nncp-daemon.in b/ports/nncp/files/nncp-daemon.in
new file mode 100644 (file)
index 0000000..3c7ccd8
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: nncp-daemon
+# REQUIRE: DAEMON NETWORKING FILESYSTEMS
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# nncp_daemon_enable (bool):   Set to NO by default.
+#                              Set it to YES to enable nncp-daemon.
+# nncp_daemon_config (path):   Set to %%PREFIX%%/etc/nncp.yaml by default.
+# nncp_daemon_bind (string):   Address:port to bind to
+#                              Default is "[::]:5400".
+
+. /etc/rc.subr
+
+name=nncp_daemon
+rcvar=nncp_daemon_enable
+
+load_rc_config $name
+
+: ${nncp_daemon_enable:="NO"}
+: ${nncp_daemon_config="%%PREFIX%%/etc/nncp.yaml"}
+: ${nncp_daemon_bind="[::]:5400"}
+
+command=%%PREFIX%%/bin/nncp-daemon
+command_args="-quiet -bind $nncp_daemon_bind -cfg $nncp_daemon_config &"
+
+run_rc_command "$1"
diff --git a/ports/nncp/files/nncp.newsyslog.conf.in b/ports/nncp/files/nncp.newsyslog.conf.in
new file mode 100644 (file)
index 0000000..243db01
--- /dev/null
@@ -0,0 +1 @@
+/var/log/nncp.log              644     7       100     *       CXN
diff --git a/ports/nncp/files/pkg-deinstall.in b/ports/nncp/files/pkg-deinstall.in
new file mode 100644 (file)
index 0000000..af0ca73
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+       exit 0
+fi
+
+if [ -e %%PREFIX%%/etc/nncp.yaml ]; then
+       echo "%%PREFIX%%/etc/nncp.yaml with your private keys is not removed!"
+fi
+
+if [ -e /var/spool/nncp ]; then
+       echo "/var/spool/nncp is not removed!"
+fi
diff --git a/ports/nncp/files/pkg-message.in b/ports/nncp/files/pkg-message.in
new file mode 100644 (file)
index 0000000..d415619
--- /dev/null
@@ -0,0 +1,17 @@
+======================================================================
+- Add the following line to /etc/rc.conf to enable nncp-daemon:
+
+    nncp_daemon_enable="YES"
+
+- Add the following line to /etc/rc.conf to enable nncp-caller:
+
+    nncp_caller_enable="YES"
+
+- %%PREFIX%%/etc/newsyslog.conf.d/nncp.conf
+  log rotation configuration has been installed.
+- /var/spool/nncp is the packet spool directory.
+- Generate NNCP configuration file using the command:
+
+    # umask 077
+    # nncp-newnode > %%PREFIX%%/etc/nncp.yaml
+======================================================================
diff --git a/ports/nncp/pkg-descr b/ports/nncp/pkg-descr
new file mode 100644 (file)
index 0000000..d33b292
--- /dev/null
@@ -0,0 +1,16 @@
+NNCP (Node to Node copy) is a collection of utilities simplifying
+secure store-and-forward files and mail exchanging.
+
+This utilities are intended to help build up small size (dozens of
+nodes) ad-hoc friend-to-friend (F2F) statically routed darknet networks
+for fire-and-forget secure reliable files, file requests and Internet
+mail transmission. All packets are integrity checked, end-to-end
+encrypted (E2EE), explicitly authenticated by known participants public
+keys. Onion encryption is applied to relayed packets. Each node acts
+both as a client and server, can use push and poll behaviour model.
+
+Out-of-box offline sneakernet/floppynet, dead drops and air-gapped
+computers support. But online TCP daemon with full-duplex resumable data
+transmission exists.
+
+WWW: http://www.nncpgo.org/