summaryrefslogtreecommitdiff
blob: 3e48031336d412372640e638c21c8b4aa2c32d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/cdparanoia/cdparanoia-3.9.8-r4.ebuild,v 1.7 2006/09/22 22:11:05 ticho Exp $

inherit eutils flag-o-matic linux-info libtool toolchain-funcs

MY_P=${PN}-III-alpha9.8
S=${WORKDIR}/${MY_P}

DESCRIPTION="an advanced CDDA reader with error correction"
HOMEPAGE="http://www.xiph.org/paranoia/"
SRC_URI="http://www.xiph.org/paranoia/download/${MY_P}.src.tgz
	mirror://gentoo/${P}-SG_IO-patches.tar.gz
	mirror://gentoo/${P}-fbsd.patch.bz2"

IUSE="kernel_linux"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"

pkg_setup() {
	use kernel_linux && linux-info_pkg_setup
}

src_unpack() {
	unpack ${A}
	cd "${S}"

	# cdda_paranoia.h should include cdda_interface_h, else most configure
	# scripts testing for support fails (gnome-vfs, etc).
	epatch "${FILESDIR}/${P}-include-cdda_interface_h.patch"
	epatch "${FILESDIR}/${P}-toc.patch"
	epatch "${FILESDIR}/${P}-identify_crash.patch"
	epatch "${FILESDIR}/${PV}-gcc34.patch"

	# if libdir is specified, cdparanoia causes sandbox violations, and using
	# einstall doesnt work around it. so lets patch in DESTDIR support
	epatch "${FILESDIR}/${P}-use-destdir.patch"

	# Apply Red Hat's SG_IO patches see bug #118189 for more info
	if use kernel_linux && kernel_is ge 2 6 15; then
		EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" epatch
		epatch "${FILESDIR}/${P}-respectflags-sgio.patch"
		# Fix makefiles for parallel make
		epatch "${FILESDIR}/${P}-parallel-fpic.patch"
	else
		epatch "${FILESDIR}/${P}-respectflags-pio.patch"
		epatch "${DISTDIR}/${P}-fbsd.patch.bz2"
		# Fix makefiles for parallel make
		epatch "${FILESDIR}/${P}-parallel-fpic-fbsd.patch"
	fi

	# Use directly the same exact patch as flex as it works
	epatch "${FILESDIR}/flex-configure-LANG.patch"

	# Let portage handle the stripping of binaries
	sed -i -e "/strip cdparanoia/d" Makefile.in

	# Fix Makefiles for parallel building. Bug #136128.
	sed -i \
		-e "s/^lib:	$/lib:	\$(OFILES)/" \
		-e "s/^slib:	$/slib:	\$(OFILES)/" \
		-e "/\$(MAKE) lessmessy$/d" \
		interface/Makefile.in paranoia/Makefile.in

	ln -s configure.guess config.guess
	ln -s configure.sub config.sub
	rm config.{guess,sub}

	elibtoolize
}

src_compile() {
	tc-export CC AR RANLIB
	append-flags -I${S}/interface
	econf || die
	emake OPT="${CFLAGS}" || die
}

src_install() {
	dodir /usr/{bin,lib,include} /usr/share/man/man1
	emake DESTDIR=${D} install || die
	dodoc FAQ.txt README
}