| 1 |
swift |
1.1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
swift |
1.2 |
# $Header: /var/cvsroot/gentoo-x86/sys-libs/libselinux/libselinux-2.1.12-r1.ebuild,v 1.1 2012/10/29 15:36:13 swift Exp $ |
| 4 |
swift |
1.1 |
|
| 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 |
|
|
http://dev.gentoo.org/~swift/patches/${PN}/patchbundle-${P}-r1.tar.gz" |
| 18 |
|
|
|
| 19 |
|
|
LICENSE="public-domain" |
| 20 |
|
|
SLOT="0" |
| 21 |
swift |
1.2 |
KEYWORDS="amd64 x86" |
| 22 |
swift |
1.1 |
IUSE="python ruby static-libs" |
| 23 |
|
|
|
| 24 |
|
|
RDEPEND=">=sys-libs/libsepol-${SEPOL_VER} |
| 25 |
|
|
>=dev-libs/libpcre-8.30-r2[static-libs?] |
| 26 |
|
|
ruby? ( dev-lang/ruby )" |
| 27 |
|
|
DEPEND="${RDEPEND} |
| 28 |
|
|
virtual/pkgconfig |
| 29 |
|
|
ruby? ( dev-lang/swig ) |
| 30 |
|
|
python? ( dev-lang/swig )" |
| 31 |
|
|
|
| 32 |
|
|
S="${WORKDIR}/${P}" |
| 33 |
|
|
|
| 34 |
|
|
pkg_setup() { |
| 35 |
|
|
if use python; then |
| 36 |
|
|
python_pkg_setup |
| 37 |
|
|
fi |
| 38 |
|
|
} |
| 39 |
|
|
|
| 40 |
|
|
src_unpack() { |
| 41 |
|
|
default |
| 42 |
|
|
} |
| 43 |
|
|
|
| 44 |
|
|
src_prepare() { |
| 45 |
|
|
# fix up paths for multilib |
| 46 |
|
|
sed -i \ |
| 47 |
|
|
-e "/^LIBDIR/s/lib/$(get_libdir)/" \ |
| 48 |
|
|
-e "/^SHLIBDIR/s/lib/$(get_libdir)/" \ |
| 49 |
|
|
src/Makefile utils/Makefile || die |
| 50 |
|
|
|
| 51 |
|
|
EPATCH_MULTI_MSG="Applying libselinux patches ... " \ |
| 52 |
|
|
EPATCH_SUFFIX="patch" \ |
| 53 |
|
|
EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \ |
| 54 |
|
|
EPATCH_FORCE="yes" \ |
| 55 |
|
|
epatch |
| 56 |
|
|
|
| 57 |
|
|
epatch_user |
| 58 |
|
|
} |
| 59 |
|
|
|
| 60 |
|
|
src_compile() { |
| 61 |
|
|
emake \ |
| 62 |
|
|
AR="$(tc-getAR)" \ |
| 63 |
|
|
CC="$(tc-getCC)" \ |
| 64 |
|
|
LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS}" all || die |
| 65 |
|
|
|
| 66 |
|
|
if use python; then |
| 67 |
|
|
python_copy_sources src |
| 68 |
|
|
building() { |
| 69 |
|
|
emake CC="$(tc-getCC)" PYINC="-I$(python_get_includedir)" PYTHONLIBDIR="$(python_get_library -l)" PYPREFIX="python-$(python_get_version)" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS}" pywrap |
| 70 |
|
|
} |
| 71 |
|
|
python_execute_function -s --source-dir src building |
| 72 |
|
|
fi |
| 73 |
|
|
|
| 74 |
|
|
if use ruby; then |
| 75 |
|
|
emake CC="$(tc-getCC)" rubywrap || die |
| 76 |
|
|
fi |
| 77 |
|
|
} |
| 78 |
|
|
|
| 79 |
|
|
src_install() { |
| 80 |
|
|
emake DESTDIR="${D}" install || die |
| 81 |
|
|
|
| 82 |
|
|
if use python; then |
| 83 |
|
|
installation() { |
| 84 |
|
|
emake DESTDIR="${D}" PYLIBVER="python$(python_get_version)" PYPREFIX="python-$(python_get_version)" install-pywrap |
| 85 |
|
|
} |
| 86 |
|
|
python_execute_function -s --source-dir src installation |
| 87 |
|
|
fi |
| 88 |
|
|
|
| 89 |
|
|
if use ruby; then |
| 90 |
|
|
emake DESTDIR="${D}" install-rubywrap || die |
| 91 |
|
|
fi |
| 92 |
|
|
|
| 93 |
|
|
use static-libs || rm "${D}"/usr/lib*/*.a |
| 94 |
|
|
} |
| 95 |
|
|
|
| 96 |
|
|
pkg_postinst() { |
| 97 |
|
|
if use python; then |
| 98 |
|
|
python_mod_optimize selinux |
| 99 |
|
|
fi |
| 100 |
|
|
} |
| 101 |
|
|
|
| 102 |
|
|
pkg_postrm() { |
| 103 |
|
|
if use python; then |
| 104 |
|
|
python_mod_cleanup selinux |
| 105 |
|
|
fi |
| 106 |
|
|
} |