]> Pileus Git - ~andy/sunrise/blob - sys-libs/libapparmor/libapparmor-2.8.0.ebuild
dev-db/cppdb: Add ~amd64 keyword, EAPI bump
[~andy/sunrise] / sys-libs / libapparmor / libapparmor-2.8.0.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=4
6
7 PYTHON_DEPEND="python? *"
8 SUPPORT_PYTHON_ABIS="1"
9 GENTOO_DEPEND_ON_PERL="no"
10
11 inherit autotools eutils perl-module python versionator
12
13 DESCRIPTION="Library to support AppArmor userspace utilities"
14 HOMEPAGE="http://apparmor.net/"
15 SRC_URI="http://launchpad.net/apparmor/$(get_version_component_range 1-2)/${PV}/+download/apparmor-${PV}.tar.gz"
16
17 LICENSE="LGPL-2.1"
18 SLOT="0"
19 KEYWORDS="~amd64"
20 IUSE="doc perl python static-libs"
21
22 RDEPEND="perl? ( dev-lang/perl )"
23
24 DEPEND="${RDEPEND}
25         sys-devel/autoconf-archive
26         sys-devel/bison
27         sys-devel/flex
28         doc? ( dev-lang/perl )
29         perl? ( dev-lang/swig )
30         python? ( dev-lang/swig )"
31
32 S=${WORKDIR}/apparmor-${PV}/libraries/${PN}
33
34 src_prepare() {
35         rm -r m4 || die "failed to remove bundled macros"
36         # to force use of system macros
37         eautoreconf
38 }
39
40 src_configure() {
41         econf \
42                 $(use_with perl) \
43                 $(use_with python) \
44                 $(use_enable static-libs static)
45 }
46
47 src_compile() {
48         emake -C src
49
50         use doc && emake -C doc
51         use perl && emake -C swig/perl
52
53         if use python ; then
54                 python_copy_sources swig/python
55                 compile_bindings() {
56                         emake PYTHON="$(PYTHON)" PYTHON_INCLUDEDIR="$(python_get_includedir)" PYTHON_LIBDIR="$(python_get_libdir)"
57                 }
58                 python_execute_function -s --source-dir swig/python compile_bindings
59         fi
60 }
61
62 src_install() {
63         emake -C src DESTDIR="${D}" install
64         use doc && emake -C doc DESTDIR="${D}" install
65
66         if use perl ; then
67                 emake -C swig/perl DESTDIR="${D}" install
68                 perlinfo
69                 insinto "${VENDOR_ARCH}"
70                 doins swig/perl/LibAppArmor.pm
71         fi
72
73         if use python ; then
74                 install_bindings() {
75                         emake -C swig/python DESTDIR="${D}" install
76                 }
77                 python_execute_function -q install_bindings
78         fi
79
80         find "${D}" -name '*.la' -delete || die "failed to remove .la files"
81 }