summaryrefslogtreecommitdiff
blob: a45e9175c903e8f5950289bc10875ea8f4578d68 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/rhpl/rhpl-0.219.ebuild,v 1.3 2012/02/21 08:59:00 patrick Exp $

EAPI="3"
PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.* 2.7-pypy-* *-jython"

inherit multilib python rpm toolchain-funcs

# Revision of the RPM. Shouldn't affect us, as we're just grabbing the source
# tarball out of it
RPMREV="2"

DESCRIPTION="Library of python code used by Red Hat Linux programs"
HOMEPAGE="http://fedoraproject.org/wiki/SystemConfig"
SRC_URI="mirror://fedora-dev/development/source/SRPMS/${P}-${RPMREV}.src.rpm"

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

RDEPEND="!<sys-libs/libkudzu-1.2"
DEPEND="${RDEPEND}
	!s390? ( >=net-wireless/wireless-tools-28 )
	sys-devel/gettext"

src_prepare() {
	sed -e '/compileall/d' -i Makefile || die "sed failed"
	sed \
		-e 's:CFLAGS=:CFLAGS+=:' \
		-e 's:gcc:$(CC):g' \
		-e 's:-shared:& $(LDFLAGS):' \
		-i src/Makefile || die "sed failed"
	python_src_prepare
}

src_compile() {
	building() {
		emake \
			PYTHON=$(PYTHON) \
			LIBDIR=$(get_libdir) \
			ARCH=${ARCH} \
			CC=$(tc-getCC)
	}
	python_execute_function -s building
}

src_install() {
	installation() {
		emake \
			DESTDIR="${ED}" \
			PYTHON=$(PYTHON) \
			LIBDIR=$(get_libdir) \
			install
	}
	python_execute_function -s installation
}

pkg_postinst() {
	python_mod_optimize rhpl
}

pkg_postrm() {
	python_mod_cleanup rhpl
}