Gentoo Archives: gentoo-commits

From: Michael Weber <xmw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/minidlna/files/, net-misc/minidlna/
Date: Tue, 23 Feb 2016 20:36:59
Message-Id: 1456259732.944a94cacf7df1c8179eabcbe6d24640ea06bae1.xmw@gentoo
1 commit: 944a94cacf7df1c8179eabcbe6d24640ea06bae1
2 Author: Michael Weber <xmw <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 23 20:30:09 2016 +0000
4 Commit: Michael Weber <xmw <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 23 20:35:32 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=944a94ca
7
8 net-misc/minidlna: Revbump to new init script (https://github.com/gentoo/gentoo/pull/137, thanks jirutka).
9
10 Package-Manager: portage-2.2.27
11
12 net-misc/minidlna/files/minidlna-1.1.5.initd | 33 ++++++++++
13 net-misc/minidlna/minidlna-1.1.5-r1.ebuild | 96 ++++++++++++++++++++++++++++
14 2 files changed, 129 insertions(+)
15
16 diff --git a/net-misc/minidlna/files/minidlna-1.1.5.initd b/net-misc/minidlna/files/minidlna-1.1.5.initd
17 new file mode 100644
18 index 0000000..c4cb33f
19 --- /dev/null
20 +++ b/net-misc/minidlna/files/minidlna-1.1.5.initd
21 @@ -0,0 +1,33 @@
22 +#!/sbin/openrc-run
23 +# Copyright 1999-2016 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +# $Id$
26 +
27 +: ${CONFIG:=/etc/minidlna.conf}
28 +: ${M_USER:=minidlna}
29 +: ${M_GROUP:=minidlna}
30 +
31 +name="MiniDLNA"
32 +
33 +pidfile="/run/minidlna/minidlna.pid"
34 +command="/usr/sbin/minidlnad"
35 +command_args="-P $pidfile -f $CONFIG"
36 +start_stop_daemon_args="--user ${M_USER}:${M_GROUP}"
37 +
38 +required_files="$CONFIG"
39 +
40 +depend() {
41 + need net
42 +}
43 +
44 +start_pre() {
45 + if [ "$M_USER" = "root" ]; then
46 + eerror "It's not a good idea to run minidlna as root!"
47 + fi
48 +
49 + if yesno "$RESCAN"; then
50 + command_args="$command_args -R"
51 + fi
52 +
53 + checkpath -q -d -m 0750 -o "${M_USER}:${M_GROUP}" "$(dirname "$pidfile")"
54 +}
55
56 diff --git a/net-misc/minidlna/minidlna-1.1.5-r1.ebuild b/net-misc/minidlna/minidlna-1.1.5-r1.ebuild
57 new file mode 100644
58 index 0000000..877534e
59 --- /dev/null
60 +++ b/net-misc/minidlna/minidlna-1.1.5-r1.ebuild
61 @@ -0,0 +1,96 @@
62 +# Copyright 1999-2016 Gentoo Foundation
63 +# Distributed under the terms of the GNU General Public License v2
64 +# $Id$
65 +
66 +EAPI=5
67 +
68 +inherit eutils linux-info systemd toolchain-funcs user
69 +
70 +DESCRIPTION="DLNA/UPnP-AV compliant media server"
71 +HOMEPAGE="http://minidlna.sourceforge.net/"
72 +SRC_URI="mirror://sourceforge/${PN}/${PV}/${P}.tar.gz
73 + https://dev.gentoo.org/~xmw/${PN}-gentoo-artwork.patch.xz"
74 +
75 +LICENSE="BSD GPL-2"
76 +SLOT="0"
77 +KEYWORDS="~amd64 ~arm ~x86"
78 +IUSE="netgear readynas"
79 +
80 +RDEPEND="dev-db/sqlite:3
81 + media-libs/flac
82 + media-libs/libexif
83 + media-libs/libid3tag
84 + media-libs/libogg
85 + media-libs/libvorbis
86 + virtual/ffmpeg
87 + virtual/jpeg:0"
88 +DEPEND="${RDEPEND}
89 + virtual/pkgconfig"
90 +
91 +CONFIG_CHECK="~INOTIFY_USER"
92 +
93 +pkg_setup() {
94 + local my_is_new="yes"
95 + [ -d "${EPREFIX}"/var/lib/${PN} ] && my_is_new="no"
96 + enewgroup ${PN}
97 + enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
98 + if [ -d "${EPREFIX}"/var/lib/${PN} ] && [ "${my_is_new}" == "yes" ] ; then
99 + # created by above enewuser command w/ wrong group and permissions
100 + chown ${PN}:${PN} "${EPREFIX}"/var/lib/${PN} || die
101 + chmod 0750 "${EPREFIX}"/var/lib/${PN} || die
102 + # if user already exists, but /var/lib/minidlna is missing
103 + # rely on ${D}/var/lib/minidlna created in src_install
104 + fi
105 +
106 + linux-info_pkg_setup
107 +}
108 +
109 +src_prepare() {
110 + sed -e "/log_dir/s:/var/log:/var/log/${PN}:" \
111 + -e "/db_dir/s:/var/cache/:/var/lib/:" \
112 + -i ${PN}.conf || die
113 +
114 + epatch "${WORKDIR}"/${PN}-gentoo-artwork.patch
115 +
116 + epatch_user
117 +}
118 +
119 +src_configure() {
120 + econf \
121 + --disable-silent-rules \
122 + --with-db-path=/var/lib/${PN} \
123 + --with-log-path=/var/log/${PN} \
124 + --enable-tivo \
125 + $(use_enable netgear) \
126 + $(use_enable readynas)
127 +}
128 +
129 +src_install() {
130 + default
131 +
132 + #bug 536532
133 + dosym /usr/sbin/${PN}d /usr/bin/${PN}
134 +
135 + insinto /etc
136 + doins ${PN}.conf
137 +
138 + newconfd "${FILESDIR}"/${PN}-1.0.25.confd ${PN}
139 + newinitd "${FILESDIR}"/${PN}-1.1.5.initd ${PN}
140 + systemd_newunit "${FILESDIR}"/${PN}-1.1.2.service ${PN}.service
141 + echo "d /run/${PN} 0755 ${PN} ${PN} -" > "${T}"/${PN}.conf
142 + systemd_dotmpfilesd "${T}"/${PN}.conf
143 +
144 + dodir /var/{lib,log}/${PN}
145 + fowners ${PN}:${PN} /var/{lib,log}/${PN}
146 + fperms 0750 /var/{lib,log}/${PN}
147 +
148 + dodoc AUTHORS NEWS README TODO
149 + doman ${PN}d.8 ${PN}.conf.5
150 +}
151 +
152 +pkg_postinst() {
153 + elog "minidlna now runs as minidlna:minidlna (bug 426726),"
154 + elog "logfile is moved to /var/log/minidlna/minidlna.log,"
155 + elog "cache is moved to /var/lib/minidlna."
156 + elog "Please edit /etc/conf.d/${PN} and file ownerships to suit your needs."
157 +}