| 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.45 2007/06/02 15:07:43 zzam Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.47 2007/08/14 14:47: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 | |
| … | |
… | |
| 213 | die "Could not change to plugin-source-directory!" |
213 | die "Could not change to plugin-source-directory!" |
| 214 | fi |
214 | fi |
| 215 | |
215 | |
| 216 | einfo "Patching Makefile" |
216 | einfo "Patching Makefile" |
| 217 | [[ -e Makefile ]] || die "Makefile of plugin can not be found!" |
217 | [[ -e Makefile ]] || die "Makefile of plugin can not be found!" |
| 218 | cp Makefile Makefile.orig |
218 | cp Makefile "${WORKDIR}"/Makefile.before |
| 219 | |
219 | |
| 220 | sed -i Makefile \ |
220 | sed -i Makefile \ |
| 221 | -e '1i\#Makefile was patched by vdr-plugin.eclass' |
221 | -e '1i\#Makefile was patched by vdr-plugin.eclass' |
| 222 | |
222 | |
| 223 | ebegin " Setting Pathes" |
223 | ebegin " Setting Pathes" |
| … | |
… | |
| 274 | |
274 | |
| 275 | vdr-plugin_copy_source_tree() { |
275 | vdr-plugin_copy_source_tree() { |
| 276 | pushd . >/dev/null |
276 | pushd . >/dev/null |
| 277 | cp -r ${S} ${T}/source-tree |
277 | cp -r ${S} ${T}/source-tree |
| 278 | cd ${T}/source-tree |
278 | cd ${T}/source-tree |
| 279 | mv Makefile.orig Makefile |
279 | cp "${WORKDIR}"/Makefile.before Makefile |
| 280 | sed -i Makefile \ |
280 | sed -i Makefile \ |
| 281 | -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
281 | -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
| 282 | -e 's:^CXXFLAGS:#CXXFLAGS:' \ |
282 | -e 's:^CXXFLAGS:#CXXFLAGS:' \ |
| 283 | -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ |
283 | -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ |
| 284 | -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' |
284 | -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' |
| … | |
… | |
| 322 | done |
322 | done |
| 323 | } |
323 | } |
| 324 | |
324 | |
| 325 | vdr-plugin_src_install() { |
325 | vdr-plugin_src_install() { |
| 326 | [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin_install_source_tree |
326 | [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin_install_source_tree |
| 327 | cd ${S} |
327 | cd "${WORKDIR}" |
| 328 | |
328 | |
| 329 | if [[ -n ${VDR_MAINTAINER_MODE} ]]; then |
329 | if [[ -n ${VDR_MAINTAINER_MODE} ]]; then |
| 330 | local mname=${P}-Makefile |
330 | local mname=${P}-Makefile |
| 331 | cp Makefile ${mname}.patched |
331 | cp "${S}"/Makefile ${mname}.patched |
| 332 | cp Makefile.orig ${mname}.before |
332 | cp Makefile.before ${mname}.before |
| 333 | |
333 | |
| 334 | diff -u ${mname}.before ${mname}.patched > ${mname}.diff |
334 | diff -u ${mname}.before ${mname}.patched > ${mname}.diff |
| 335 | |
335 | |
| 336 | insinto "/usr/share/vdr/maintainer-data/makefile-changes" |
336 | insinto "/usr/share/vdr/maintainer-data/makefile-changes" |
| 337 | doins ${mname}.diff |
337 | doins ${mname}.diff |
| … | |
… | |
| 342 | insinto "/usr/share/vdr/maintainer-data/makefile-patched" |
342 | insinto "/usr/share/vdr/maintainer-data/makefile-patched" |
| 343 | doins ${mname}.patched |
343 | doins ${mname}.patched |
| 344 | |
344 | |
| 345 | fi |
345 | fi |
| 346 | |
346 | |
|
|
347 | cd "${S}" |
| 347 | insinto "${VDR_PLUGIN_DIR}" |
348 | insinto "${VDR_PLUGIN_DIR}" |
| 348 | doins libvdr-*.so.* |
349 | doins libvdr-*.so.* |
| 349 | local docfile |
350 | local docfile |
| 350 | for docfile in README* HISTORY CHANGELOG; do |
351 | for docfile in README* HISTORY CHANGELOG; do |
| 351 | [[ -f ${docfile} ]] && dodoc ${docfile} |
352 | [[ -f ${docfile} ]] && dodoc ${docfile} |