1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-04 01:48:54 +00:00

- Fix calibre rc script, which broke after the 3.0 update

- Add note to pkg-message on how to customize it

PR:		220249
Subitted by:	jacob.block@gmail.com
This commit is contained in:
Guido Falsi 2017-06-25 19:48:35 +00:00
parent 20b757fdae
commit a906c61978
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=444321
3 changed files with 35 additions and 23 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= calibre
PORTVERSION= 3.1.0
PORTREVISION= 1
CATEGORIES= deskutils python
MASTER_SITES= http://download.calibre-ebook.com/${PORTVERSION}/

View File

@ -16,12 +16,14 @@
# Default is calibre
# calibre_home (string): home directory for calibre_server
# Default is the home directory of calibre_user
# calibre_username (string): username for calibre authentication
# Default is calibre
# calibre_password (string): If set then access is restricted
# default is unrestricted
# calibre_url_prefix (string): prefix to append to all URLs
# default is unset
# calibre_logfile (string): log file location
# Default /var/log/calibre-server/calibre-server.log
# calibre_logsize (int): size of log file before being rotated in MBs
# Default 10 MB
# calibre_flags (string): Any further flags to customize configuration
# Default empty
# calibre_library (string): path to library folder to serve content from
#
#
@ -37,34 +39,32 @@ load_rc_config $name
: ${calibre_enable:=NO}
: ${calibre_user:=calibre}
: ${calibre_library:=/nonexistent}
: ${calibre_logfile:=/var/log/calibre-server/calibre-server.log}
: ${calibre_logsize:=10}
pidfile=/var/run/${name}/${name}.pid
command=/usr/local/bin/calibre-server
command_interpreter=python2
required_dirs=${calibre_library}
start_cmd=${name}_start
start_precmd=calibre_prestart
start_precmd="install -d -o ${calibre_user} -m755 /var/run/${name}"
calibre_home=${calibre_home:-$(getent passwd ${calibre_user} | awk -F: '{print $6}')}
calibre_env="${calibre_env} HOME=${calibre_home:-/nonexistent}"
calibre_start()
if [ ! -z "${calibre_port}" ]; then
command_args="${command_args} --port=${calibre_port}"
fi
if [ ! -z "${calibre_url_prefix}" ]; then
command_args="${command_args} --url-prefix=${calibre_url_prefix}"
fi
command_args="${command_args} --log ${calibre_logfile} --pidfile ${pidfile} --max-log-size ${calibre_logsize} --daemonize ${calibre_library}"
calibre_prestart()
{
if [ ! -z "${calibre_port}" ]; then
command_args="${command_args} --port=${calibre_port}"
fi
if [ ! -z "${calibre_username}" ]; then
command_args="${command_args} --username=${calibre_username}"
fi
if [ ! -z "${calibre_password}" ]; then
command_args="${command_args} --password=${calibre_password}"
fi
if [ ! -z "${calibre_url_prefix}" ]; then
command_args="${command_args} --url-prefix=${calibre_url_prefix}"
fi
calibre_home=${calibre_home:-$(getent passwd ${calibre_user} | awk -F: '{print $6}')}
HOME=${calibre_home:-/nonexistent}
/usr/sbin/daemon -f -u ${calibre_user} -p ${pidfile} ${command} ${command_args} --with-library ${calibre_library}
install -d -o ${calibre_user} -m 755 /var/run/${name}
install -d -o ${calibre_user} -m 755 `dirname ${calibre_logfile}`
}
run_rc_command "$1"

View File

@ -32,3 +32,14 @@ supported by calibre. The calibre FAQ recommends that either of the
free apps Aldiko or WordPlayer are used instead.
---
A basic startup script for calibre-server has been installed.
It can be customized and configured using the flags described in the
headers of the startup script.
The command line options are documented here:
https://manual.calibre-ebook.com/generated/en/calibre-server.html
---