diff options
Diffstat (limited to 'devel/viewvc/files')
-rw-r--r-- | devel/viewvc/files/pkg-message.in | 74 | ||||
-rw-r--r-- | devel/viewvc/files/viewvc.in | 70 |
2 files changed, 144 insertions, 0 deletions
diff --git a/devel/viewvc/files/pkg-message.in b/devel/viewvc/files/pkg-message.in new file mode 100644 index 000000000000..e12163bc856d --- /dev/null +++ b/devel/viewvc/files/pkg-message.in @@ -0,0 +1,74 @@ +[ +{ type: install + message: <<EOM + To use ViewVC, modify the configuration file located at + %%PREFIX%%/viewvc/viewvc.conf. + + If no webserver was selected during installation, then + a rc script for running ViewVC standalone is installed. + To enable the standalone ViewVC server in rc.conf use + parameter viewvc_enable="YES". + + You can also adjust the user which runs the ViewVC standalone + server with the parameter "viewvc_user". + + If you want to run the ViewVC standalone server with another + IP/PORT, use the parameter "viewvc_flags". + + To see all available parameters, use the command + %%PREFIX%%/viewvc/bin/standalone.py --help + + + To use ViewVC with Apache or lighttpd as a CGI script, + see the following config examples. + + Example config lines for Apache 2.4 + =================================== + <IfModule wsgi_module> + WSGIRestrictSignal Off + </IfModule> + + <IfModule !wsgi_module> + ScriptAlias "/viewvc" "%%PREFIX%%/viewvc/bin/cgi/viewvc.cgi" + </IfModule> + + <IfModule wsgi_module> + WSGIScriptAlias "/viewvc" "%%PREFIX%%/viewvc/bin/wsgi/viewvc.wsgi" + </IfModule> + + <Location /viewvc> + Options NONE +ExecCGI + </Location> + + Example config lines for lighttpd + ================================= + server.modules = ( + "mod_alias", + "mod_access" + ) + + alias.url += ( "/viewvc" => "%%PREFIX%%/viewvc/bin/cgi" ) + + $HTTP["url"] =~ "^/viewvc/" { + index-file.names = ( "viewvc.cgi" ) + cgi.assign = ( + ".cgi" => "%%PYTHON_CMD%%", + ) + } +EOM +} +{ + type: upgrade + maximum_version: "1.2.1" + message: <<EOM + Please review your vievc.conf, see viewvc.sample.conf + ====================================================== + - the template path has changed + - the vhost notation has changed + + Additional upgrade informations: + https://github.com/viewvc/viewvc/blob/master/docs/upgrading-howto.html + +EOM +} +] diff --git a/devel/viewvc/files/viewvc.in b/devel/viewvc/files/viewvc.in new file mode 100644 index 000000000000..064ff67ab917 --- /dev/null +++ b/devel/viewvc/files/viewvc.in @@ -0,0 +1,70 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: viewvc +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following line(s) to /etc/rc.conf to enable ViewVC: +# +# viewvc_enable="YES" +# # optional +# viewvc_flags="-h localhost -p PORT" +# viewvc_user="www" +# +# To get available parameters and the default values, use the +# command %%PREFIX%%/viewvc/bin/standalone.py --help +# for more info. +# +# Note: +# If you choose a listen port less then 1024 then you have +# to use a privileged user. +# If the user www cannot access your cvs/svn repository, +# adjust the parameter viewvc_user and it should work. +# +# INFO: +# ViewVC default tcp port: 49152 +# see http://viewvc.tigris.org/issues/show_bug.cgi?id=234 + +. /etc/rc.subr + +name=viewvc +rcvar=viewvc_enable +load_rc_config $name + +# Set defaults +viewvc_enable=${viewvc_enable:-"NO"} +viewvc_flags=${viewvc_flags:-"-p 49152"} +viewvc_user=${viewvc_user:-"www"} + +pidfile=/var/run/viewvc.pid +command=%%PYTHON_CMD%% +standalone=%%PREFIX%%/viewvc/bin/standalone.py + +start_precmd=viewvc_precmd +start_cmd=viewvc_start +stop_postcmd=viewvc_cleanup + +viewvc_precmd() +{ + # with param -d we get another pid so prevent this + %%ECHO%% "${viewvc_flags}" | %%EGREP%% -q "(^\-d| \-d)" 2>&1 > /dev/null + if [ $? -eq 0 ]; then + %%ECHO%% "Please remove parameter -d from viewvc_flags" + %%ECHO%% + return 1 + fi +} + +viewvc_start() { + echo "Starting viewvc." + %%TOUCH%% ${pidfile} && %%CHOWN%% ${viewvc_user} ${pidfile} + /usr/sbin/daemon -cf -p ${pidfile} -u ${viewvc_user} ${standalone} ${viewvc_flags} +} + +viewvc_cleanup() { + [ -f ${pidfile} ] && %%RM%% ${pidfile} +} + +run_rc_command "$1" |