summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weber <xmw@gentoo.org>2013-05-11 22:19:45 +0000
committerMichael Weber <xmw@gentoo.org>2013-05-11 22:19:45 +0000
commit9057d28ab43392315e19bea1c19e9eddc2e64fd3 (patch)
tree5a5bb14f45041825d23ad283f647b2b33e6ee2d6 /net-misc/minidlna
parentConvert to distutils-r1. (diff)
downloadgentoo-2-9057d28ab43392315e19bea1c19e9eddc2e64fd3.tar.gz
gentoo-2-9057d28ab43392315e19bea1c19e9eddc2e64fd3.tar.bz2
gentoo-2-9057d28ab43392315e19bea1c19e9eddc2e64fd3.zip
Fix exec name in init.d and service files (thanks BT, bug 469366)
(Portage version: 2.2.0_alpha174/cvs/Linux x86_64, signed Manifest commit with key 62EEF090)
Diffstat (limited to 'net-misc/minidlna')
-rw-r--r--net-misc/minidlna/ChangeLog8
-rw-r--r--net-misc/minidlna/files/minidlna-1.1.0.initd53
-rw-r--r--net-misc/minidlna/files/minidlna-1.1.0.service13
-rw-r--r--net-misc/minidlna/minidlna-1.1.0-r1.ebuild83
4 files changed, 156 insertions, 1 deletions
diff --git a/net-misc/minidlna/ChangeLog b/net-misc/minidlna/ChangeLog
index 40389fbcaac2..ac4c5cdf65c4 100644
--- a/net-misc/minidlna/ChangeLog
+++ b/net-misc/minidlna/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-misc/minidlna
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/minidlna/ChangeLog,v 1.32 2013/05/09 08:18:30 xmw Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/minidlna/ChangeLog,v 1.33 2013/05/11 22:19:45 xmw Exp $
+
+*minidlna-1.1.0-r1 (11 May 2013)
+
+ 11 May 2013; Michael Weber <xmw@gentoo.org> +files/minidlna-1.1.0.initd,
+ +files/minidlna-1.1.0.service, +minidlna-1.1.0-r1.ebuild:
+ Fix exec name in init.d and service files (thanks BT, bug 469366)
09 May 2013; Michael Weber <xmw@gentoo.org> minidlna-1.1.0.ebuild:
Add config file
diff --git a/net-misc/minidlna/files/minidlna-1.1.0.initd b/net-misc/minidlna/files/minidlna-1.1.0.initd
new file mode 100644
index 000000000000..d820aef67fc2
--- /dev/null
+++ b/net-misc/minidlna/files/minidlna-1.1.0.initd
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/minidlna/files/minidlna-1.1.0.initd,v 1.1 2013/05/11 22:19:45 xmw Exp $
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting MiniDLNA"
+ local params=""
+ local stop=0
+
+ checkpath -q -d -m 0755 -o ${M_USER:-minidlna}:${M_GROUP:-minidlna} /var/run/minidlna
+
+ params="$params -P /var/run/minidlna/minidlna.pid"
+
+ if [[ "${RESCAN}" = "true" || "{$RESCAN}" = yes ]]; then
+ params="$params -R"
+ fi
+
+ #set the config file and check if it exists
+ if [ -z "${CONFIG}" ]; then
+ if [ ! -f "/etc/minidlna.conf" ]; then
+ ewarn "You did not set the config file correctly"
+ stop=1
+ fi
+ params="$params -f /etc/minidlna.conf"
+ else
+ if [ ! -f "${CONFIG}" ]; then
+ ewarn "The specified config file does not exist"
+ stop=1
+ fi
+ params="$params -f ${CONFIG}"
+ fi
+
+
+ if [ $stop -eq 1 ]; then
+ eend 1
+ else
+ start-stop-daemon --start \
+ --user ${M_USER:-minidlna} --group ${M_GROUP:-minidlna} \
+ --exec /usr/sbin/minidlnad -- ${params}
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping MiniDLNA"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/minidlnad
+ eend $?
+}
diff --git a/net-misc/minidlna/files/minidlna-1.1.0.service b/net-misc/minidlna/files/minidlna-1.1.0.service
new file mode 100644
index 000000000000..908b1d59f45d
--- /dev/null
+++ b/net-misc/minidlna/files/minidlna-1.1.0.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=MiniDLNA is a DLNA/UPnP-AV server software
+After=syslog.target local-fs.target network.target
+
+[Service]
+User=minidlna
+Group=minidlna
+Type=forking
+PIDFile=/var/run/minidlna/minidlna.pid
+ExecStart=/usr/sbin/minidlnad -f /etc/minidlna.conf -P /var/run/minidlna/minidlna.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/minidlna/minidlna-1.1.0-r1.ebuild b/net-misc/minidlna/minidlna-1.1.0-r1.ebuild
new file mode 100644
index 000000000000..491e52cf3166
--- /dev/null
+++ b/net-misc/minidlna/minidlna-1.1.0-r1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/minidlna/minidlna-1.1.0-r1.ebuild,v 1.1 2013/05/11 22:19:45 xmw Exp $
+
+EAPI=4
+
+inherit eutils systemd toolchain-funcs user
+
+DESCRIPTION="DLNA/UPnP-AV compliant media server"
+HOMEPAGE="http://minidlna.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PV}/${P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="dev-db/sqlite
+ media-libs/flac
+ media-libs/libexif
+ media-libs/libid3tag
+ media-libs/libogg
+ media-libs/libvorbis
+ virtual/ffmpeg
+ virtual/jpeg"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+pkg_setup() {
+ local my_is_new="yes"
+ [ -d "${EPREFIX}"/var/lib/${PN} ] && my_is_new="no"
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
+ if [ -d "${EPREFIX}"/var/lib/${PN} ] && [ "${my_is_new}" == "yes" ] ; then
+ # created by above enewuser command w/ wrong group and permissions
+ chown ${PN}:${PN} "${EPREFIX}"/var/lib/${PN} || die
+ chmod 0750 "${EPREFIX}"/var/lib/${PN} || die
+ # if user already exists, but /var/lib/minidlna is missing
+ # rely on ${D}/var/lib/minidlna created in src_install
+ fi
+}
+
+src_prepare() {
+ sed -e "/log_dir/s:/var/log:/var/log/${PN}:" \
+ -i ${PN}.conf || die
+
+ epatch_user
+}
+
+src_configure() {
+ econf \
+ --disable-silent-rules \
+ --with-db-path=/var/cache/${PN} \
+ --with-log-path=/var/log/${PN} \
+ --enable-tivo \
+ --enable-netgear \
+ --enable-readynas
+}
+
+src_install() {
+ default
+
+ insinto /etc
+ doins ${PN}.conf
+
+ newconfd "${FILESDIR}"/${PN}-1.0.25.confd ${PN}
+ newinitd "${FILESDIR}"/${PN}-1.1.0.initd ${PN}
+ systemd_newunit "${FILESDIR}"/${PN}-1.1.0.service ${PN}.service
+
+ dodir /var/{lib,log}/${PN}
+ fowners ${PN}:${PN} /var/{lib,log}/${PN}
+ fperms 0750 /var/{lib,log}/${PN}
+
+ dodoc AUTHORS NEWS README TODO
+ doman ${PN}d.8 ${PN}.conf.5
+}
+
+pkg_postinst() {
+ elog "minidlna now runs as minidlna:minidlna (bug 426726),"
+ elog "logfile is moved to /var/log/minidlna/minidlna.log,"
+ elog "cache is moved to /var/lib/minidlna."
+ elog "Please edit /etc/conf.d/${PN} and file ownerships to suit your needs."
+}