diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2005-08-07 13:55:43 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2005-08-07 13:55:43 +0000 |
commit | 42f42536b4b495d6603cf93d7d4d13ab0672bca9 (patch) | |
tree | 0f9f366b0dd5c44c3819c562a34f6ec60e1f63e3 /eclass/vdr-plugin.eclass | |
parent | masking vdr-femon because of dependency on masked vdr (diff) | |
download | gentoo-2-42f42536b4b495d6603cf93d7d4d13ab0672bca9.tar.gz gentoo-2-42f42536b4b495d6603cf93d7d4d13ab0672bca9.tar.bz2 gentoo-2-42f42536b4b495d6603cf93d7d4d13ab0672bca9.zip |
added automatically installed files, added vdrplugindb - code from moduledb in linux-mod.eclass
Diffstat (limited to 'eclass/vdr-plugin.eclass')
-rw-r--r-- | eclass/vdr-plugin.eclass | 71 |
1 files changed, 68 insertions, 3 deletions
diff --git a/eclass/vdr-plugin.eclass b/eclass/vdr-plugin.eclass index 31d1caa7dc24..dead4aba6916 100644 --- a/eclass/vdr-plugin.eclass +++ b/eclass/vdr-plugin.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.1 2005/07/23 15:11:25 zzam Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.2 2005/08/07 13:55:43 zzam Exp $ # # Author: # Matthias Schwarzott <zzam@gentoo.org> @@ -24,12 +24,30 @@ # # +# There are some special files in ${FILESDIR} which get installed when +# they exist: + +# ${FILESDIR}/confd-${PV} or ${FILESDIR}/confd: +# The first matching is installed under /etc/conf.d/vdr.${VDRPLUGIN} +# (in example vdr-femon this would be /etc/conf.d/vdr.femon) +# +# Everything put in variable _EXTRAOPTS is appended to the command line of +# the plugin. + + +# ${FILESDIR}/rc-addon-${PV}.sh or ${FILESDIR}/rc-addon.sh: +# The first matching is installed under /usr/lib/vdr/rcscript/vdr.${VDRPLUGIN}.sh +# (in example vdr-femon this would be /usr/lib/vdr/rcscript/vdr.femon.sh) +# +# This file is sourced by the startscript when plugin is activated in /etc/conf.d/vdr +# It could be used for special startup actions for this plugins, or to create the +# plugin command line options from a nicer version of a conf.d file. inherit eutils flag-o-matic # Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes VDRPLUGIN="${PN/#vdrplugin-/}" -VDRPLUGIN="${PN/#vdr-/}" +VDRPLUGIN="${VDRPLUGIN/#vdr-/}" VDRPLUGIN="${VDRPLUGIN/%-cvs/}" DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin.eclass)" @@ -47,10 +65,36 @@ DEPEND="|| ( # Where should the plugins live in the filesystem VDR_PLUGIN_DIR="/usr/lib/vdr/plugins" +VDR_RC_DIR="/usr/lib/vdr/rcscript" + # Pathes to includes VDR_INCLUDE_DIR="/usr/include" DVB_INCLUDE_DIR="/usr/include" + +# this code is from linux-mod.eclass +update_vdrplugindb() { + local VDRPLUGINDB_DIR=${ROOT}/var/lib/vdrplugins-rebuild/ + + if [[ ! -f ${VDRPLUGINDB_DIR}/vdrplugindb ]]; then + [[ ! -d ${VDRPLUGINDB_DIR} ]] && mkdir -p ${VDRPLUGINDB_DIR} + touch ${VDRPLUGINDB_DIR}/vdrplugindb + fi + if [[ -z $(grep ${CATEGORY}/${PN}-${PVR} ${VDRPLUGINDB_DIR}/vdrplugindb) ]]; then + einfo "Adding plugin to vdrplugindb." + echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${VDRPLUGINDB_DIR}/vdrplugindb + fi +} + +remove_vdrplugindb() { + local VDRPLUGINDB_DIR=${ROOT}/var/lib/vdrplugins-rebuild/ + + if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${VDRPLUGINDB_DIR}/vdrplugindb) ]]; then + einfo "Removing ${CATEGORY}/${PN}-${PVR} from vdrplugindb." + sed -ie "/.*${CATEGORY}\/${P}.*/d" ${VDRPLUGINDB_DIR}/vdrplugindb + fi +} + vdr-plugin_pkg_setup() { # -fPIC is needed for shared objects on some platforms (amd64 and others) append-flags -fPIC @@ -102,13 +146,34 @@ vdr-plugin_src_install() { insinto "${VDR_PLUGIN_DIR}" doins libvdr-*.so.* dodoc README* HISTORY CHANGELOG + + for f in ${FILESDIR}/confd-${PV} ${FILESDIR}/confd; do + if [[ -f "${f}" ]]; then + insinto /etc/conf.d + newins "${f}" vdr.${VDRPLUGIN} + break + fi + done + + for f in ${FILESDIR}/rc-addon-${PV}.sh ${FILESDIR}/rc-addon.sh; do + if [[ -f "${f}" ]]; then + insinto "${VDR_RC_DIR}" + newins "${f}" vdr.${VDRPLUGIN}.sh + break + fi + done } vdr-plugin_pkg_postinst() { + update_vdrplugindb einfo einfo "The vdr plugin ${VDRPLUGIN} has now been installed," einfo "to activate it you have to add it to /etc/conf.d/vdr." einfo } -EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst +vdr-plugin_pkg_postrm() { + remove_vdrplugindb +} + +EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm |