| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.10 2005/11/30 06:53:16 zzam Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.16 2006/03/15 09:48:53 zzam Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: |
5 | # Author: |
| 6 | # Matthias Schwarzott <zzam@gentoo.org> |
6 | # Matthias Schwarzott <zzam@gentoo.org> |
| 7 | |
7 | |
| 8 | # vdr-plugin.eclass |
8 | # vdr-plugin.eclass |
| … | |
… | |
| 41 | # |
41 | # |
| 42 | # This file is sourced by the startscript when plugin is activated in /etc/conf.d/vdr |
42 | # This file is sourced by the startscript when plugin is activated in /etc/conf.d/vdr |
| 43 | # It could be used for special startup actions for this plugins, or to create the |
43 | # It could be used for special startup actions for this plugins, or to create the |
| 44 | # plugin command line options from a nicer version of a conf.d file. |
44 | # plugin command line options from a nicer version of a conf.d file. |
| 45 | |
45 | |
| 46 | inherit eutils flag-o-matic |
46 | inherit base eutils flag-o-matic |
|
|
47 | |
|
|
48 | IUSE="debug" |
| 47 | |
49 | |
| 48 | # Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes |
50 | # Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes |
| 49 | VDRPLUGIN="${PN/#vdrplugin-/}" |
51 | VDRPLUGIN="${PN/#vdrplugin-/}" |
| 50 | VDRPLUGIN="${VDRPLUGIN/#vdr-/}" |
52 | VDRPLUGIN="${VDRPLUGIN/#vdr-/}" |
| 51 | VDRPLUGIN="${VDRPLUGIN/%-cvs/}" |
53 | VDRPLUGIN="${VDRPLUGIN/%-cvs/}" |
| … | |
… | |
| 55 | # works in most cases |
57 | # works in most cases |
| 56 | S="${WORKDIR}/${VDRPLUGIN}-${PV}" |
58 | S="${WORKDIR}/${VDRPLUGIN}-${PV}" |
| 57 | |
59 | |
| 58 | # depend on headers for DVB-driver |
60 | # depend on headers for DVB-driver |
| 59 | RDEPEND="" |
61 | RDEPEND="" |
| 60 | DEPEND="|| ( |
62 | DEPEND="media-tv/linuxtv-dvb-headers" |
| 61 | >=sys-kernel/linux-headers-2.6.11-r2 |
|
|
| 62 | media-tv/linuxtv-dvb |
|
|
| 63 | )" |
|
|
| 64 | |
63 | |
| 65 | # Where should the plugins live in the filesystem |
64 | # Where should the plugins live in the filesystem |
| 66 | VDR_PLUGIN_DIR="/usr/lib/vdr/plugins" |
65 | VDR_PLUGIN_DIR="/usr/lib/vdr/plugins" |
| 67 | |
66 | |
| 68 | VDR_RC_DIR="/usr/lib/vdr/rcscript" |
67 | VDR_RC_DIR="/usr/lib/vdr/rcscript" |
| … | |
… | |
| 96 | } |
95 | } |
| 97 | |
96 | |
| 98 | vdr-plugin_pkg_setup() { |
97 | vdr-plugin_pkg_setup() { |
| 99 | # -fPIC is needed for shared objects on some platforms (amd64 and others) |
98 | # -fPIC is needed for shared objects on some platforms (amd64 and others) |
| 100 | append-flags -fPIC |
99 | append-flags -fPIC |
|
|
100 | use debug && append-flags -g |
| 101 | |
101 | |
| 102 | VDRVERSION=$(awk -F'"' '/VDRVERSION/ {print $2}' /usr/include/vdr/config.h) |
102 | VDRVERSION=$(awk -F'"' '/VDRVERSION/ {print $2}' /usr/include/vdr/config.h) |
| 103 | einfo "Building ${PF} against vdr-${VDRVERSION}" |
103 | einfo "Building ${PF} against vdr-${VDRVERSION}" |
| 104 | } |
104 | } |
| 105 | |
105 | |
| … | |
… | |
| 108 | |
108 | |
| 109 | while [ "$1" ]; do |
109 | while [ "$1" ]; do |
| 110 | |
110 | |
| 111 | case "$1" in |
111 | case "$1" in |
| 112 | unpack) |
112 | unpack) |
| 113 | unpack ${A} |
113 | base_src_unpack |
| 114 | ;; |
114 | ;; |
| 115 | patchmakefile) |
115 | patchmakefile) |
| 116 | cd ${S} |
116 | cd ${S} |
| 117 | |
117 | |
| 118 | ebegin "Patching Makefile" |
118 | ebegin "Patching Makefile" |
| … | |
… | |
| 184 | |
184 | |
| 185 | for f in ${FILESDIR}/confd-${PV} ${FILESDIR}/confd; do |
185 | for f in ${FILESDIR}/confd-${PV} ${FILESDIR}/confd; do |
| 186 | if [[ -f "${f}" ]]; then |
186 | if [[ -f "${f}" ]]; then |
| 187 | insinto /etc/conf.d |
187 | insinto /etc/conf.d |
| 188 | newins "${f}" vdr.${VDRPLUGIN} |
188 | newins "${f}" vdr.${VDRPLUGIN} |
|
|
189 | VDR_PLUGIN_CONFIG_FILE_INSTALLED=1 |
| 189 | break |
190 | break |
| 190 | fi |
191 | fi |
| 191 | done |
192 | done |
| 192 | |
193 | |
| 193 | for f in ${FILESDIR}/rc-addon-${PV}.sh ${FILESDIR}/rc-addon.sh; do |
194 | for f in ${FILESDIR}/rc-addon-${PV}.sh ${FILESDIR}/rc-addon.sh; do |
| … | |
… | |
| 195 | insinto "${VDR_RC_DIR}" |
196 | insinto "${VDR_RC_DIR}" |
| 196 | newins "${f}" plugin-${VDRPLUGIN}.sh |
197 | newins "${f}" plugin-${VDRPLUGIN}.sh |
| 197 | break |
198 | break |
| 198 | fi |
199 | fi |
| 199 | done |
200 | done |
|
|
201 | |
|
|
202 | insinto /usr/lib/vdr/checksums |
|
|
203 | if [[ -f ${ROOT}/usr/lib/vdr/checksums/header-md5-vdr ]]; then |
|
|
204 | newins ${ROOT}/usr/lib/vdr/checksums/header-md5-vdr header-md5-${PN} |
|
|
205 | else |
|
|
206 | if which md5sum >/dev/null 2>&1; then |
|
|
207 | cd ${S} |
|
|
208 | ( |
|
|
209 | cd ${ROOT}${VDR_INCLUDE_DIR}/vdr |
|
|
210 | md5sum *.h libsi/*.h|LC_ALL=C sort --key=2 |
|
|
211 | ) > header-md5-${PN} |
|
|
212 | doins header-md5-${PN} |
|
|
213 | fi |
|
|
214 | fi |
| 200 | } |
215 | } |
| 201 | |
216 | |
| 202 | vdr-plugin_pkg_postinst() { |
217 | vdr-plugin_pkg_postinst() { |
| 203 | update_vdrplugindb |
218 | update_vdrplugindb |
| 204 | einfo |
219 | einfo |
| 205 | einfo "The vdr plugin ${VDRPLUGIN} has now been installed." |
220 | einfo "The vdr plugin ${VDRPLUGIN} has now been installed." |
| 206 | einfo "To activate execute the following command:" |
221 | einfo "To activate execute the following command:" |
| 207 | einfo |
222 | einfo |
| 208 | einfo " emerge --config ${PN}" |
223 | einfo " emerge --config ${PN}" |
| 209 | einfo |
224 | einfo |
|
|
225 | if [[ -n "${VDR_PLUGIN_CONFIG_FILE_INSTALLED}" ]]; then |
|
|
226 | einfo "And have a look at the config-file" |
|
|
227 | einfo "/etc/conf.d/vdr.${VDRPLUGIN}" |
|
|
228 | einfo |
|
|
229 | fi |
| 210 | } |
230 | } |
| 211 | |
231 | |
| 212 | vdr-plugin_pkg_postrm() { |
232 | vdr-plugin_pkg_postrm() { |
| 213 | remove_vdrplugindb |
233 | remove_vdrplugindb |
| 214 | } |
234 | } |