/[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.36 Revision 1.37
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.36 2006/10/12 16:31:45 zzam Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/vdr-plugin.eclass,v 1.37 2006/10/19 10:26:10 zzam Exp $
4# 4#
5# Author: 5# Author:
6# Matthias Schwarzott <zzam@gentoo.org> 6# Matthias Schwarzott <zzam@gentoo.org>
7# Joerg Bornkessel <hd_brummy@gentoo.org> 7# Joerg Bornkessel <hd_brummy@gentoo.org>
8 8
96 96
97 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${VDRPLUGINDB_DIR}/vdrplugindb) ]]; then 97 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${VDRPLUGINDB_DIR}/vdrplugindb) ]]; then
98 einfo "Removing ${CATEGORY}/${PN}-${PVR} from vdrplugindb." 98 einfo "Removing ${CATEGORY}/${PN}-${PVR} from vdrplugindb."
99 sed -ie "/.*${CATEGORY}\/${P}.*/d" ${VDRPLUGINDB_DIR}/vdrplugindb 99 sed -ie "/.*${CATEGORY}\/${P}.*/d" ${VDRPLUGINDB_DIR}/vdrplugindb
100 fi 100 fi
101}
102
103# New method of storing plugindb
104# Called from src_install
105# file maintained by normal portage-methods
106create_plugindb_file() {
107 local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
108 local DB_FILE=${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}
109 insinto ${NEW_VDRPLUGINDB_DIR}
110 cat <<-EOT > ${D}/${DB_FILE}
111 VDRPLUGIN_DB=1
112 CREATOR=ECLASS
113 EBUILD=${CATEGORY}/${PN}
114 EBUILD_V=${PVR}
115 EOT
116}
117
118# Delete files created outside of vdr-plugin.eclass
119# vdrplugin-rebuild.ebuild converted plugindb and files are
120# not deleted by portage itself - should only be needed as
121# long as not every system has switched over to
122# vdrplugin-rebuild-0.2
123delete_orphan_plugindb_file() {
124 #einfo Testing for orphaned plugindb file
125 local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
126 local DB_FILE=${ROOT}/${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}
127
128 # file exists
129 [[ -f ${DB_FILE} ]] || return
130
131 # will portage handle the file itself
132 if grep -q CREATOR=ECLASS ${DB_FILE}; then
133 #einfo file owned by eclass - don't touch it
134 return
135 fi
136
137 einfo "Removing orphaned plugindb-file."
138 einfo "#rm ${DB_FILE}"
139 rm ${DB_FILE}
101} 140}
102 141
103vdr-plugin_pkg_setup() { 142vdr-plugin_pkg_setup() {
104 # -fPIC is needed for shared objects on some platforms (amd64 and others) 143 # -fPIC is needed for shared objects on some platforms (amd64 and others)
105 append-flags -fPIC 144 append-flags -fPIC
321 md5sum *.h libsi/*.h|LC_ALL=C sort --key=2 360 md5sum *.h libsi/*.h|LC_ALL=C sort --key=2
322 ) > header-md5-${PN} 361 ) > header-md5-${PN}
323 doins header-md5-${PN} 362 doins header-md5-${PN}
324 fi 363 fi
325 fi 364 fi
365
366 create_plugindb_file
326} 367}
327 368
328vdr-plugin_pkg_postinst() { 369vdr-plugin_pkg_postinst() {
370 if has_version "<=media-tv/vdrplugin-rebuild-0.1"; then
329 update_vdrplugindb 371 update_vdrplugindb
372 fi
330 einfo 373 einfo
331 einfo "The vdr plugin ${VDRPLUGIN} has now been installed." 374 einfo "The vdr plugin ${VDRPLUGIN} has now been installed."
332 einfo "To activate execute the following command:" 375 einfo "To activate execute the following command:"
333 einfo 376 einfo
334 einfo " emerge --config ${PN}" 377 einfo " emerge --config ${PN}"
339 einfo 382 einfo
340 fi 383 fi
341} 384}
342 385
343vdr-plugin_pkg_postrm() { 386vdr-plugin_pkg_postrm() {
387 if has_version "<=media-tv/vdrplugin-rebuild-0.1"; then
344 remove_vdrplugindb 388 remove_vdrplugindb
389 fi
390 delete_orphan_plugindb_file
345} 391}
346 392
347vdr-plugin_pkg_config_final() { 393vdr-plugin_pkg_config_final() {
348 diff ${conf_orig} ${conf} 394 diff ${conf_orig} ${conf}
349 rm ${conf_orig} 395 rm ${conf_orig}

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

  ViewVC Help
Powered by ViewVC 1.1.20