# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 inherit systemd user DESCRIPTION="Serviio DLNA Media Server" HOMEPAGE="http://serviio.org/" SRC_URI="http://download.serviio.org/releases/${P}-linux.tar.gz" LICENSE="Serviio-EULA" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="raw +transcode" DEPEND="" RDEPEND=" >=virtual/jre-1.6.0 raw? ( media-gfx/dcraw ) transcode? ( media-video/ffmpeg[encode,libass,mp3,rtmp,x264] ) " INSTALL_DIR="/opt/${PN}" DOCS=( LICENCE.txt NOTICE.txt README.txt RELEASE_NOTES.txt ) pkg_setup() { enewuser ${PN} } src_prepare() { # Prevent launcher shell scripts from persisting. Wasteful # plus systemd can't tell which process is the real one. sed -i '/^"\$JAVA" /s/^/exec /' bin/*.sh } src_install() { default rm -f "${DOCS[@]}" mv -f legal "${D}usr/share/doc/${P}/" dodir /opt mv "${S}" "${D}${INSTALL_DIR}" chown -R "${PN}:${PN}" "${D}${INSTALL_DIR}" newinitd "${FILESDIR}/initd" "${PN}" newconfd "${FILESDIR}/confd" "${PN}" systemd_newunit "${FILESDIR}/systemd.service" "${PN}.service" systemd_install_serviced "${FILESDIR}/systemd.service.conf" "${PN}.service" } pkg_postinst() { elog "Mounts needed for media library locations not on your root volume" elog "should be completed before Serviio starts. If you use systemd, see" elog "/etc/systemd/system/${PN}.service.d/00gentoo.conf." }