svn commit: r512760 - in head/www: . tusd tusd/files
Martin Matuska
mm at FreeBSD.org
Tue Sep 24 22:15:09 UTC 2019
Author: mm
Date: Tue Sep 24 22:15:08 2019
New Revision: 512760
URL: https://svnweb.freebsd.org/changeset/ports/512760
Log:
tusd is the official reference implementation of the tus resumable upload
protocol. The protocol specifies a flexible method to upload files to remote
servers using HTTP. The special feature is the ability to pause and resume
uploads at any moment allowing to continue seamlessly after e.g. network
interruptions.
WWW: https://github.com/tus/tusd
Added:
head/www/tusd/
head/www/tusd/Makefile (contents, props changed)
head/www/tusd/distinfo (contents, props changed)
head/www/tusd/files/
head/www/tusd/files/tusd.in (contents, props changed)
head/www/tusd/pkg-descr (contents, props changed)
head/www/tusd/pkg-plist (contents, props changed)
Modified:
head/www/Makefile
Modified: head/www/Makefile
==============================================================================
--- head/www/Makefile Tue Sep 24 21:50:23 2019 (r512759)
+++ head/www/Makefile Tue Sep 24 22:15:08 2019 (r512760)
@@ -2386,6 +2386,7 @@
SUBDIR += trytond28_google_maps
SUBDIR += tt-rss
SUBDIR += ttf2eot
+ SUBDIR += tusd
SUBDIR += twiki
SUBDIR += twiki-BehaviourContrib
SUBDIR += twiki-BlogAddOn
Added: head/www/tusd/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/tusd/Makefile Tue Sep 24 22:15:08 2019 (r512760)
@@ -0,0 +1,55 @@
+# $FreeBSD$
+
+PORTNAME= tusd
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.0.0
+CATEGORIES= www
+
+MAINTAINER= mm at FreeBSD.org
+COMMENT= Reference server implementation in Go of tus
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+
+USES= go
+
+USE_GITHUB= yes
+GH_ACCOUNT= tus
+GO_TARGET= cmd/tusd/main.go:tusd
+
+OPTIONS_DEFINE= DOCS EXAMPLES
+
+PORTDOCS= *
+PORTEXAMPLES= *
+
+USERS= www
+GROUPS= www
+
+TUSD_UPLOAD_DIR?= /var/spool/tusd
+
+USE_RC_SUBR= tusd
+SUB_FILES= tusd
+SUB_LIST= TUSD_USER=${USERS} \
+ TUSD_GROUP=${GROUPS} \
+ TUSD_UPLOAD_DIR=${TUSD_UPLOAD_DIR}
+
+PLIST_SUB+= ${SUB_LIST}
+
+do-install:
+ ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/tusd ${STAGEDIR}${PREFIX}/bin/tusd
+ ${MKDIR} ${STAGEDIR}${TUSD_UPLOAD_DIR}
+
+do-install-DOCS-on:
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/docs/hooks.md ${STAGEDIR}${DOCSDIR}
+
+do-install-EXAMPLES-on:
+ @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/examples/apache2.conf ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/examples/nginx.conf ${STAGEDIR}${EXAMPLESDIR}
+.for FILE in post-create post-finish post-receive post-terminate pre-create
+ ${INSTALL_SCRIPT} ${WRKSRC}/examples/hooks/${FILE} ${STAGEDIR}${EXAMPLESDIR}/hooks
+.endfor
+
+.include <bsd.port.mk>
Added: head/www/tusd/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/tusd/distinfo Tue Sep 24 22:15:08 2019 (r512760)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1569320387
+SHA256 (tus-tusd-v1.0.0_GH0.tar.gz) = e3daac15554c74b8067a37e84e2867a7f6a7ce55cf5574042b5394443fbc64f3
+SIZE (tus-tusd-v1.0.0_GH0.tar.gz) = 87372
Added: head/www/tusd/files/tusd.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/tusd/files/tusd.in Tue Sep 24 22:15:08 2019 (r512760)
@@ -0,0 +1,85 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: tusd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable tusd:
+#
+# tusd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable nginx
+# tusd_user (string): Set to "%%TUSD_USER%%" by default.
+# tusd_group (string): Set to "%%TUSD_GROUP%%" by default.
+# tusd_host (string): Set to "" by default.
+# tusd_port (string): Set to "" by default.
+# tusd_upload_dir (string): Set to "%%TUSD_UPLOAD_DIR%% by default.
+
+. /etc/rc.subr
+
+name="tusd"
+rcvar=tusd_enable
+start_cmd="tusd_start"
+stop_cmd="tusd_stop"
+
+load_rc_config ${name}
+
+: ${tusd_enable="NO"}
+: ${tusd_user="%%TUSD_USER%%"}
+: ${tusd_group="%%TUSD_GROUP%%"}
+: ${tusd_host=""}
+: ${tusd_port=""}
+: ${tusd_upload_dir="%%TUSD_UPLOAD_DIR%%"}
+: ${tusd_flags=""}
+
+logfile=/var/log/tusd.log
+pidfile=/var/run/tusd.pid
+command="/usr/bin/true"
+procname="/usr/sbin/daemon"
+
+is_process_running() {
+ [ -f $pidfile ] && procstat $(cat $pidfile) >/dev/null 2>&1
+}
+
+tusd_start() {
+ if [ -n "$tusd_host" ]
+ then
+ _FLAGS="$_FLAGS -host $tusd_host"
+ fi
+ if [ -n "$tusd_port" ]
+ then
+ _FLAGS="$_FLAGS -port $tusd_port"
+ fi
+ if [ -n "$tusd_upload_dir" ]
+ then
+ _FLAGS="$_FLAGS -upload-dir $tusd_upload_dir"
+ fi
+ if [ -n "$tusd_flags" ]
+ then
+ _FLAGS="$_FLAGS $tusd_flags"
+ fi
+
+ if is_process_running; then
+ echo "tusd is already running (pid=$(cat $pidfile))"
+ return 1
+ fi
+ /usr/sbin/daemon -P $pidfile -u $tusd_user %%PREFIX%%/bin/tusd $_FLAGS >>$logfile 2>&1
+ if is_process_running; then
+ echo "started tusd (pid=$(cat $pidfile))"
+ else
+ echo "failed to start tusd"
+ fi
+}
+
+tusd_stop() {
+ if is_process_running; then
+ local pid=$(cat $pidfile)
+ echo "stopping tusd (pid=$pid)"
+ kill -- -$pid
+ else
+ echo "tusd isn't running"
+ fi
+}
+
+run_rc_command "$1"
Added: head/www/tusd/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/tusd/pkg-descr Tue Sep 24 22:15:08 2019 (r512760)
@@ -0,0 +1,7 @@
+tusd is the official reference implementation of the tus resumable upload
+protocol. The protocol specifies a flexible method to upload files to remote
+servers using HTTP. The special feature is the ability to pause and resume
+uploads at any moment allowing to continue seamlessly after e.g. network
+interruptions.
+
+WWW: https://github.com/tus/tusd
Added: head/www/tusd/pkg-plist
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/tusd/pkg-plist Tue Sep 24 22:15:08 2019 (r512760)
@@ -0,0 +1,2 @@
+bin/tusd
+ at dir(%%TUSD_USER%%,%%TUSD_GROUP%%,750) %%TUSD_UPLOAD_DIR%%
More information about the svn-ports-all
mailing list