From owner-svn-ports-head@freebsd.org Tue Sep 24 22:15:09 2019 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB032F341D; Tue, 24 Sep 2019 22:15:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46dFqd4yxpz45vG; Tue, 24 Sep 2019 22:15:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E6806210; Tue, 24 Sep 2019 22:15:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8OMF9h8081561; Tue, 24 Sep 2019 22:15:09 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OMF87L081556; Tue, 24 Sep 2019 22:15:08 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201909242215.x8OMF87L081556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 24 Sep 2019 22:15:08 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r512760 - in head/www: . tusd tusd/files X-SVN-Group: ports-head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head/www: . tusd tusd/files X-SVN-Commit-Revision: 512760 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Sep 2019 22:15:09 -0000 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@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 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 +@dir(%%TUSD_USER%%,%%TUSD_GROUP%%,750) %%TUSD_UPLOAD_DIR%%