/[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.38
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.38 2006/11/01 14:32:22 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
177 -e 's:^APIVERSION = :APIVERSION ?= :' \ 216 -e 's:^APIVERSION = :APIVERSION ?= :' \
178 -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \ 217 -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \
179 -e '2i\APIVERSION = '"${APIVERSION}" 218 -e '2i\APIVERSION = '"${APIVERSION}"
180 eend $? 219 eend $?
181 220
182 ebegin " Correcting CXXFLAGS" 221 ebegin " Correcting Compile-Flags"
183 sed -i Makefile \ 222 sed -i Makefile \
184 -e 's:^CXXFLAGS:#CXXFLAGS:' 223 -e 's:^CXXFLAGS:#CXXFLAGS:' \
224 -e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
185 eend $? 225 eend $?
186 226
187 ebegin " Disabling file stripping" 227 ebegin " Disabling file stripping"
188 sed -i Makefile \ 228 sed -i Makefile \
189 -e '/@.*strip/d' \ 229 -e '/@.*strip/d' \
321 md5sum *.h libsi/*.h|LC_ALL=C sort --key=2 361 md5sum *.h libsi/*.h|LC_ALL=C sort --key=2
322 ) > header-md5-${PN} 362 ) > header-md5-${PN}
323 doins header-md5-${PN} 363 doins header-md5-${PN}
324 fi 364 fi
325 fi 365 fi
366
367 create_plugindb_file
326} 368}
327 369
328vdr-plugin_pkg_postinst() { 370vdr-plugin_pkg_postinst() {
371 if has_version "<=media-tv/vdrplugin-rebuild-0.1"; then
329 update_vdrplugindb 372 update_vdrplugindb
373 fi
330 einfo 374 einfo
331 einfo "The vdr plugin ${VDRPLUGIN} has now been installed." 375 einfo "The vdr plugin ${VDRPLUGIN} has now been installed."
332 einfo "To activate execute the following command:" 376 einfo "To activate execute the following command:"
333 einfo 377 einfo
334 einfo " emerge --config ${PN}" 378 einfo " emerge --config ${PN}"
339 einfo 383 einfo
340 fi 384 fi
341} 385}
342 386
343vdr-plugin_pkg_postrm() { 387vdr-plugin_pkg_postrm() {
388 if has_version "<=media-tv/vdrplugin-rebuild-0.1"; then
344 remove_vdrplugindb 389 remove_vdrplugindb
390 fi
391 delete_orphan_plugindb_file
345} 392}
346 393
347vdr-plugin_pkg_config_final() { 394vdr-plugin_pkg_config_final() {
348 diff ${conf_orig} ${conf} 395 diff ${conf_orig} ${conf}
349 rm ${conf_orig} 396 rm ${conf_orig}

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

  ViewVC Help
Powered by ViewVC 1.1.20