diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-01-14 18:27:01 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-01-14 18:27:01 +0000 |
commit | 7edef3fd01e233b432f8a868632beed76b0bf21f (patch) | |
tree | c36538e1053a1817d30bdf15bedfd2bd0b87ba27 /app-text | |
parent | Version bump wrt #395721 (diff) | |
download | gentoo-2-7edef3fd01e233b432f8a868632beed76b0bf21f.tar.gz gentoo-2-7edef3fd01e233b432f8a868632beed76b0bf21f.tar.bz2 gentoo-2-7edef3fd01e233b432f8a868632beed76b0bf21f.zip |
0.8.35 version bump, with calibre-server init script thanks to Erik Zeek <zeekec@mad.scientist.com> from bug #397913.
(Portage version: 2.2.0_alpha84/cvs/Linux i686)
Diffstat (limited to 'app-text')
-rw-r--r-- | app-text/calibre/ChangeLog | 10 | ||||
-rw-r--r-- | app-text/calibre/calibre-0.8.35.ebuild (renamed from app-text/calibre/calibre-0.8.33.ebuild) | 17 | ||||
-rw-r--r-- | app-text/calibre/files/calibre-server.conf | 13 | ||||
-rw-r--r-- | app-text/calibre/files/calibre-server.init | 59 |
4 files changed, 95 insertions, 4 deletions
diff --git a/app-text/calibre/ChangeLog b/app-text/calibre/ChangeLog index d3a8f71a8351..bed16f57bdf6 100644 --- a/app-text/calibre/ChangeLog +++ b/app-text/calibre/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-text/calibre # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.179 2012/01/06 09:42:16 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.180 2012/01/14 18:27:01 zmedico Exp $ + +*calibre-0.8.35 (14 Jan 2012) + + 14 Jan 2012; Zac Medico <zmedico@gentoo.org> +calibre-0.8.35.ebuild, + +files/calibre-server.conf, +files/calibre-server.init, + -calibre-0.8.33.ebuild: + 0.8.35 version bump, with calibre-server init script thanks to Erik Zeek + <zeekec@mad.scientist.com> from bug #397913. *calibre-0.8.34 (06 Jan 2012) diff --git a/app-text/calibre/calibre-0.8.33.ebuild b/app-text/calibre/calibre-0.8.35.ebuild index f3573777998a..b0db591b210b 100644 --- a/app-text/calibre/calibre-0.8.33.ebuild +++ b/app-text/calibre/calibre-0.8.35.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-0.8.33.ebuild,v 1.1 2011/12/30 22:06:55 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-0.8.35.ebuild,v 1.1 2012/01/14 18:27:01 zmedico Exp $ EAPI=4 PYTHON_DEPEND=2:2.7 @@ -73,6 +73,14 @@ src_prepare() { sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \ -i setup/install.py || die "sed failed to patch install.py" + sed -e "/^ self\\.check_call(qmc + \\[ext\\.name+'\\.pro'\\])$/a\ +\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \ +'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \ +'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \ +'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \ +'-i', 'Makefile'])" \ + -i setup/extensions.py || die "sed failed to patch extensions.py" + distutils_src_prepare } @@ -109,7 +117,7 @@ src_install() { mkdir -p "${XDG_CONFIG_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" # Bug #334243 - respect LDFLAGS when building calibre-mount-helper - export OVERRIDE_CFLAGS="$CFLAGS $LDFLAGS" + export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS" local libdir=$(get_libdir) [[ -n $libdir ]] || die "get_libdir returned an empty string" @@ -159,6 +167,9 @@ src_install() { find "${ED}"usr/etc -type d -empty -delete python_convert_shebangs -r $(python_get_version) "${ED}" + + newinitd "${FILESDIR}"/calibre-server.init calibre-server + newconfd "${FILESDIR}"/calibre-server.conf calibre-server } pkg_postinst() { diff --git a/app-text/calibre/files/calibre-server.conf b/app-text/calibre/files/calibre-server.conf new file mode 100644 index 000000000000..c1bed84289cc --- /dev/null +++ b/app-text/calibre/files/calibre-server.conf @@ -0,0 +1,13 @@ +# /etc/conf.d/calibre-server +# Change this to the user you want to run calibre-server as. +# You may specify a group too, after a colon +# NOTE: This must be set and not to root! +CALIBRE_USER= + +# Set the path of the library to serve. +# Defaults to the default location for CALIBRE_USER. +#CALIBRE_LIBRARY='<user home directory>/Calibre Library' + +# Extra options to pass to calibre-server. +# See the calibre-server man page for more options. +#CALIBRE_OPTS="--username calibre --password password --thread-pool 10 --port 8080" diff --git a/app-text/calibre/files/calibre-server.init b/app-text/calibre/files/calibre-server.init new file mode 100644 index 000000000000..f17270721bf4 --- /dev/null +++ b/app-text/calibre/files/calibre-server.init @@ -0,0 +1,59 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/files/calibre-server.init,v 1.1 2012/01/14 18:27:01 zmedico Exp $ + +depend() { + need net + need localmount + after bootmisc +} + +checkconfig() { + if [ "${CALIBRE_USER}" = "" -o "${CALIBRE_USER}" = "root" ] ; then + eerror "Please edit /etc/conf.d/calibre-server" + eerror "You have to specify a user to run calibre-server as, as we will not run it as root!" + eerror "Modify CALIBRE_USER to your needs (you can also add a group, after a colon)" + return 1 + fi + if ! getent passwd "${CALIBRE_USER%:*}" >/dev/null ; then + eerror "Please edit /etc/conf.d/calibre-server" + eerror "Your user has to exist!" + return 1 + fi + if [ "${CALIBRE_USER%:*}" != "${CALIBRE_USER}" ] ; then + if ! getent group "${CALIBRE_USER#*:}" >/dev/null ; then + eerror "Please edit /etc/conf.d/calibre-server" + eerror "Your group has to exist too!" + return 1 + fi + fi + if [ "${CALIBRE_LIBRARY}" = "" ] ; then + CALIBRE_USER_HOME=$(getent passwd "${CALIBRE_USER%:*}" | cut -d ':' -f 6) + CALIBRE_LIBRARY="${CALIBRE_USER_HOME}/Calibre Library" + fi + if [ ! -d "${CALIBRE_LIBRARY}" ] ; then + eerror "Please edit /etc/conf.d/calibre-server" + eerror "The Calibre library, '${CALIBRE_LIBRARY},' does not exist." + eerror "Please modify CALIBRE_LIBRARY to point to a valid library." + return 1 + fi + return 0 +} + +start() { + checkconfig || return $? + local pidfile=/var/run/calibre-server.pid + ebegin "Starting calibre-server" + start-stop-daemon --user "${CALIBRE_USER}" \ + --pidfile "${pidfile}" --make-pidfile --background --exec /usr/bin/calibre-server \ + -- --with-library "${CALIBRE_LIBRARY}" ${CALIBRE_OPTS} + eend $? +} + +stop() { + ebegin "Stopping calibre-server" + start-stop-daemon --stop --user "${CALIBRE_USER}" \ + --pidfile /var/run/calibre-server.pid + eend $? +} |