aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpi <pi@FreeBSD.org>2016-08-18 02:10:01 +0800
committerpi <pi@FreeBSD.org>2016-08-18 02:10:01 +0800
commit8922c6879ec2c5d93ef0d438cd1d32c36f016eb1 (patch)
tree87b2f4cc648df7ead75292132763537cb7cc8ef5
parent8c5b3b13145c067f4a974e1fdaa33ed8fe40c994 (diff)
downloadfreebsd-ports-gnome-8922c6879ec2c5d93ef0d438cd1d32c36f016eb1.tar.gz
freebsd-ports-gnome-8922c6879ec2c5d93ef0d438cd1d32c36f016eb1.tar.zst
freebsd-ports-gnome-8922c6879ec2c5d93ef0d438cd1d32c36f016eb1.zip
New port: net-p2p/libswift
LibSwift is the reference UDP-based implementation of IETF RFC7574, a multi-peer transport layer protocol. Its mission is to disseminate content among a swarm of peers. Given a root hash, the data is received from whatever source available and data integrity is checked cryptographically with Merkle hash trees. WWW: https://tools.ietf.org/html/rfc7574 PR: 211945 Submitted by: Dave Cottlehuber <dch@skunkwerks.at>
-rw-r--r--net-p2p/Makefile1
-rw-r--r--net-p2p/libswift/Makefile48
-rw-r--r--net-p2p/libswift/distinfo3
-rw-r--r--net-p2p/libswift/files/libswift.in49
-rw-r--r--net-p2p/libswift/pkg-descr9
-rw-r--r--net-p2p/libswift/pkg-plist3
6 files changed, 113 insertions, 0 deletions
diff --git a/net-p2p/Makefile b/net-p2p/Makefile
index cb71851235cc..efcf92806a52 100644
--- a/net-p2p/Makefile
+++ b/net-p2p/Makefile
@@ -44,6 +44,7 @@
SUBDIR += liberator
SUBDIR += libktorrent
SUBDIR += libpdtp
+ SUBDIR += libswift
SUBDIR += libtorrent
SUBDIR += libtorrent-rasterbar
SUBDIR += libtorrent-rasterbar-python
diff --git a/net-p2p/libswift/Makefile b/net-p2p/libswift/Makefile
new file mode 100644
index 000000000000..de706bfa1076
--- /dev/null
+++ b/net-p2p/libswift/Makefile
@@ -0,0 +1,48 @@
+# Created by: Dave Cottlehuber <dch@skunkwerks.at>
+# $FreeBSD$
+
+PORTNAME= libswift
+PORTVERSION= 20160817
+CATEGORIES= net-p2p
+
+MAINTAINER= dch@skunkwerks.at
+COMMENT= IETF Peer-to-Peer Streaming Peer Protocol implementation
+
+LICENSE= LGPL21
+
+LIB_DEPENDS= libevent.so:devel/libevent2
+
+USE_GITHUB= yes
+GH_TAGNAME= dda307f
+
+USES= gmake ssl
+
+PORTDOCS= README.md
+
+SUB_FILES= ${PORTNAME}
+SUB_LIST+= SWIFT_USER=${SWIFT_USER} \
+ SWIFT_GROUP=${SWIFT_GROUP} \
+ SWIFT_SHAREDIR=${SWIFT_SHAREDIR} \
+ SWIFT_PIDDIR=${SWIFT_PIDDIR}
+
+PLIST_SUB= SWIFT_USER=${SWIFT_USER} \
+ SWIFT_GROUP=${SWIFT_GROUP} \
+ SWIFT_SHAREDIR=${SWIFT_SHAREDIR} \
+ SWIFT_PIDDIR=${SWIFT_PIDDIR}
+
+SWIFT_USER?= www
+SWIFT_GROUP?= www
+
+SWIFT_SHAREDIR= /var/db/${PORTNAME}/
+SWIFT_PIDDIR= /var/run/${PORTNAME}/
+
+USE_RC_SUBR= ${PORTNAME}
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DOCSDIR} \
+ ${STAGEDIR}${SWIFT_SHAREDIR} \
+ ${STAGEDIR}${SWIFT_PIDDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_PROGRAM} ${WRKSRC}/swift ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.mk>
diff --git a/net-p2p/libswift/distinfo b/net-p2p/libswift/distinfo
new file mode 100644
index 000000000000..0198466999ed
--- /dev/null
+++ b/net-p2p/libswift/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1471446348
+SHA256 (libswift-libswift-20160817-dda307f_GH0.tar.gz) = 3ba3153097bb2c516c94393f3d376b8c5bc36c284138b49219ec45bbcd821281
+SIZE (libswift-libswift-20160817-dda307f_GH0.tar.gz) = 3329674
diff --git a/net-p2p/libswift/files/libswift.in b/net-p2p/libswift/files/libswift.in
new file mode 100644
index 000000000000..7a5fcf4edc65
--- /dev/null
+++ b/net-p2p/libswift/files/libswift.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# PROVIDE: libswift
+# REQUIRE: LOGIN NETWORKING SERVERS
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# libswift_enable (bool): Set to NO by default.
+# Set it to YES to enable swift.
+#
+# libswift_user (user): Set to www by default.
+# libswift_group (group): Set to www by default.
+# libswift_port (num): Port for daemon to listen on, 7777 by default.
+# libswift_dir (string): Optional full path to streaming content directory.
+
+. /etc/rc.subr
+
+name=libswift
+rcvar=libswift_enable
+
+load_rc_config ${name}
+
+# defaults
+libswift_enable=${libswift_enable:-"NO"}
+libswift_user=${libswift_user:-"www"}
+libswift_port=${libswift_port:-"7777"}
+libswift_dir=${libswift_dir:-"/var/db/${name}"}
+libswift_options=${libswift_options:-" --dir ${libswift_dir} --listen ${libswift_port}"}
+
+# daemon
+
+libswift_pidfile="%%SWIFT_PIDDIR%%${name}.pid"
+procname="%%PREFIX%%/bin/${name}"
+
+command=/usr/sbin/daemon
+command_args=" -c -f -p ${libswift_pidfile} ${procname} ${libswift_flags} ${libswift_options}"
+
+start_precmd=libswift_precmd
+
+libswift_precmd()
+{
+ # create empty pidfile with correct permissions
+ install -o ${libswift_user} /dev/null ${libswift_pidfile}
+}
+
+run_rc_command "$1"
diff --git a/net-p2p/libswift/pkg-descr b/net-p2p/libswift/pkg-descr
new file mode 100644
index 000000000000..ac583d91c390
--- /dev/null
+++ b/net-p2p/libswift/pkg-descr
@@ -0,0 +1,9 @@
+LibSwift is the reference UDP-based implementation of IETF RFC7574,
+a multi-peer transport layer protocol. Its mission is to disseminate
+content among a swarm of peers.
+
+Given a root hash, the data is received from whatever source available
+and data integrity is checked cryptographically with Merkle hash
+trees.
+
+WWW: https://tools.ietf.org/html/rfc7574
diff --git a/net-p2p/libswift/pkg-plist b/net-p2p/libswift/pkg-plist
new file mode 100644
index 000000000000..9e724aa7bf2f
--- /dev/null
+++ b/net-p2p/libswift/pkg-plist
@@ -0,0 +1,3 @@
+bin/libswift
+@dir(%%SWIFT_USER%%,%%SWIFT_GROUP%%,0750) %%SWIFT_PIDDIR%%
+@dir(%%SWIFT_USER%%,%%SWIFT_GROUP%%,0755) %%SWIFT_SHAREDIR%%