/[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.27 Revision 1.32
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.27 2006/07/19 19:19:00 hd_brummy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/vdr-plugin.eclass,v 1.32 2006/09/10 10:29:21 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
111 111
112 # transition to /usr/share/... will need new vdr-scripts version stable 112 # transition to /usr/share/... will need new vdr-scripts version stable
113 VDR_RC_DIR="/usr/lib/vdr/rcscript" 113 VDR_RC_DIR="/usr/lib/vdr/rcscript"
114 114
115 # Pathes to includes 115 # Pathes to includes
116 VDR_INCLUDE_DIR="/usr/include" 116 VDR_INCLUDE_DIR="/usr/include/vdr"
117 DVB_INCLUDE_DIR="/usr/include" 117 DVB_INCLUDE_DIR="/usr/include"
118 118
119 119
120 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' ${VDR_INCLUDE_DIR}/vdr/config.h) 120 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' ${VDR_INCLUDE_DIR}/config.h)
121 APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' ${VDR_INCLUDE_DIR}/vdr/config.h) 121 APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' ${VDR_INCLUDE_DIR}/config.h)
122 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}" 122 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
123 123
124 einfo "Building ${PF} against vdr-${VDRVERSION}" 124 einfo "Building ${PF} against vdr-${VDRVERSION}"
125 einfo "APIVERSION: ${APIVERSION}" 125 einfo "APIVERSION: ${APIVERSION}"
126} 126}
127 127
128vdr-plugin_src_unpack() { 128vdr-plugin_src_unpack() {
129 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
130 eerror "Wrong use of vdr-plugin.eclass."
131 eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin_pkg_setup."
132 echo
133 eerror "Please report this at bugs.gentoo.org."
134 die "vdr-plugin_pkg_setup not called!"
135 fi
129 [ -z "$1" ] && vdr-plugin_src_unpack unpack patchmakefile add_local_patch 136 [ -z "$1" ] && vdr-plugin_src_unpack unpack add_local_patch patchmakefile
130 137
131 while [ "$1" ]; do 138 while [ "$1" ]; do
132 139
133 case "$1" in 140 case "$1" in
134 unpack) 141 unpack)
154 sed -i Makefile \ 161 sed -i Makefile \
155 -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \ 162 -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \
156 -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ 163 -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
157 -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \ 164 -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \
158 -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \ 165 -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \
166 -e 's:-I$(VDRDIR)/include -I$(DVBDIR)/include:-I$(DVBDIR)/include -I$(VDRDIR)/include:' \
159 -e 's:-I$(VDRDIR)/include:-I$(VDRDIR):' \ 167 -e 's:-I$(VDRDIR)/include:-I'"${VDR_INCLUDE_DIR%vdr}"':' \
160 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ 168 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
161 -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' \
162 -e 's:$(VDRDIR)/\([a-z]*\.h\|Make.config\):$(VDRDIR)/vdr/\1:'
163 eend $? 169 eend $?
164 170
165 ebegin " Converting to APIVERSION" 171 ebegin " Converting to APIVERSION"
166 sed -i Makefile \ 172 sed -i Makefile \
167 -e 's:^APIVERSION = :APIVERSION ?= :' \ 173 -e 's:^APIVERSION = :APIVERSION ?= :' \
179 -e '/@.*strip/d' \ 185 -e '/@.*strip/d' \
180 -e '/strip \$(LIBDIR)\/\$@/d' \ 186 -e '/strip \$(LIBDIR)\/\$@/d' \
181 -e '/^STRIP =/d' \ 187 -e '/^STRIP =/d' \
182 -e '/@.*\$(STRIP)/d' 188 -e '/@.*\$(STRIP)/d'
183 eend $? 189 eend $?
190 PLUGIN_MAKEFILE_PATCHED=1
184 ;; 191 ;;
185 add_local_patch) 192 add_local_patch)
193 cd ${S}
186 if test -d "${VDR_LOCAL_PATCHES_DIR}/${PN}"; then 194 if test -d "${VDR_LOCAL_PATCHES_DIR}/${PN}"; then
187 echo 195 echo
188 einfo "Applying local patches" 196 einfo "Applying local patches"
189 for LOCALPATCH in ${VDR_LOCAL_PATCHES_DIR}/${PN}/${PV}/*.{diff,patch}; do 197 for LOCALPATCH in ${VDR_LOCAL_PATCHES_DIR}/${PN}/${PV}/*.{diff,patch}; do
190 test -f "${LOCALPATCH}" && epatch "${LOCALPATCH}" 198 test -f "${LOCALPATCH}" && epatch "${LOCALPATCH}"
196 shift 204 shift
197 done 205 done
198} 206}
199 207
200vdr-plugin_copy_source_tree() { 208vdr-plugin_copy_source_tree() {
209 pushd . >/dev/null
201 cp -r ${S} ${T}/source-tree 210 cp -r ${S} ${T}/source-tree
202 cd ${T}/source-tree 211 cd ${T}/source-tree
203 mv Makefile.orig Makefile 212 mv Makefile.orig Makefile
204 sed -i Makefile \ 213 sed -i Makefile \
205 -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ 214 -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
206 -e 's:^CXXFLAGS:#CXXFLAGS:' \ 215 -e 's:^CXXFLAGS:#CXXFLAGS:' \
207 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ 216 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \
208 -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' 217 -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):'
218 popd >/dev/null
209} 219}
210 220
211vdr-plugin_install_source_tree() { 221vdr-plugin_install_source_tree() {
212 einfo "Installing sources" 222 einfo "Installing sources"
213 destdir=${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN} 223 destdir=${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN}
225 case "$1" in 235 case "$1" in
226 prepare) 236 prepare)
227 [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin_copy_source_tree 237 [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin_copy_source_tree
228 ;; 238 ;;
229 compile) 239 compile)
240 if [[ -z ${PLUGIN_MAKEFILE_PATCHED} ]]; then
241 eerror "Wrong use of vdr-plugin.eclass."
242 eerror "An ebuild for a vdr-plugin will not work without"
243 eerror "calling vdr-plugin_src_unpack to patch the Makefile."
244 echo
245 eerror "Please report this at bugs.gentoo.org."
246 die "vdr-plugin_src_unpack not called!"
247 fi
230 cd ${S} 248 cd ${S}
231 249
232 emake ${VDRPLUGIN_MAKE_TARGET:-all} || die "emake failed" 250 emake ${BUILD_PARAMS} ${VDRPLUGIN_MAKE_TARGET:-all} || die "emake failed"
233 ;; 251 ;;
234 esac 252 esac
235 253
236 shift 254 shift
237 done 255 done
290 newins ${ROOT}${VDR_CHECKSUM_DIR}/header-md5-vdr header-md5-${PN} 308 newins ${ROOT}${VDR_CHECKSUM_DIR}/header-md5-vdr header-md5-${PN}
291 else 309 else
292 if which md5sum >/dev/null 2>&1; then 310 if which md5sum >/dev/null 2>&1; then
293 cd ${S} 311 cd ${S}
294 ( 312 (
295 cd ${ROOT}${VDR_INCLUDE_DIR}/vdr 313 cd ${ROOT}${VDR_INCLUDE_DIR}
296 md5sum *.h libsi/*.h|LC_ALL=C sort --key=2 314 md5sum *.h libsi/*.h|LC_ALL=C sort --key=2
297 ) > header-md5-${PN} 315 ) > header-md5-${PN}
298 doins header-md5-${PN} 316 doins header-md5-${PN}
299 fi 317 fi
300 fi 318 fi

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.20