svn commit: r444321 - in head/deskutils/calibre: . files
Guido Falsi
madpilot at FreeBSD.org
Sun Jun 25 19:48:37 UTC 2017
Author: madpilot
Date: Sun Jun 25 19:48:35 2017
New Revision: 444321
URL: https://svnweb.freebsd.org/changeset/ports/444321
Log:
- 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 at gmail.com
Modified:
head/deskutils/calibre/Makefile
head/deskutils/calibre/files/calibre.in
head/deskutils/calibre/pkg-message
Modified: head/deskutils/calibre/Makefile
==============================================================================
--- head/deskutils/calibre/Makefile Sun Jun 25 19:29:03 2017 (r444320)
+++ head/deskutils/calibre/Makefile Sun Jun 25 19:48:35 2017 (r444321)
@@ -3,6 +3,7 @@
PORTNAME= calibre
PORTVERSION= 3.1.0
+PORTREVISION= 1
CATEGORIES= deskutils python
MASTER_SITES= http://download.calibre-ebook.com/${PORTVERSION}/
Modified: head/deskutils/calibre/files/calibre.in
==============================================================================
--- head/deskutils/calibre/files/calibre.in Sun Jun 25 19:29:03 2017 (r444320)
+++ head/deskutils/calibre/files/calibre.in Sun Jun 25 19:48:35 2017 (r444321)
@@ -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_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
+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
- 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}
+command_args="${command_args} --log ${calibre_logfile} --pidfile ${pidfile} --max-log-size ${calibre_logsize} --daemonize ${calibre_library}"
+
+calibre_prestart()
+{
+ install -d -o ${calibre_user} -m 755 /var/run/${name}
+ install -d -o ${calibre_user} -m 755 `dirname ${calibre_logfile}`
}
run_rc_command "$1"
Modified: head/deskutils/calibre/pkg-message
==============================================================================
--- head/deskutils/calibre/pkg-message Sun Jun 25 19:29:03 2017 (r444320)
+++ head/deskutils/calibre/pkg-message Sun Jun 25 19:48:35 2017 (r444321)
@@ -32,3 +32,14 @@ supported by calibre. The calibre FAQ recommends that
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
+
+---
More information about the svn-ports-head
mailing list