diff options
author | araujo <araujo@FreeBSD.org> | 2015-07-28 12:02:13 +0800 |
---|---|---|
committer | araujo <araujo@FreeBSD.org> | 2015-07-28 12:02:13 +0800 |
commit | d2d4d67641c7d8f3da722a819df404352f362355 (patch) | |
tree | f0d3d7ac887fe88927fedded5ec04afa4c60925f /www | |
parent | f45fb0cc93c4eff5d63104261bff9e555af05f01 (diff) | |
download | freebsd-ports-gnome-d2d4d67641c7d8f3da722a819df404352f362355.tar.gz freebsd-ports-gnome-d2d4d67641c7d8f3da722a819df404352f362355.tar.zst freebsd-ports-gnome-d2d4d67641c7d8f3da722a819df404352f362355.zip |
- Add an rc.d script to be able to start seahub.
- Bump PORTREVISION.
Differential Revision: D3211
Reviewed by: koobs, bapt
Sponsored by: gandi.net
Diffstat (limited to 'www')
-rw-r--r-- | www/seahub/Makefile | 2 | ||||
-rw-r--r-- | www/seahub/files/seahub.in | 72 |
2 files changed, 74 insertions, 0 deletions
diff --git a/www/seahub/Makefile b/www/seahub/Makefile index 2d45e2aab32c..fbeec8821fa9 100644 --- a/www/seahub/Makefile +++ b/www/seahub/Makefile @@ -2,6 +2,7 @@ PORTNAME= seahub PORTVERSION= 4.0.5 +PORTREVISION= 1 DISTVERSIONPREFIX= v DISTVERSIONSUFFIX= -pro CATEGORIES= www @@ -76,6 +77,7 @@ SITEPACKAGEDIR= ${SEAHUBDIR}/thirdpart 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} \ diff --git a/www/seahub/files/seahub.in b/www/seahub/files/seahub.in new file mode 100644 index 000000000000..7e347b0bd6a6 --- /dev/null +++ b/www/seahub/files/seahub.in @@ -0,0 +1,72 @@ +#!/bin/sh +# +# PROVIDE: seahub +# REQUIRE: LOGIN cleanvar +# KEYWORD: shutdown +# + +# +# Add the following lines to /etc/rc.conf to enable seahub: +# +# seahub_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable seahub. +# seahub_fastcgi (bool): Set to "NO" by default. +# Set to "YES" to start the fastcgi mode. +# seahub_port (str): Default is 8000. +# seahub_path (str): Set to "" by default will use the path +# /usr/local/www/haiwen/seahub-server. +# Set it to a different path. + +. /etc/rc.subr + +name="seahub" +rcvar=seahub_enable + +load_rc_config $name + +start_cmd="${name}_start" +restart_cmd="${name}_restart" +stop_cmd="${name}_stop" + +: ${seahub_path:=%%PREFIX%%/www/haiwen/seafile-server} +: ${seahub_port:=8000} + +command="$seahub_path/seahub.sh" + +seahub_start() +{ + echo ${seahub_path} + echo ${seahub_port} + + if checkyesno ${name}_enable; then + if checkyesno ${name}_fastcgi; then + echo "Starting seahub service fastcgi mode" + $command start-fastcgi ${seahub_port} + else + echo "Starting seahub service" + $command start ${seahub_port} %{seahub_port} + fi + else + return 0 + fi +} + +seahub_stop() +{ + echo "Stoping seahub service" + $command stop +} + +seahub_restart() +{ + if checkyesno ${name}_fastcgi; then + echo "Restarting seahub service fastcgi mode" + $command restart-fastcgi ${seahub_port} + else + echo "Restarting seahub service" + $command restart ${seahub_port} + fi +} + +load_rc_config $name +run_rc_command "$1" |