--- gentoo-vdr-scripts-2.0.0.ebuild 2013-07-07 12:01:25.000000000 +0200 +++ gentoo-vdr-scripts-2.0.0-r1.ebuild 2014-01-05 17:40:35.000000000 +0100 @@ -4,7 +4,7 @@ EAPI="5" -inherit eutils user +inherit eutils user systemd DESCRIPTION="Scripts necessary for use of vdr as a set-top-box" HOMEPAGE="http://www.gentoo.org/" @@ -50,6 +50,17 @@ for kd in shutdown-data merged-config-files dvd-images tmp; do keepdir "${VDR_HOME}/${kd}" done + + # install systemd unit file + systemd_dounit "${FILESDIR}/vdr.service" + # install systemd helper script which uses OpenRC-based framework + exeinto "/usr/share/vdr/bin" + doexe "${FILESDIR}/vdr-systemd_helper.sh" + # create empty environment exchange file and set correct permissions + touch "${D}${VDR_HOME}/tmp/systemd_env" + fowners vdr:vdr "${VDR_HOME}/tmp/systemd_env" + insinto "/etc/systemd/system/vdr.service.d" + doins "${FILESDIR}/00-gentoo-vdr-user.conf" } pkg_preinst() { @@ -108,6 +119,17 @@ ewarn "This no longer has any effect, please use" ewarn "VDR_DVDBURNSPEED in /etc/conf.d/vdr.cd-dvd" fi + + ewarn "" + ewarn "If using systemd, you can still customize any of the" + ewarn "'/etc/conf.d/vdr*' config files as you would do when using OpenRC." + ewarn "The only thing you have to take special care of is how to deal with running" + ewarn "the VDR service either as user 'vdr' or as user 'root'." + ewarn "If you have to set START_VDR_AS_ROOT=yes in /etc/conf.d/vdr, then" + ewarn "you need to set 'User=root' in" + ewarn "'/etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf' and viceversa." + ewarn "Make sure you toggle these 2 user settings in sync and" + ewarn "ONLY when the VDR service is STOPPED !!!!" } pkg_config() {