/[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.50 Revision 1.54
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.50 2007/10/05 13:56:49 zzam Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.54 2008/03/22 18:04:51 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
72# works in most cases 72# works in most cases
73S="${WORKDIR}/${VDRPLUGIN}-${PV}" 73S="${WORKDIR}/${VDRPLUGIN}-${PV}"
74 74
75# depend on headers for DVB-driver 75# depend on headers for DVB-driver
76DEPEND=">=media-tv/gentoo-vdr-scripts-0.3.8 76DEPEND=">=media-tv/gentoo-vdr-scripts-0.3.8
77 >=media-tv/vdrplugin-rebuild-0.2 77 || ( >=media-tv/gentoo-vdr-scripts-0.4.2 >=media-tv/vdrplugin-rebuild-0.2 )
78 >=app-admin/eselect-vdr-0.0.2 78 >=app-admin/eselect-vdr-0.0.2
79 media-tv/linuxtv-dvb-headers" 79 media-tv/linuxtv-dvb-headers"
80 80
81 81
82# New method of storing plugindb 82# New method of storing plugindb
84# file maintained by normal portage-methods 84# file maintained by normal portage-methods
85create_plugindb_file() { 85create_plugindb_file() {
86 local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/ 86 local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
87 local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}" 87 local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}"
88 insinto "${NEW_VDRPLUGINDB_DIR}" 88 insinto "${NEW_VDRPLUGINDB_DIR}"
89
90# BUG: portage-2.1.4_rc9 will delete the EBUILD= line, so we cannot use this code.
89 cat <<-EOT > "${D}/${DB_FILE}" 91# cat <<-EOT > "${D}/${DB_FILE}"
90 VDRPLUGIN_DB=1 92# VDRPLUGIN_DB=1
91 CREATOR=ECLASS 93# CREATOR=ECLASS
92 EBUILD=${CATEGORY}/${PN} 94# EBUILD=${CATEGORY}/${PN}
93 EBUILD_V=${PVR} 95# EBUILD_V=${PVR}
94 EOT 96# EOT
97 {
98 echo "VDRPLUGIN_DB=1"
99 echo "CREATOR=ECLASS"
100 echo "EBUILD=${CATEGORY}/${PN}"
101 echo "EBUILD_V=${PVR}"
102 } > "${D}/${DB_FILE}"
95} 103}
96 104
97# Delete files created outside of vdr-plugin.eclass 105# Delete files created outside of vdr-plugin.eclass
98# vdrplugin-rebuild.ebuild converted plugindb and files are 106# vdrplugin-rebuild.ebuild converted plugindb and files are
99# not deleted by portage itself - should only be needed as 107# not deleted by portage itself - should only be needed as
100# long as not every system has switched over to 108# long as not every system has switched over to
101# vdrplugin-rebuild-0.2 109# vdrplugin-rebuild-0.2 / gentoo-vdr-scripts-0.4.2
102delete_orphan_plugindb_file() { 110delete_orphan_plugindb_file() {
103 #elog Testing for orphaned plugindb file 111 #elog Testing for orphaned plugindb file
104 local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/ 112 local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
105 local DB_FILE="${ROOT}/${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}" 113 local DB_FILE="${ROOT}/${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}"
106 114
224 -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \ 232 -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \
225 -e '2i\APIVERSION = '"${APIVERSION}" 233 -e '2i\APIVERSION = '"${APIVERSION}"
226 eend $? 234 eend $?
227 235
228 ebegin " Correcting Compile-Flags" 236 ebegin " Correcting Compile-Flags"
237 # Do not overwrite CXXFLAGS, add LDFLAGS if missing
229 sed -i Makefile \ 238 sed -i Makefile \
230 -e 's:^CXXFLAGS:#CXXFLAGS:' \ 239 -e '/^CXXFLAGS[[:space:]]*=/s/=/?=/' \
231 -e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:' 240 -e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
232 eend $? 241 eend $?
233 242
234 ebegin " Disabling file stripping" 243 ebegin " Disabling file stripping"
235 sed -i Makefile \ 244 sed -i Makefile \
239 -e '/@.*\$(STRIP)/d' 248 -e '/@.*\$(STRIP)/d'
240 eend $? 249 eend $?
241 250
242 # Use a file instead of an variable as single-stepping via ebuild 251 # Use a file instead of an variable as single-stepping via ebuild
243 # destroys environment. 252 # destroys environment.
244 touch ${WORKDIR}/.vdr-plugin_makefile_patched 253 touch "${WORKDIR}"/.vdr-plugin_makefile_patched
245 ;; 254 ;;
246 add_local_patch) 255 add_local_patch)
247 cd "${S}" 256 cd "${S}"
248 if test -d "${VDR_LOCAL_PATCHES_DIR}/${PN}"; then 257 if test -d "${VDR_LOCAL_PATCHES_DIR}/${PN}"; then
249 echo 258 echo
258 if [[ ${USE_GETTEXT} = 0 ]]; then 267 if [[ ${USE_GETTEXT} = 0 ]]; then
259 # Remove i18n Target if using older vdr 268 # Remove i18n Target if using older vdr
260 sed -i Makefile \ 269 sed -i Makefile \
261 -e '/^all:/s/ i18n//' 270 -e '/^all:/s/ i18n//'
262 elif [[ ${USE_GETTEXT} = 1 && ! -d po && ${NO_GETTEXT_HACK} != 1 ]]; then 271 elif [[ ${USE_GETTEXT} = 1 && ! -d po && ${NO_GETTEXT_HACK} != 1 ]]; then
272 einfo "Plugin is not yet changed for new translation system."
263 einfo "Converting translations to gettext" 273 einfo "Auto converting translations to gettext"
264 274
265 local i18n_tool="${ROOT}/usr/share/vdr/bin/i18n-to-gettext.pl" 275 local i18n_tool="${ROOT}/usr/share/vdr/bin/i18n-to-gettext.pl"
266 if [[ ! -x ${i18n_tool} ]]; then 276 if [[ ! -x ${i18n_tool} ]]; then
267 eerror "Missing ${i18n_tool}" 277 eerror "Missing ${i18n_tool}"
268 eerror "Please re-emerge vdr" 278 eerror "Please re-emerge vdr"
283 if [[ -s dummy-translations-trNOOP.c ]]; then 293 if [[ -s dummy-translations-trNOOP.c ]]; then
284 "${i18n_tool}" &>/dev/null 294 "${i18n_tool}" &>/dev/null
285 fi 295 fi
286 296
287 # now use the modified Makefile 297 # now use the modified Makefile
298 if [[ -f Makefile.new ]]; then
288 mv Makefile.new Makefile 299 mv Makefile.new Makefile
300 else
301 ewarn "Conversion to gettext failed. Plugin needs fixing."
302 fi
289 fi 303 fi
290 esac 304 esac
291 305
292 shift 306 shift
293 done 307 done
404 create_header_checksum_file 418 create_header_checksum_file
405 create_plugindb_file 419 create_plugindb_file
406} 420}
407 421
408vdr-plugin_print_enable_command() { 422vdr-plugin_print_enable_command() {
409 ewarn "emerge --config ${PN} is deprecated"
410 elog 423 elog
411 elog "To activate this vdr-plugin execute the following command:" 424 elog "To activate this vdr-plugin execute the following command:"
412 elog "\teselect vdr-plugin enable ${PN#vdr-}" 425 elog "\teselect vdr-plugin enable ${PN#vdr-}"
413 elog 426 elog
414} 427}
464 sed -i "${conf}" -e "/^[[:space:]]*${INSTALLPLUGIN}[[:space:]]*\$/d" 477 sed -i "${conf}" -e "/^[[:space:]]*${INSTALLPLUGIN}[[:space:]]*\$/d"
465 fi 478 fi
466} 479}
467 480
468vdr-plugin_pkg_config() { 481vdr-plugin_pkg_config() {
482 ewarn "emerge --config ${PN} is no longer supported"
469 vdr-plugin_print_enable_command 483 vdr-plugin_print_enable_command
470
471 einfo "Calling this now"
472 eselect vdr-plugin enable "${PN#vdr-}"
473} 484}
474 485
475fix_vdr_libsi_include() 486fix_vdr_libsi_include()
476{ 487{
477 einfo "Fixing include of libsi-headers" 488 einfo "Fixing include of libsi-headers"

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.54

  ViewVC Help
Powered by ViewVC 1.1.20