Thanks to Michael Orlitzky for the suggestions.
Package-Manager: Portage-2.3.8, Repoman-2.3.3
# NOTE: The minimum value allowed is 49152
GERBERA_PORT=49152
-# Run Gerbera as this user.
-# NOTE: For security reasons do not run Gerbera as root.
-GERBERA_USER="gerbera"
-
-# Run Gerbera as this group.
-# NOTE: For security reasons do not run Gerbera as root.
-GERBERA_GROUP="gerbera"
-
# Path to Gerbera config file.
GERBERA_CONFIG="/etc/gerbera/config.xml"
GERBERA_LOGFILE="/var/log/gerbera.log"
# Other options you want to pass to Gerbera.
-# Add "--interface ${GERBERA_INTERFACE}" to bind to a named interface.
+# Add "--interface eth0" to bind to a named interface.
GERBERA_OPTIONS=""
+
+# Uncomment if you are running Gerbera against a local MySQL
+# rc_need="mysql"
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+command="/usr/bin/gerbera"
+command_args="--logfile ${GERBERA_LOGFILE}
+ --config ${GERBERA_CONFIG}
+ --port ${GERBERA_PORT}
+ ${GERBERA_OPTIONS}"
+command_user="gerbera:gerbera"
+command_background=true
+start_stop_daemon_args="--wait 500"
+retry="10"
+pidfile="/run/${RC_SVCNAME}.pid"
+
depend() {
need net
- # In order to properly support this (need vs use), we would have to
- # parse ${GERBERA_CONFIG} and see if mysql is enabled and if it is
- # pointing to the local system. #368409
- use mysql
-}
-
-start() {
- ebegin "Starting Gerbera"
-
- checkpath --directory --owner "${GERBERA_USER}:${GERBERA_GROUP}" --mode 0755 /run/gerbera
- checkpath --file --owner "${GERBERA_USER}:${GERBERA_GROUP}" --mode 0644 "${GERBERA_LOGFILE}"
-
- start-stop-daemon \
- --start \
- --exec /usr/bin/gerbera \
- --user ${GERBERA_USER} \
- --group ${GERBERA_GROUP} \
- --background \
- --wait 500 \
- -- \
- --pidfile /run/gerbera/gerbera.pid \
- --logfile ${GERBERA_LOGFILE} \
- --config ${GERBERA_CONFIG} \
- --port ${GERBERA_PORT} \
- ${GERBERA_OPTIONS}
- eend $?
}
-stop () {
- ebegin "Stopping Gerbera"
- start-stop-daemon --stop --retry 10 --quiet --pidfile /run/gerbera/gerbera.pid
- eend $?
+start_pre() {
+ checkpath --owner "gerbera:gerbera" \
+ --mode 0644 \
+ --file "${GERBERA_LOGFILE}"
}
+++ /dev/null
-d /run/gerbera 0755 gerbera gerbera -
\ No newline at end of file
inherit cmake-utils eutils linux-info systemd tmpfiles user
if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://github.com/v00d00/${PN}.git"
+ EGIT_REPO_URI="https://github.com/gerbera/${PN}.git"
KEYWORDS=""
SRC_URI=""
inherit git-r3
else
- SRC_URI="https://github.com/v00d00/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ SRC_URI="https://github.com/gerbera/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
S="${WORKDIR}/${P}"
fi
use mysql && systemd_dounit "${S}/scripts/systemd/${PN}-mysql.service"
newinitd "${FILESDIR}/${PN}-1.0.0.initd" "${PN}"
- use mysql || sed -i -e "/use mysql/d" "${ED}/etc/init.d/${PN}"
newconfd "${FILESDIR}/${PN}-1.0.0.confd" "${PN}"
insinto /etc/${PN}
newins "${FILESDIR}/${PN}-1.0.0.config" config.xml
- fperms 0600 /etc/${PN}/config.xml
- fowners gerbera:gerbera /etc/${PN}/config.xml
+ fperms 0640 /etc/${PN}/config.xml
+ fowners root:gerbera /etc/${PN}/config.xml
keepdir /var/lib/${PN}
fowners ${PN}:${PN} /var/lib/${PN}
-
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf
}
pkg_postinst() {
inherit cmake-utils eutils linux-info systemd tmpfiles user
if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://github.com/v00d00/${PN}.git"
+ EGIT_REPO_URI="https://github.com/gerbera/${PN}.git"
KEYWORDS=""
SRC_URI=""
inherit git-r3
else
- SRC_URI="https://github.com/v00d00/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ SRC_URI="https://github.com/gerbera/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
S="${WORKDIR}/${P}"
fi
use mysql && systemd_dounit "${S}/scripts/systemd/${PN}-mysql.service"
newinitd "${FILESDIR}/${PN}-1.0.0.initd" "${PN}"
- use mysql || sed -i -e "/use mysql/d" "${ED}/etc/init.d/${PN}"
newconfd "${FILESDIR}/${PN}-1.0.0.confd" "${PN}"
insinto /etc/${PN}
newins "${FILESDIR}/${PN}-1.0.0.config" config.xml
- fperms 0600 /etc/${PN}/config.xml
- fowners gerbera:gerbera /etc/${PN}/config.xml
+ fperms 0640 /etc/${PN}/config.xml
+ fowners root:gerbera /etc/${PN}/config.xml
keepdir /var/lib/${PN}
fowners ${PN}:${PN} /var/lib/${PN}
-
- newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf
}
pkg_postinst() {