| 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.70 2009/10/08 08:12:50 zzam Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.75 2011/10/24 19:54:51 hd_brummy 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 | |
| … | |
… | |
| 65 | # |
65 | # |
| 66 | # all patches which ending on diff or patch in this DIR will automatically applied |
66 | # all patches which ending on diff or patch in this DIR will automatically applied |
| 67 | # |
67 | # |
| 68 | |
68 | |
| 69 | inherit base multilib eutils flag-o-matic |
69 | inherit base multilib eutils flag-o-matic |
|
|
70 | |
|
|
71 | if ! has "${EAPI:-0}" 0 1 2 3; then |
|
|
72 | die "API of vdr-plugin.eclass in EAPI=\"${EAPI}\" not established" |
|
|
73 | fi |
| 70 | |
74 | |
| 71 | IUSE="" |
75 | IUSE="" |
| 72 | |
76 | |
| 73 | # Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes |
77 | # Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes |
| 74 | VDRPLUGIN="${PN/#vdrplugin-/}" |
78 | VDRPLUGIN="${PN/#vdrplugin-/}" |
| … | |
… | |
| 380 | |
384 | |
| 381 | vdr-plugin_pkg_setup() { |
385 | vdr-plugin_pkg_setup() { |
| 382 | # -fPIC is needed for shared objects on some platforms (amd64 and others) |
386 | # -fPIC is needed for shared objects on some platforms (amd64 and others) |
| 383 | append-flags -fPIC |
387 | append-flags -fPIC |
| 384 | |
388 | |
|
|
389 | # Plugins need to be compiled with position independent code, otherwise linking |
|
|
390 | # VDR against it will fail |
|
|
391 | if has_version ">=media-video/vdr-1.7.13"; then |
|
|
392 | append-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE |
|
|
393 | fi |
|
|
394 | |
| 385 | # Where should the plugins live in the filesystem |
395 | # Where should the plugins live in the filesystem |
| 386 | VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins" |
396 | VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins" |
| 387 | VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums" |
397 | VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums" |
| 388 | |
398 | |
| 389 | # was /usr/lib/... some time ago |
399 | # was /usr/lib/... some time ago |
| … | |
… | |
| 393 | # Pathes to includes |
403 | # Pathes to includes |
| 394 | VDR_INCLUDE_DIR="/usr/include/vdr" |
404 | VDR_INCLUDE_DIR="/usr/include/vdr" |
| 395 | DVB_INCLUDE_DIR="/usr/include" |
405 | DVB_INCLUDE_DIR="/usr/include" |
| 396 | |
406 | |
| 397 | TMP_LOCALE_DIR="${WORKDIR}/tmp-locale" |
407 | TMP_LOCALE_DIR="${WORKDIR}/tmp-locale" |
|
|
408 | if has_version ">=media-video/vdr-1.6.0_p2-r7"; then |
|
|
409 | LOCDIR="/usr/share/locale" |
|
|
410 | else |
| 398 | LOCDIR="/usr/share/vdr/locale" |
411 | LOCDIR="/usr/share/vdr/locale" |
|
|
412 | fi |
| 399 | |
413 | |
| 400 | if ! has_vdr; then |
414 | if ! has_vdr; then |
| 401 | # set to invalid values to detect abuses |
415 | # set to invalid values to detect abuses |
| 402 | VDRVERSION="eclass_no_vdr_installed" |
416 | VDRVERSION="eclass_no_vdr_installed" |
| 403 | APIVERSION="eclass_no_vdr_installed" |
417 | APIVERSION="eclass_no_vdr_installed" |
| … | |
… | |
| 408 | # if vdr is required |
422 | # if vdr is required |
| 409 | die "VDR not found!" |
423 | die "VDR not found!" |
| 410 | fi |
424 | fi |
| 411 | return |
425 | return |
| 412 | fi |
426 | fi |
| 413 | |
427 | |
| 414 | VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h) |
428 | 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) |
429 | APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h) |
| 416 | [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}" |
430 | [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}" |
| 417 | |
431 | |
| 418 | einfo "Compiling against" |
432 | einfo "Compiling against" |
| … | |
… | |
| 459 | eerror "Please report this at bugs.gentoo.org." |
473 | eerror "Please report this at bugs.gentoo.org." |
| 460 | die "vdr-plugin_pkg_setup not called!" |
474 | die "vdr-plugin_pkg_setup not called!" |
| 461 | fi |
475 | fi |
| 462 | if [ -z "$1" ]; then |
476 | if [ -z "$1" ]; then |
| 463 | case "${EAPI:-0}" in |
477 | case "${EAPI:-0}" in |
| 464 | 2) |
478 | 2|3) |
| 465 | vdr-plugin_src_util unpack |
479 | vdr-plugin_src_util unpack |
| 466 | ;; |
480 | ;; |
| 467 | *) |
481 | *) |
| 468 | vdr-plugin_src_util all |
482 | vdr-plugin_src_util all |
| 469 | ;; |
483 | ;; |
| … | |
… | |
| 602 | ewarn "emerge --config ${PN} is no longer supported" |
616 | ewarn "emerge --config ${PN} is no longer supported" |
| 603 | vdr-plugin_print_enable_command |
617 | vdr-plugin_print_enable_command |
| 604 | } |
618 | } |
| 605 | |
619 | |
| 606 | case "${EAPI:-0}" in |
620 | case "${EAPI:-0}" in |
| 607 | 2) |
621 | 2|3) |
| 608 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config |
622 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config |
| 609 | ;; |
623 | ;; |
| 610 | *) |
624 | *) |
| 611 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config |
625 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config |
| 612 | ;; |
626 | ;; |