freebsd-ports/www/py-kallithea/files/kallithea.in
Jan Beich caa27d7366 www/py-kallithea: add new port
PR:		210605
Submitted by:	Ilia Skalozubov <freebsd@skinc.ru>

Kallithea is a fast and powerful management tool for Mercurial and Git with a
built-in push/pull server, full text search and code-review. It works on
http/https and has a built in permission/authentication system with the ability
to authenticate via LDAP or ActiveDirectory. Kallithea also provides simple API
so it's easy to integrate with existing external systems.

Kallithea is similar in some respects to GitHub or Bitbucket, however Kallithea
can be run as standalone hosted application on your own server. It is
open-source donationware and focuses more on providing a customised,
self-administered interface for Mercurial and Git repositories. Kallithea works
on Unix-like systems and Windows, and is powered by the vcs library created by
Lukasz Balcerzak and Marcin Kuzminski to uniformly handle multiple version
control systems.

Kallithea was forked from RhodeCode in July 2014 and has been heavily modified.

http://kallithea-scm.org/
2016-07-20 23:14:26 +00:00

75 lines
2 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: kallithea
# REQUIRE: NETWORKING FILESYSTEMS mountlate
# KEYWORD: shutdown
. /etc/rc.subr
name=kallithea
rcvar=kallithea_enable
desc="Fast and powerful management tool for Mercurial and Git"
load_rc_config ${name}
: ${kallithea_enable:=NO}
: ${kallithea_config=%%PREFIX%%/etc/kallithea.ini}
: ${kallithea_user:=www}
: ${kallithea_group:=www}
: ${kallithea_logfile=/var/log/kallithea/kallithea.log}
: ${kallithea_pidfile=/var/run/kallithea/kallithea.pid}
rcvars="kallithea_config kallithea_user kallithea_group kallithea_logfile kallithea_pidfile"
kallithea_enable_desc="Set to YES to enable kallithea"
kallithea_enable_defval=NO
kallithea_config_desc="Kallithea config file for paster"
kallithea_config_defval=%%PREFIX%%/etc/kallithea.ini
kallithea_user_desc="Set the user for paster"
kallithea_user_defval=www
kallithea_group_desc="Set the group for paster"
kallithea_group_defval=www
kallithea_logfile_desc="Save output to the given log file (redirects stdout)"
kallithea_logfile_defval=/var/log/kallithea/kallithea.log
kallithea_pidfile_desc="Save PID to file"
kallithea_pidfile_defval=/var/run/kallithea/kallithea.pid
command=%%PREFIX%%/bin/paster
pidfile="${kallithea_pidfile}"
required_files="${kallithea_config}"
command_args=" serve --user=${kallithea_user} --group=${kallithea_group} --pid-file=${pidfile} --log-file=${kallithea_logfile} --daemon ${kallithea_config}"
start_precmd=kallithea_prestart
status_cmd=kallithea_status
stop_cmd=kallithea_stop
kallithea_prestart()
{
for _file in "${kallithea_logfile}" "${pidfile}"; do
_dir="${_file%/*}"
if [ ! -e "$_dir" ]; then
install -d -o ${kallithea_user} "${_dir}"
elif [ -f "$_dir" ]; then
echo "Not a directory: $_dir"
return 20
fi
done
}
kallithea_status()
{
${command} serve --pid-file=${pidfile} --status ${kallithea_config}
return $?
}
kallithea_stop()
{
echo "Stopping ${name}."
${command} serve --pid-file=${pidfile} --stop-daemon
return $?
}
run_rc_command "$1"