From owner-svn-ports-all@freebsd.org Tue Jul 28 03:59:35 2015 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3ED29AB788; Tue, 28 Jul 2015 03:59:35 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A30B888; Tue, 28 Jul 2015 03:59:35 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6S3xZTD078238; Tue, 28 Jul 2015 03:59:35 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6S3xZbs078235; Tue, 28 Jul 2015 03:59:35 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201507280359.t6S3xZbs078235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 28 Jul 2015 03:59:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r393051 - in head/net-mgmt/seafile: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2015 03:59:35 -0000 Author: araujo Date: Tue Jul 28 03:59:34 2015 New Revision: 393051 URL: https://svnweb.freebsd.org/changeset/ports/393051 Log: - Add an rc.d script to be able to start seafile. - Bump PORTREVISION. Differential Revision: D3210 Reviewed by: koobs, bapt Sponsored by: gandi.net Added: head/net-mgmt/seafile/files/seafile.in (contents, props changed) Modified: head/net-mgmt/seafile/Makefile Modified: head/net-mgmt/seafile/Makefile ============================================================================== --- head/net-mgmt/seafile/Makefile Tue Jul 28 03:26:42 2015 (r393050) +++ head/net-mgmt/seafile/Makefile Tue Jul 28 03:59:34 2015 (r393051) @@ -2,7 +2,7 @@ PORTNAME= seafile PORTVERSION= 4.0.6 -PORTREVISION= 2 +PORTREVISION= 3 DISTVERSIONPREFIX= v DISTVERSIONSUFFIX= -server CATEGORIES= net-mgmt devel @@ -50,6 +50,7 @@ SEALIB= ${SEAFILE_SERVER}/seafile/lib SEAFILE_USERNAME?= www SEAFILE_GROUPNAME?= ${SEAFILE_USERNAME} +USE_RC_SUBR= ${PORTNAME} PLIST_SUB= SEAFILE_USERNAME=${SEAFILE_USERNAME} \ SEAFILE_GROUPNAME=${SEAFILE_GROUPNAME} \ SEAFILE_SERVER=${SEAFILE_SERVER} \ Added: head/net-mgmt/seafile/files/seafile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/seafile/files/seafile.in Tue Jul 28 03:59:34 2015 (r393051) @@ -0,0 +1,59 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: seafile +# REQUIRE: LOGIN cleanvar +# KEYWORD: shutdown +# + +# +# Add the following lines to /etc/rc.conf to enable seafile: +# +# seafile_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable seafile. +# seafile_path (str): Set to "" by default will use the path +# /usr/local/www/haiwen/seafile-server. +# Set it to a different path. + +. /etc/rc.subr + +name="seafile" +rcvar=seafile_enable + +load_rc_config $name + +start_cmd="${name}_start" +restart_cmd="${name}_restart" +stop_cmd="${name}_stop" + +: ${seafile_path:=%%PREFIX%%/www/haiwen/seafile-server} + +command="$seafile_path/seafile.sh" + +seafile_start() +{ + if checkyesno ${name}_enable; then + start_script="${seafile_path}/seafile.sh" + echo "Starting seafile service" + $command start + else + return 0 + fi +} + +seafile_stop() +{ + echo "Stoping seafile service" + $command stop +} + +seafile_restart() +{ + echo "Restart seafile service" + $command restart +} + +load_rc_config $name +run_rc_command "$1"