| 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/libcap-ng/libcap-ng-0.6.6.ebuild,v 1.13 2012/05/19 12:46:28 blueness Exp $ |
| 4 |
|
| 5 |
EAPI=4 |
| 6 |
|
| 7 |
SUPPORT_PYTHON_ABIS="1" |
| 8 |
RESTRICT_PYTHON_ABIS="*-jython *-pypy-*" |
| 9 |
|
| 10 |
inherit autotools flag-o-matic python |
| 11 |
|
| 12 |
DESCRIPTION="POSIX 1003.1e capabilities" |
| 13 |
HOMEPAGE="http://people.redhat.com/sgrubb/libcap-ng/" |
| 14 |
SRC_URI="http://people.redhat.com/sgrubb/${PN}/${P}.tar.gz" |
| 15 |
|
| 16 |
LICENSE="LGPL-2.1" |
| 17 |
SLOT="0" |
| 18 |
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86" |
| 19 |
IUSE="python static-libs" |
| 20 |
|
| 21 |
RDEPEND="sys-apps/attr |
| 22 |
python? ( dev-lang/python )" |
| 23 |
DEPEND="${RDEPEND} |
| 24 |
sys-kernel/linux-headers |
| 25 |
python? ( >=dev-lang/swig-2 )" |
| 26 |
|
| 27 |
PYTHON_CFLAGS=("2.* + -fno-strict-aliasing") |
| 28 |
|
| 29 |
pkg_setup() { |
| 30 |
use python && python_pkg_setup |
| 31 |
} |
| 32 |
|
| 33 |
src_prepare() { |
| 34 |
# Disable byte-compilation of Python modules. |
| 35 |
>py-compile |
| 36 |
|
| 37 |
# Python bindings are built/tested/installed manually. |
| 38 |
sed -i -e "/^SUBDIRS/s/ python//" bindings/Makefile.am || die |
| 39 |
|
| 40 |
eautoreconf |
| 41 |
|
| 42 |
use sparc && replace-flags -O? -O0 |
| 43 |
} |
| 44 |
|
| 45 |
src_configure() { |
| 46 |
econf \ |
| 47 |
$(use_enable static-libs static) \ |
| 48 |
$(use_with python) |
| 49 |
} |
| 50 |
|
| 51 |
src_compile() { |
| 52 |
default |
| 53 |
|
| 54 |
if use python; then |
| 55 |
python_copy_sources bindings/python |
| 56 |
|
| 57 |
building() { |
| 58 |
emake \ |
| 59 |
CFLAGS="${CFLAGS}" \ |
| 60 |
PYTHON_VERSION="$(python_get_version)" \ |
| 61 |
pyexecdir="$(python_get_sitedir)" \ |
| 62 |
pythondir="$(python_get_sitedir)" |
| 63 |
} |
| 64 |
python_execute_function -s --source-dir bindings/python building |
| 65 |
fi |
| 66 |
} |
| 67 |
|
| 68 |
src_test() { |
| 69 |
if [[ "${EUID}" -eq 0 ]]; then |
| 70 |
ewarn "Skipping tests due to root permissions." |
| 71 |
return |
| 72 |
fi |
| 73 |
|
| 74 |
default |
| 75 |
|
| 76 |
if use python; then |
| 77 |
testing() { |
| 78 |
emake \ |
| 79 |
PYTHON_VERSION="$(python_get_version)" \ |
| 80 |
pyexecdir="$(python_get_sitedir)" \ |
| 81 |
pythondir="$(python_get_sitedir)" \ |
| 82 |
TESTS_ENVIRONMENT="PYTHONPATH=..:../.libs" \ |
| 83 |
check |
| 84 |
} |
| 85 |
python_execute_function -s --source-dir bindings/python testing |
| 86 |
fi |
| 87 |
} |
| 88 |
|
| 89 |
src_install() { |
| 90 |
emake DESTDIR="${D}" install |
| 91 |
|
| 92 |
if use python; then |
| 93 |
installation() { |
| 94 |
emake \ |
| 95 |
DESTDIR="${D}" \ |
| 96 |
PYTHON_VERSION="$(python_get_version)" \ |
| 97 |
pyexecdir="$(python_get_sitedir)" \ |
| 98 |
pythondir="$(python_get_sitedir)" \ |
| 99 |
install |
| 100 |
} |
| 101 |
python_execute_function -s --source-dir bindings/python installation |
| 102 |
|
| 103 |
python_clean_installation_image |
| 104 |
fi |
| 105 |
|
| 106 |
dodoc AUTHORS ChangeLog README |
| 107 |
|
| 108 |
rm -f "${ED}"/usr/lib*/${PN}.la |
| 109 |
} |
| 110 |
|
| 111 |
pkg_postinst() { |
| 112 |
use python && python_mod_optimize capng.py |
| 113 |
} |
| 114 |
|
| 115 |
pkg_postrm() { |
| 116 |
use python && python_mod_cleanup capng.py |
| 117 |
} |