/[gentoo-x86]/media-tv/gentoo-vdr-scripts/gentoo-vdr-scripts-0.5.3.ebuild
Gentoo

Contents of /media-tv/gentoo-vdr-scripts/gentoo-vdr-scripts-0.5.3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Jan 20 18:17:34 2013 UTC (20 months ago) by hd_brummy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +3 -3 lines
stable amd64 x86

(Portage version: 2.1.11.31/cvs/Linux i686, signed Manifest commit with key 34C2808A)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-tv/gentoo-vdr-scripts/gentoo-vdr-scripts-0.5.3.ebuild,v 1.1 2012/10/07 19:13:58 hd_brummy Exp $
4
5 EAPI="4"
6
7 inherit eutils user
8
9 DESCRIPTION="Scripts necessary for use of vdr as a set-top-box"
10 HOMEPAGE="http://www.gentoo.org/"
11 SRC_URI="mirror://gentoo/${P}.tar.bz2
12 http://dev.gentoo.org/~hd_brummy/distfiles/${P}.tar.bz2"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="amd64 ~arm ~ppc x86"
17 IUSE="nvram"
18
19 RDEPEND="nvram? ( sys-power/nvram-wakeup )
20 app-admin/sudo
21 sys-process/wait_on_pid"
22
23 VDR_HOME=/var/vdr
24
25 pkg_setup() {
26 enewgroup vdr
27
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
33 }
34
35 src_prepare() {
36 # moved into own package
37 sed -e '/SUBDIRS =/s# bin # #' -i usr/Makefile
38 sed -e '/all:/s#compile##' -i Makefile
39 }
40
41 src_install() {
42 emake -s install DESTDIR="${D}" || die "make install failed"
43 dodoc README TODO ChangeLog
44
45 # create necessary directories
46 diropts -ovdr -gvdr
47 keepdir "${VDR_HOME}"
48
49 local kd
50 for kd in shutdown-data merged-config-files dvd-images tmp; do
51 keepdir "${VDR_HOME}/${kd}"
52 done
53 }
54
55 pkg_preinst() {
56 local PLUGINS_NEW=0
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)
59 fi
60 if [[ ${PLUGINS_NEW} > 0 ]]; then
61 cp "${ROOT}"/etc/conf.d/vdr.plugins "${D}"/etc/conf.d/vdr.plugins
62 else
63 einfo "Migrating PLUGINS setting from /etc/conf.d/vdr to /etc/conf.d/vdr.plugins"
64 local PLUGIN
65 for PLUGIN in $(source "${ROOT}"/etc/conf.d/vdr;echo $PLUGINS); do
66 echo ${PLUGIN} >> "${D}"/etc/conf.d/vdr.plugins
67 done
68 fi
69
70 has_version "<${CATEGORY}/${PN}-0.5.0_rc3"
71 previous_less_than_0_5_0_rc3=$?
72 }
73
74 VDRSUDOENTRY="vdr ALL=NOPASSWD:/usr/share/vdr/bin/vdrshutdown-really.sh"
75
76 pkg_postinst() {
77 if [[ $previous_less_than_0_5_0_rc3 = 0 ]] ; then
78
79 if grep -q /usr/share/vdr/bin/vdrshutdown-really.sh "${ROOT}"/etc/sudoers; then
80 eerror
81 eerror "Depricated sudo entry in /etc/sudoers"
82 eerror
83 fi
84
85 einfo "new file /etc/sudoers.d/vdr added"
86 echo
87 ewarn "IMPORTEND !!!"
88 ewarn "Please migrate to new sudo handling"
89 echo
90 ewarn "Upgrade Info:"
91 ewarn
92 ewarn "To keep the shutdown work correctly, remove the line from /etc/sudoers"
93 ewarn "\t${VDRSUDOENTRY}"
94 echo
95 ewarn "or execute this command:"
96 ewarn "\temerge --config gentoo-vdr-scripts"
97 echo
98 fi
99
100 elog "nvram wakeup is optional."
101 elog "To make use of it emerge sys-power/nvram-wakeup."
102 elog
103
104 elog "Plugins which should be used are now set via its"
105 elog "own config-file called /etc/conf.d/vdr.plugins"
106 elog "or enabled via the frontend eselect vdr-plugin."
107 elog
108
109 if [[ -f "${ROOT}/etc/init.d/dvbsplash" ]]; then
110 ewarn
111 ewarn "You have dvbsplash installed!"
112 ewarn "/etc/init.d/dvbsplash will now be deleted"
113 ewarn "as it causes difficult to debug problems."
114 ewarn
115 rm "${ROOT}/etc/init.d/dvbsplash"
116 fi
117
118 if [[ -f "${ROOT}"/etc/conf.d/vdr.dvdswitch ]] &&
119 grep -q ^DVDSWITCH_BURNSPEED= "${ROOT}"/etc/conf.d/vdr.dvdswitch
120 then
121 ewarn "You are setting DVDSWITCH_BURNSPEED in /etc/conf.d/vdr.dvdswitch"
122 ewarn "This no longer has any effect, please use"
123 ewarn "VDR_DVDBURNSPEED in /etc/conf.d/vdr.cd-dvd"
124 fi
125 }
126
127 pkg_config() {
128 if grep -q /usr/share/vdr/bin/vdrshutdown-really.sh "${ROOT}"/etc/sudoers; then
129
130 einfo "Removing depricated entry from /etc/sudoers:"
131 einfo "- ${VDRSUDOENTRY}"
132
133 cd "${T}"
134 cat >sudoedit-vdr.sh <<-SUDOEDITOR
135 #!/bin/bash
136 sed -i \${1} -e '/\/usr\/share\/vdr\/bin\/vdrshutdown-really.sh *$/d'
137
138 SUDOEDITOR
139 chmod a+x sudoedit-vdr.sh
140
141 VISUAL="${T}"/sudoedit-vdr.sh visudo -f "${ROOT}"/etc/sudoers || die "visudo failed"
142
143 einfo "Edited /etc/sudoers"
144 fi
145 }

  ViewVC Help
Powered by ViewVC 1.1.20