| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-libs/libselinux/libselinux-2.1.12.ebuild,v 1.1 2012/10/09 20:00:12 swift Exp $ |
| 4 |
|
| 5 |
EAPI="4" |
| 6 |
PYTHON_DEPEND="python? *" |
| 7 |
SUPPORT_PYTHON_ABIS="1" |
| 8 |
RESTRICT_PYTHON_ABIS="2.5 *-jython *-pypy-*" |
| 9 |
|
| 10 |
inherit multilib python toolchain-funcs eutils |
| 11 |
|
| 12 |
SEPOL_VER="2.1.8" |
| 13 |
|
| 14 |
DESCRIPTION="SELinux userland library" |
| 15 |
HOMEPAGE="http://userspace.selinuxproject.org" |
| 16 |
SRC_URI="http://userspace.selinuxproject.org/releases/20120924/${P}.tar.gz" |
| 17 |
|
| 18 |
LICENSE="public-domain" |
| 19 |
SLOT="0" |
| 20 |
KEYWORDS="~amd64 ~x86" |
| 21 |
IUSE="python ruby" |
| 22 |
|
| 23 |
RDEPEND=">=sys-libs/libsepol-${SEPOL_VER} |
| 24 |
>=dev-libs/libpcre-8.30-r2 |
| 25 |
ruby? ( dev-lang/ruby )" |
| 26 |
DEPEND="${RDEPEND} |
| 27 |
virtual/pkgconfig |
| 28 |
ruby? ( dev-lang/swig ) |
| 29 |
python? ( dev-lang/swig )" |
| 30 |
|
| 31 |
S="${WORKDIR}/${P}" |
| 32 |
|
| 33 |
pkg_setup() { |
| 34 |
if use python; then |
| 35 |
python_pkg_setup |
| 36 |
fi |
| 37 |
} |
| 38 |
|
| 39 |
src_unpack() { |
| 40 |
default |
| 41 |
} |
| 42 |
|
| 43 |
src_prepare() { |
| 44 |
# fix up paths for multilib |
| 45 |
sed -i \ |
| 46 |
-e "/^LIBDIR/s/lib/$(get_libdir)/" \ |
| 47 |
-e "/^SHLIBDIR/s/lib/$(get_libdir)/" \ |
| 48 |
src/Makefile utils/Makefile || die |
| 49 |
epatch "${FILESDIR}/${P}-mountsys.patch" |
| 50 |
|
| 51 |
epatch_user |
| 52 |
} |
| 53 |
|
| 54 |
src_compile() { |
| 55 |
emake AR="$(tc-getAR)" CC="$(tc-getCC)" LDFLAGS="-fPIC $(pkg-config --libs libpcre) ${LDFLAGS}" all || die |
| 56 |
|
| 57 |
if use python; then |
| 58 |
python_copy_sources src |
| 59 |
building() { |
| 60 |
emake CC="$(tc-getCC)" PYINC="-I$(python_get_includedir)" PYTHONLIBDIR="$(python_get_library -l)" PYPREFIX="python-$(python_get_version)" LDFLAGS="-fPIC $(pkg-config --libs libpcre) ${LDFLAGS}" pywrap |
| 61 |
} |
| 62 |
python_execute_function -s --source-dir src building |
| 63 |
fi |
| 64 |
|
| 65 |
if use ruby; then |
| 66 |
emake CC="$(tc-getCC)" rubywrap || die |
| 67 |
fi |
| 68 |
} |
| 69 |
|
| 70 |
src_install() { |
| 71 |
emake DESTDIR="${D}" install || die |
| 72 |
|
| 73 |
if use python; then |
| 74 |
installation() { |
| 75 |
emake DESTDIR="${D}" PYLIBVER="python$(python_get_version)" PYPREFIX="python-$(python_get_version)" install-pywrap |
| 76 |
} |
| 77 |
python_execute_function -s --source-dir src installation |
| 78 |
fi |
| 79 |
|
| 80 |
if use ruby; then |
| 81 |
emake DESTDIR="${D}" install-rubywrap || die |
| 82 |
fi |
| 83 |
} |
| 84 |
|
| 85 |
pkg_postinst() { |
| 86 |
if use python; then |
| 87 |
python_mod_optimize selinux |
| 88 |
fi |
| 89 |
} |
| 90 |
|
| 91 |
pkg_postrm() { |
| 92 |
if use python; then |
| 93 |
python_mod_cleanup selinux |
| 94 |
fi |
| 95 |
} |