summaryrefslogtreecommitdiff
blob: 60dae92b7a7f79045ceba63f031a57a72841cd68 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/pycdio/pycdio-0.13.ebuild,v 1.3 2008/05/29 14:21:17 hawking Exp $

inherit eutils distutils flag-o-matic multilib

DESCRIPTION="pycdio is a Python interface to the CD Input and Control library (libcdio)"
HOMEPAGE="http://savannah.gnu.org/projects/libcdio/"
SRC_URI="http://ftp.gnu.org/gnu/libcdio/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc"

RDEPEND="virtual/python
	dev-libs/libcdio"

DEPEND="${RDEPEND}
	dev-lang/swig"

PYTHON_MODNAME=""

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

	# remove obsolete sys.path and adjust 'data' path in examples
	sed -i -e "s:^sys.path.insert.*::" -e "s:\.\./data:./data:g" example/*.py.in
}

src_compile() {
	# -fPIC is needed for shared objects on some platforms (amd64 and others)
	append-flags -fPIC

	distutils_src_compile
}

src_install(){
	make DESTDIR="${D}" install || die "make install failed."
	chmod a+x "${D}"usr/$(get_libdir)/python*/site-packages/*.so
	rm -f "${D}"usr/$(get_libdir)/python*/site-packages/*.py[co]

	dodoc AUTHORS NEWS README

	if use doc; then
		insinto /usr/share/doc/${PF}/examples
		doins example/{README,*.py}
		doins -r data
	fi
}

pkg_postinst() {
	python_version
	python_mod_compile \
		/usr/$(get_libdir)/python${PYVER}/site-packages/{,py}{cdio,iso9660}.py
}