1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils linux-info systemd toolchain-funcs user
9 DESCRIPTION="DLNA/UPnP-AV compliant media server"
10 HOMEPAGE="http://minidlna.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${PV}/${P}.tar.gz
12 https://dev.gentoo.org/~xmw/${PN}-gentoo-artwork.patch.xz"
16 KEYWORDS="amd64 arm x86"
17 IUSE="netgear readynas"
19 RDEPEND="dev-db/sqlite:3
30 CONFIG_CHECK="~INOTIFY_USER"
34 [ -d "${EPREFIX}"/var/lib/${PN} ] && my_is_new="no"
36 enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
37 if [ -d "${EPREFIX}"/var/lib/${PN} ] && [ "${my_is_new}" == "yes" ] ; then
38 # created by above enewuser command w/ wrong group and permissions
39 chown ${PN}:${PN} "${EPREFIX}"/var/lib/${PN} || die
40 chmod 0750 "${EPREFIX}"/var/lib/${PN} || die
41 # if user already exists, but /var/lib/minidlna is missing
42 # rely on ${D}/var/lib/minidlna created in src_install
49 sed -e "/log_dir/s:/var/log:/var/log/${PN}:" \
50 -e "/db_dir/s:/var/cache/:/var/lib/:" \
53 epatch "${WORKDIR}"/${PN}-gentoo-artwork.patch
60 --disable-silent-rules \
61 --with-db-path=/var/lib/${PN} \
62 --with-log-path=/var/log/${PN} \
64 $(use_enable netgear) \
65 $(use_enable readynas)
74 newconfd "${FILESDIR}"/${PN}-1.0.25.confd ${PN}
75 newinitd "${FILESDIR}"/${PN}-1.1.2.initd ${PN}
76 systemd_newunit "${FILESDIR}"/${PN}-1.1.2.service ${PN}.service
77 echo "d /run/${PN} 0755 ${PN} ${PN} -" > "${T}"/${PN}.conf
78 systemd_dotmpfilesd "${T}"/${PN}.conf
80 dodir /var/{lib,log}/${PN}
81 fowners ${PN}:${PN} /var/{lib,log}/${PN}
82 fperms 0750 /var/{lib,log}/${PN}
84 dodoc AUTHORS NEWS README TODO
85 doman ${PN}d.8 ${PN}.conf.5
89 elog "minidlna now runs as minidlna:minidlna (bug 426726),"
90 elog "logfile is moved to /var/log/minidlna/minidlna.log,"
91 elog "cache is moved to /var/lib/minidlna."
92 elog "Please edit /etc/conf.d/${PN} and file ownerships to suit your needs."