/[gentoo-x86]/eclass/vdr-plugin.eclass
Gentoo

Diff of /eclass/vdr-plugin.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.4
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/Attic/vdr-plugin.eclass,v 1.1 2005/07/23 15:11:25 zzam Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/vdr-plugin.eclass,v 1.4 2005/08/22 16:20:30 swegener 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
20# SRC_URI="http://www.saunalahti.fi/~rahrenbe/vdr/femon/files/${P}.tgz" 20# SRC_URI="http://www.saunalahti.fi/~rahrenbe/vdr/femon/files/${P}.tgz"
21# LICENSE="GPL-2" 21# LICENSE="GPL-2"
22# KEYWORDS="~x86" 22# KEYWORDS="~x86"
23# DEPEND=">=media-video/vdr-1.3.27" 23# DEPEND=">=media-video/vdr-1.3.27"
24# 24#
25# 25#
26 26
27# There are some special files in ${FILESDIR} which get installed when
28# they exist:
29
30# ${FILESDIR}/confd-${PV} or ${FILESDIR}/confd:
31# The first matching is installed under /etc/conf.d/vdr.${VDRPLUGIN}
32# (in example vdr-femon this would be /etc/conf.d/vdr.femon)
33#
34# Everything put in variable _EXTRAOPTS is appended to the command line of
35# the plugin.
36
37
38# ${FILESDIR}/rc-addon-${PV}.sh or ${FILESDIR}/rc-addon.sh:
39# The first matching is installed under /usr/lib/vdr/rcscript/vdr.${VDRPLUGIN}.sh
40# (in example vdr-femon this would be /usr/lib/vdr/rcscript/vdr.femon.sh)
41#
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
44# plugin command line options from a nicer version of a conf.d file.
27 45
28inherit eutils flag-o-matic 46inherit eutils flag-o-matic
29 47
30# Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes 48# Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes
31VDRPLUGIN="${PN/#vdrplugin-/}" 49VDRPLUGIN="${PN/#vdrplugin-/}"
32VDRPLUGIN="${PN/#vdr-/}" 50VDRPLUGIN="${VDRPLUGIN/#vdr-/}"
33VDRPLUGIN="${VDRPLUGIN/%-cvs/}" 51VDRPLUGIN="${VDRPLUGIN/%-cvs/}"
34 52
35DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin.eclass)" 53DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin.eclass)"
36 54
37# works in most cases 55# works in most cases
45 )" 63 )"
46 64
47# Where should the plugins live in the filesystem 65# Where should the plugins live in the filesystem
48VDR_PLUGIN_DIR="/usr/lib/vdr/plugins" 66VDR_PLUGIN_DIR="/usr/lib/vdr/plugins"
49 67
68VDR_RC_DIR="/usr/lib/vdr/rcscript"
69
50# Pathes to includes 70# Pathes to includes
51VDR_INCLUDE_DIR="/usr/include" 71VDR_INCLUDE_DIR="/usr/include"
52DVB_INCLUDE_DIR="/usr/include" 72DVB_INCLUDE_DIR="/usr/include"
73
74
75# this code is from linux-mod.eclass
76update_vdrplugindb() {
77 local VDRPLUGINDB_DIR=${ROOT}/var/lib/vdrplugin-rebuild/
78
79 if [[ ! -f ${VDRPLUGINDB_DIR}/vdrplugindb ]]; then
80 [[ ! -d ${VDRPLUGINDB_DIR} ]] && mkdir -p ${VDRPLUGINDB_DIR}
81 touch ${VDRPLUGINDB_DIR}/vdrplugindb
82 fi
83 if [[ -z $(grep ${CATEGORY}/${PN}-${PVR} ${VDRPLUGINDB_DIR}/vdrplugindb) ]]; then
84 einfo "Adding plugin to vdrplugindb."
85 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${VDRPLUGINDB_DIR}/vdrplugindb
86 fi
87}
88
89remove_vdrplugindb() {
90 local VDRPLUGINDB_DIR=${ROOT}/var/lib/vdrplugin-rebuild/
91
92 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${VDRPLUGINDB_DIR}/vdrplugindb) ]]; then
93 einfo "Removing ${CATEGORY}/${PN}-${PVR} from vdrplugindb."
94 sed -ie "/.*${CATEGORY}\/${P}.*/d" ${VDRPLUGINDB_DIR}/vdrplugindb
95 fi
96}
53 97
54vdr-plugin_pkg_setup() { 98vdr-plugin_pkg_setup() {
55 # -fPIC is needed for shared objects on some platforms (amd64 and others) 99 # -fPIC is needed for shared objects on some platforms (amd64 and others)
56 append-flags -fPIC 100 append-flags -fPIC
57 101
100 cd ${S} 144 cd ${S}
101 145
102 insinto "${VDR_PLUGIN_DIR}" 146 insinto "${VDR_PLUGIN_DIR}"
103 doins libvdr-*.so.* 147 doins libvdr-*.so.*
104 dodoc README* HISTORY CHANGELOG 148 dodoc README* HISTORY CHANGELOG
149
150 for f in ${FILESDIR}/confd-${PV} ${FILESDIR}/confd; do
151 if [[ -f "${f}" ]]; then
152 insinto /etc/conf.d
153 newins "${f}" vdr.${VDRPLUGIN}
154 break
155 fi
156 done
157
158 for f in ${FILESDIR}/rc-addon-${PV}.sh ${FILESDIR}/rc-addon.sh; do
159 if [[ -f "${f}" ]]; then
160 insinto "${VDR_RC_DIR}"
161 newins "${f}" vdr.${VDRPLUGIN}.sh
162 break
163 fi
164 done
105} 165}
106 166
107vdr-plugin_pkg_postinst() { 167vdr-plugin_pkg_postinst() {
168 update_vdrplugindb
108 einfo 169 einfo
109 einfo "The vdr plugin ${VDRPLUGIN} has now been installed," 170 einfo "The vdr plugin ${VDRPLUGIN} has now been installed,"
110 einfo "to activate it you have to add it to /etc/conf.d/vdr." 171 einfo "to activate it you have to add it to /etc/conf.d/vdr."
111 einfo 172 einfo
112} 173}
113 174
175vdr-plugin_pkg_postrm() {
176 remove_vdrplugindb
177}
178
114EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst 179EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20