/[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.70 Revision 1.79
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2012 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.70 2009/10/08 08:12:50 zzam Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.79 2012/01/15 20:54:56 idl0r Exp $
4# 4
5# @ECLASS: vdr-plugin.eclass
6# @MAINTAINER:
7# vdr@gentoo.org
8# @BLURB: common vdr plugin ebuild functions
9# @DESCRIPTION:
10# Eclass for easing maitenance of vdr plugin ebuilds
11
5# Author: 12# Author:
6# Matthias Schwarzott <zzam@gentoo.org> 13# Matthias Schwarzott <zzam@gentoo.org>
7# Joerg Bornkessel <hd_brummy@gentoo.org> 14# Joerg Bornkessel <hd_brummy@gentoo.org>
8
9# vdr-plugin.eclass
10#
11# eclass to create ebuilds for vdr plugins
12#
13 15
14# Example ebuild (basic version without patching): 16# Example ebuild (basic version without patching):
15# 17#
16# EAPI="2" 18# EAPI="2"
17# inherit vdr-plugin 19# inherit vdr-plugin
65# 67#
66# all patches which ending on diff or patch in this DIR will automatically applied 68# all patches which ending on diff or patch in this DIR will automatically applied
67# 69#
68 70
69inherit base multilib eutils flag-o-matic 71inherit base multilib eutils flag-o-matic
72
73if ! has "${EAPI:-0}" 0 1 2 3 4; then
74 die "API of vdr-plugin.eclass in EAPI=\"${EAPI}\" not established"
75fi
70 76
71IUSE="" 77IUSE=""
72 78
73# Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes 79# Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes
74VDRPLUGIN="${PN/#vdrplugin-/}" 80VDRPLUGIN="${PN/#vdrplugin-/}"
259plugin_has_gettext() { 265plugin_has_gettext() {
260 [[ -d po ]] 266 [[ -d po ]]
261} 267}
262 268
263vdr_i18n_convert_to_gettext() { 269vdr_i18n_convert_to_gettext() {
270 if has_version ">=media-video/vdr-1.7.22"; then
271 local i18n_tool="${ROOT}/usr/share/vdr/bin/i18n-to-gettext"
272 else
264 local i18n_tool="${ROOT}/usr/share/vdr/bin/i18n-to-gettext.pl" 273 local i18n_tool="${ROOT}/usr/share/vdr/bin/i18n-to-gettext.pl"
274 fi
265 275
266 if [[ ${NO_GETTEXT_HACK} == "1" ]]; then 276 if [[ ${NO_GETTEXT_HACK} == "1" ]]; then
267 ewarn "Conversion to gettext disabled in ebuild" 277 ewarn "Conversion to gettext disabled in ebuild"
268 return 1 278 return 1
269 fi 279 fi
380 390
381vdr-plugin_pkg_setup() { 391vdr-plugin_pkg_setup() {
382 # -fPIC is needed for shared objects on some platforms (amd64 and others) 392 # -fPIC is needed for shared objects on some platforms (amd64 and others)
383 append-flags -fPIC 393 append-flags -fPIC
384 394
395 # Plugins need to be compiled with position independent code, otherwise linking
396 # VDR against it will fail
397 if has_version ">=media-video/vdr-1.7.13"; then
398 append-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
399 fi
400
385 # Where should the plugins live in the filesystem 401 # Where should the plugins live in the filesystem
386 VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins" 402 VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins"
387 VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums" 403 VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
388 404
389 # was /usr/lib/... some time ago 405 # was /usr/lib/... some time ago
393 # Pathes to includes 409 # Pathes to includes
394 VDR_INCLUDE_DIR="/usr/include/vdr" 410 VDR_INCLUDE_DIR="/usr/include/vdr"
395 DVB_INCLUDE_DIR="/usr/include" 411 DVB_INCLUDE_DIR="/usr/include"
396 412
397 TMP_LOCALE_DIR="${WORKDIR}/tmp-locale" 413 TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
414 if has_version ">=media-video/vdr-1.6.0_p2-r7"; then
415 LOCDIR="/usr/share/locale"
416 else
398 LOCDIR="/usr/share/vdr/locale" 417 LOCDIR="/usr/share/vdr/locale"
418 fi
399 419
400 if ! has_vdr; then 420 if ! has_vdr; then
401 # set to invalid values to detect abuses 421 # set to invalid values to detect abuses
402 VDRVERSION="eclass_no_vdr_installed" 422 VDRVERSION="eclass_no_vdr_installed"
403 APIVERSION="eclass_no_vdr_installed" 423 APIVERSION="eclass_no_vdr_installed"
408 # if vdr is required 428 # if vdr is required
409 die "VDR not found!" 429 die "VDR not found!"
410 fi 430 fi
411 return 431 return
412 fi 432 fi
413 433
414 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h) 434 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
415 APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h) 435 APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
416 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}" 436 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
417 437
418 einfo "Compiling against" 438 einfo "Compiling against"
459 eerror "Please report this at bugs.gentoo.org." 479 eerror "Please report this at bugs.gentoo.org."
460 die "vdr-plugin_pkg_setup not called!" 480 die "vdr-plugin_pkg_setup not called!"
461 fi 481 fi
462 if [ -z "$1" ]; then 482 if [ -z "$1" ]; then
463 case "${EAPI:-0}" in 483 case "${EAPI:-0}" in
464 2) 484 2|3|4)
465 vdr-plugin_src_util unpack 485 vdr-plugin_src_util unpack
466 ;; 486 ;;
467 *) 487 *)
468 vdr-plugin_src_util all 488 vdr-plugin_src_util all
469 ;; 489 ;;
602 ewarn "emerge --config ${PN} is no longer supported" 622 ewarn "emerge --config ${PN} is no longer supported"
603 vdr-plugin_print_enable_command 623 vdr-plugin_print_enable_command
604} 624}
605 625
606case "${EAPI:-0}" in 626case "${EAPI:-0}" in
607 2) 627 2|3|4)
608 EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config 628 EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config
609 ;; 629 ;;
610 *) 630 *)
611 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config 631 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config
612 ;; 632 ;;

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.79

  ViewVC Help
Powered by ViewVC 1.1.20