1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
9 DESCRIPTION="Scripts necessary for use of vdr as a set-top-box"
10 HOMEPAGE="https://www.gentoo.org/"
11 SRC_URI="mirror://gentoo/${P}.tar.bz2
12 https://dev.gentoo.org/~hd_brummy/distfiles/${P}.tar.bz2"
16 KEYWORDS="amd64 ~arm ~ppc x86"
19 RDEPEND="nvram? ( sys-power/nvram-wakeup )
21 sys-process/wait_on_pid"
28 # Add user vdr to these groups:
29 # video - accessing dvb-devices
30 # audio - playing sound when using software-devices
31 # cdrom - playing dvds/audio-cds ...
32 enewuser vdr -1 /bin/bash "${VDR_HOME}" vdr,video,audio,cdrom
36 # moved into own package
37 sed -e '/SUBDIRS =/s# bin # #' -i usr/Makefile
38 sed -e '/all:/s#compile##' -i Makefile
43 dodoc README* TODO ChangeLog
45 # create necessary directories
50 for kd in shutdown-data merged-config-files dvd-images; do
51 keepdir "${VDR_HOME}/${kd}"
57 if [[ -f "${ROOT}"/etc/conf.d/vdr.plugins ]]; then
58 PLUGINS_NEW=$(grep -v '^#' "${ROOT}"/etc/conf.d/vdr.plugins |grep -v '^$'|wc -l)
60 if [[ ${PLUGINS_NEW} > 0 ]]; then
61 cp "${ROOT}"/etc/conf.d/vdr.plugins "${D}"/etc/conf.d/vdr.plugins
63 einfo "Migrating PLUGINS setting from /etc/conf.d/vdr to /etc/conf.d/vdr.plugins"
65 for PLUGIN in $(source "${ROOT}"/etc/conf.d/vdr;echo $PLUGINS); do
66 echo ${PLUGIN} >> "${D}"/etc/conf.d/vdr.plugins
70 has_version "<${CATEGORY}/${PN}-0.5.4"
71 previous_less_than_0_5_4=$?
73 has_version "<${CATEGORY}/${PN}-2.6"
74 previous_less_than_2_6=$?
77 VDRSUDOENTRY="vdr ALL=NOPASSWD:/usr/share/vdr/bin/vdrshutdown-really.sh"
80 if [[ $previous_less_than_0_5_4 = 0 ]] ; then
81 elog "\nVDR use now default the --cachedir parameter to store the epg.file"
82 elog "Please do not override this with the EPGFILE variable\n"
84 elog "svdrp port 2001 support removed\n"
86 elog "--rcu support removed, use media-plugin/vdr-rcu\n"
89 if [[ $previous_less_than_2_6 = 0 ]]; then
90 elog "${CATEGORY}/${PN} supports now a init script"
91 elog "to start a X server"
92 elog "Please refer for detailed info to"
93 elog "${CATGORY}/${PN} README.x11-setup\n"
97 elog "nvram wakeup is optional."
98 elog "To make use of it emerge sys-power/nvram-wakeup.\n"
101 elog "Plugins which should be used are now set via its"
102 elog "own config-file called /etc/conf.d/vdr.plugins"
103 elog "or enabled via the frontend eselect vdr-plugin.\n"
105 if [[ -f "${ROOT}"/etc/conf.d/vdr.dvdswitch ]] &&
106 grep -q ^DVDSWITCH_BURNSPEED= "${ROOT}"/etc/conf.d/vdr.dvdswitch
108 ewarn "You are setting DVDSWITCH_BURNSPEED in /etc/conf.d/vdr.dvdswitch"
109 ewarn "This no longer has any effect, please use"
110 ewarn "VDR_DVDBURNSPEED in /etc/conf.d/vdr.cd-dvd"
113 elog "systemd is supported by ${CATEGORY}/${PN}"
114 elog "Please read for detailed info on this"
115 elog "${CATEGORY}/${PN} README.systemd"
119 if grep -q /usr/share/vdr/bin/vdrshutdown-really.sh "${ROOT}"/etc/sudoers; then
121 einfo "Removing depricated entry from /etc/sudoers:"
122 einfo "- ${VDRSUDOENTRY}"
125 cat >sudoedit-vdr.sh <<-SUDOEDITOR
127 sed -i \${1} -e '/\/usr\/share\/vdr\/bin\/vdrshutdown-really.sh *$/d'
130 chmod a+x sudoedit-vdr.sh
132 VISUAL="${T}"/sudoedit-vdr.sh visudo -f "${ROOT}"/etc/sudoers || die "visudo failed"
134 einfo "Edited /etc/sudoers"