From owner-svn-ports-all@freebsd.org Sun Jun 25 19:48:36 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDF91D98D03; Sun, 25 Jun 2017 19:48:36 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7DFD7BAF0; Sun, 25 Jun 2017 19:48:36 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5PJmZqW080700; Sun, 25 Jun 2017 19:48:35 GMT (envelope-from madpilot@FreeBSD.org) Received: (from madpilot@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5PJmZGR080697; Sun, 25 Jun 2017 19:48:35 GMT (envelope-from madpilot@FreeBSD.org) Message-Id: <201706251948.v5PJmZGR080697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: madpilot set sender to madpilot@FreeBSD.org using -f From: Guido Falsi Date: Sun, 25 Jun 2017 19:48:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r444321 - in head/deskutils/calibre: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jun 2017 19:48:37 -0000 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@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 + +---