| 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.18 2006/04/26 12:57:05 zzam Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.21 2006/05/02 15:04:03 zzam Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: |
5 | # Author: |
| 6 | # Matthias Schwarzott <zzam@gentoo.org> |
6 | # Matthias Schwarzott <zzam@gentoo.org> |
| 7 | |
7 | |
| 8 | # vdr-plugin.eclass |
8 | # vdr-plugin.eclass |
| … | |
… | |
| 99 | vdr-plugin_pkg_setup() { |
99 | vdr-plugin_pkg_setup() { |
| 100 | # -fPIC is needed for shared objects on some platforms (amd64 and others) |
100 | # -fPIC is needed for shared objects on some platforms (amd64 and others) |
| 101 | append-flags -fPIC |
101 | append-flags -fPIC |
| 102 | use debug && append-flags -g |
102 | use debug && append-flags -g |
| 103 | |
103 | |
| 104 | VDRVERSION=$(awk -F'"' '/VDRVERSION/ {print $2}' /usr/include/vdr/config.h) |
104 | VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' /usr/include/vdr/config.h) |
| 105 | APIVERSION=$(awk -F'"' '/APIVERSION/ {print $2}' /usr/include/vdr/config.h) |
105 | APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' /usr/include/vdr/config.h) |
| 106 | [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}" |
106 | [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}" |
| 107 | |
107 | |
| 108 | einfo "Building ${PF} against vdr-${VDRVERSION}" |
108 | einfo "Building ${PF} against vdr-${VDRVERSION}" |
| 109 | einfo "APIVERSION: ${APIVERSION}" |
109 | einfo "APIVERSION: ${APIVERSION}" |
| 110 | } |
110 | } |
| … | |
… | |
| 117 | case "$1" in |
117 | case "$1" in |
| 118 | unpack) |
118 | unpack) |
| 119 | base_src_unpack |
119 | base_src_unpack |
| 120 | ;; |
120 | ;; |
| 121 | patchmakefile) |
121 | patchmakefile) |
| 122 | cd ${S} |
122 | if ! cd ${S}; then |
|
|
123 | ewarn "There seems to be no plugin-directory with the name ${S##*/}" |
|
|
124 | ewarn "Perhaps you find one among these:" |
|
|
125 | cd "${WORKDIR}" |
|
|
126 | einfo "$(/bin/ls -1 ${WORKDIR})" |
|
|
127 | die "Could not change to plugin-source-directory!" |
|
|
128 | fi |
| 123 | |
129 | |
| 124 | ebegin "Patching Makefile" |
130 | ebegin "Patching Makefile" |
|
|
131 | [[ -e Makefile ]] || die "Makefile of plugin can not be found!" |
| 125 | sed -i.orig Makefile \ |
132 | sed -i.orig Makefile \ |
| 126 | -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \ |
133 | -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \ |
| 127 | -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
134 | -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
| 128 | -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \ |
135 | -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \ |
| 129 | -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \ |
136 | -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \ |
| … | |
… | |
| 309 | -e ${LINE}'s/" /"/g' |
316 | -e ${LINE}'s/" /"/g' |
| 310 | |
317 | |
| 311 | vdr-plugin_pkg_config_final |
318 | vdr-plugin_pkg_config_final |
| 312 | } |
319 | } |
| 313 | |
320 | |
|
|
321 | fix_vdr_libsi_include() |
|
|
322 | { |
|
|
323 | einfo "Fixing include of libsi-headers" |
|
|
324 | local f |
|
|
325 | for f; do |
|
|
326 | sed -i "${f}" \ |
|
|
327 | -e '/#include/s:"\(.*libsi.*\)":<\1>:' \ |
|
|
328 | -e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:' |
|
|
329 | done |
|
|
330 | } |
|
|
331 | |
| 314 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config |
332 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config |