/[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.17 Revision 1.21
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.17 2006/03/17 15:13:24 zzam Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/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
99vdr-plugin_pkg_setup() { 99vdr-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'"' '/define APIVERSION/ {print $2}' /usr/include/vdr/config.h)
106 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
107
105 einfo "Building ${PF} against vdr-${VDRVERSION}" 108 einfo "Building ${PF} against vdr-${VDRVERSION}"
109 einfo "APIVERSION: ${APIVERSION}"
106} 110}
107 111
108vdr-plugin_src_unpack() { 112vdr-plugin_src_unpack() {
109 [ -z "$1" ] && vdr-plugin_src_unpack unpack patchmakefile 113 [ -z "$1" ] && vdr-plugin_src_unpack unpack patchmakefile
110 114
113 case "$1" in 117 case "$1" in
114 unpack) 118 unpack)
115 base_src_unpack 119 base_src_unpack
116 ;; 120 ;;
117 patchmakefile) 121 patchmakefile)
118 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
119 129
120 ebegin "Patching Makefile" 130 ebegin "Patching Makefile"
131 [[ -e Makefile ]] || die "Makefile of plugin can not be found!"
121 sed -i.orig Makefile \ 132 sed -i.orig Makefile \
122 -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \ 133 -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \
123 -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ 134 -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
124 -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \ 135 -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \
125 -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \ 136 -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \
126 -e 's:^CXXFLAGS:#CXXFLAGS:' \ 137 -e 's:^CXXFLAGS:#CXXFLAGS:' \
127 -e 's:-I$(VDRDIR)/include:-I$(VDRDIR):' \ 138 -e 's:-I$(VDRDIR)/include:-I$(VDRDIR):' \
128 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ 139 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \
129 -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' \ 140 -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' \
130 -e 's:$(VDRDIR)/\([a-z]*\.h\|Make.config\):$(VDRDIR)/vdr/\1:' 141 -e 's:$(VDRDIR)/\([a-z]*\.h\|Make.config\):$(VDRDIR)/vdr/\1:' \
142 -e 's:^APIVERSION = :APIVERSION ?= :' \
143 -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \
144 -e '1i\APIVERSION = '"${APIVERSION}"
131 eend $? 145 eend $?
132 ;; 146 ;;
133 esac 147 esac
134 148
135 shift 149 shift
302 -e ${LINE}'s/" /"/g' 316 -e ${LINE}'s/" /"/g'
303 317
304 vdr-plugin_pkg_config_final 318 vdr-plugin_pkg_config_final
305} 319}
306 320
321fix_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
307EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config 332EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20