Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libapparmor/files/, sys-libs/libapparmor/
Date: Sat, 24 Sep 2016 17:55:50
Message-Id: 1474739726.4930a1eb1971a0b1fde5b556d9e58104cc5a1176.kensington@gentoo
1 commit: 4930a1eb1971a0b1fde5b556d9e58104cc5a1176
2 Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 24 17:55:02 2016 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 24 17:55:26 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4930a1eb
7
8 sys-libs/libapparmor: revision bump solving python module import failure with dev-lang/swig-3.0.10
9
10 Patch from openSUSE.
11
12 Gentoo-bug: 594238
13
14 Package-Manager: portage-2.3.1
15
16 .../files/libapparmor-2.10.1-import-path.patch | 46 +++++++++++
17 sys-libs/libapparmor/libapparmor-2.10.1-r1.ebuild | 89 ++++++++++++++++++++++
18 2 files changed, 135 insertions(+)
19
20 diff --git a/sys-libs/libapparmor/files/libapparmor-2.10.1-import-path.patch b/sys-libs/libapparmor/files/libapparmor-2.10.1-import-path.patch
21 new file mode 100644
22 index 00000000..ff18c37
23 --- /dev/null
24 +++ b/sys-libs/libapparmor/files/libapparmor-2.10.1-import-path.patch
25 @@ -0,0 +1,46 @@
26 +Add patch from openSUSE fixing python module import failure when built with
27 +dev-lang/swig-3.0.10.
28 +
29 +https://bugzilla.opensuse.org/show_bug.cgi?id=987607
30 +
31 +Gentoo-bug: 594238
32 +
33 +--- a/swig/python/Makefile.am
34 ++++ b/swig/python/Makefile.am
35 +@@ -6,9 +6,8 @@ SUBDIRS = test
36 +
37 + libapparmor_wrap.c: $(srcdir)/../SWIG/libapparmor.i
38 + $(SWIG) -python -I$(srcdir)/../../include -module LibAppArmor -o $@ $(srcdir)/../SWIG/libapparmor.i
39 +- mv LibAppArmor.py __init__.py
40 +
41 +-MOSTLYCLEANFILES=libapparmor_wrap.c __init__.py
42 ++MOSTLYCLEANFILES=libapparmor_wrap.c LibAppArmor.py
43 +
44 + all-local: libapparmor_wrap.c setup.py
45 + if test ! -f libapparmor_wrap.c; then cp $(srcdir)/libapparmor_wrap.c . ; fi
46 +
47 +--- a/dev/null
48 ++++ b/swig/python/__init__.py
49 +@@ -0,0 +1 @@
50 ++from LibAppArmor.LibAppArmor import *
51 +
52 +--- a/swig/python/Makefile.in
53 ++++ b/swig/python/Makefile.in
54 +@@ -326,7 +326,7 @@ top_builddir = @top_builddir@
55 + top_srcdir = @top_srcdir@
56 + @HAVE_PYTHON_TRUE@EXTRA_DIST = libapparmor_wrap.c
57 + @HAVE_PYTHON_TRUE@SUBDIRS = test
58 +-@HAVE_PYTHON_TRUE@MOSTLYCLEANFILES = libapparmor_wrap.c __init__.py
59 ++@HAVE_PYTHON_TRUE@MOSTLYCLEANFILES = libapparmor_wrap.c LibAppArmor.py
60 + all: all-recursive
61 +
62 + .SUFFIXES:
63 +@@ -648,7 +648,6 @@ uninstall-am:
64 +
65 + @HAVE_PYTHON_TRUE@libapparmor_wrap.c: $(srcdir)/../SWIG/libapparmor.i
66 + @HAVE_PYTHON_TRUE@ $(SWIG) -python -I$(srcdir)/../../include -module LibAppArmor -o $@ $(srcdir)/../SWIG/libapparmor.i
67 +-@HAVE_PYTHON_TRUE@ mv LibAppArmor.py __init__.py
68 +
69 + @HAVE_PYTHON_TRUE@all-local: libapparmor_wrap.c setup.py
70 + @HAVE_PYTHON_TRUE@ if test ! -f libapparmor_wrap.c; then cp $(srcdir)/libapparmor_wrap.c . ; fi
71 +
72
73 diff --git a/sys-libs/libapparmor/libapparmor-2.10.1-r1.ebuild b/sys-libs/libapparmor/libapparmor-2.10.1-r1.ebuild
74 new file mode 100644
75 index 00000000..c38bb1c
76 --- /dev/null
77 +++ b/sys-libs/libapparmor/libapparmor-2.10.1-r1.ebuild
78 @@ -0,0 +1,89 @@
79 +# Copyright 1999-2016 Gentoo Foundation
80 +# Distributed under the terms of the GNU General Public License v2
81 +# $Id$
82 +
83 +EAPI=5
84 +
85 +AUTOTOOLS_AUTORECONF=1
86 +DISTUTILS_OPTIONAL=1
87 +PYTHON_COMPAT=( python{2_7,3_3,3_4} )
88 +GENTOO_DEPEND_ON_PERL="no"
89 +
90 +inherit autotools-utils distutils-r1 perl-module versionator
91 +
92 +DESCRIPTION="Library to support AppArmor userspace utilities"
93 +HOMEPAGE="http://apparmor.net/"
94 +SRC_URI="https://launchpad.net/apparmor/$(get_version_component_range 1-2)/${PV}/+download/apparmor-${PV}.tar.gz"
95 +
96 +LICENSE="LGPL-2.1"
97 +SLOT="0"
98 +KEYWORDS="~amd64 ~x86"
99 +IUSE="doc +perl +python static-libs"
100 +
101 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
102 +
103 +RDEPEND="perl? ( dev-lang/perl:= )
104 + python? ( ${PYTHON_DEPS} )"
105 +
106 +DEPEND="${RDEPEND}
107 + sys-devel/autoconf-archive
108 + sys-devel/bison
109 + sys-devel/flex
110 + doc? ( dev-lang/perl )
111 + perl? ( dev-lang/swig )
112 + python? ( dev-lang/swig )"
113 +
114 +S=${WORKDIR}/apparmor-${PV}/libraries/${PN}
115 +
116 +src_prepare() {
117 + rm -r m4 || die "failed to remove bundled macros"
118 + epatch "${FILESDIR}"/${PN}-2.10-symbol_visibility.patch
119 + epatch "${FILESDIR}"/${PN}-2.10.1-import-path.patch
120 + autotools-utils_src_prepare
121 + use python && distutils-r1_src_prepare
122 +}
123 +
124 +src_configure() {
125 + local myeconfargs=(
126 + $(use_with perl) \
127 + $(use_with python)
128 + )
129 +
130 + autotools-utils_src_configure
131 +}
132 +
133 +src_compile() {
134 + autotools-utils_src_compile -C src
135 + autotools-utils_src_compile -C include
136 + use doc && autotools-utils_src_compile -C doc
137 + use perl && autotools-utils_src_compile -C swig/perl
138 +
139 + if use python ; then
140 + pushd "${BUILD_DIR}"/swig/python > /dev/null
141 + emake libapparmor_wrap.c
142 + distutils-r1_src_compile
143 + popd > /dev/null
144 + fi
145 +}
146 +
147 +src_install() {
148 + autotools-utils_src_install -C src
149 + autotools-utils_src_install -C include
150 + use doc && autotools-utils_src_install -C doc
151 +
152 + if use perl ; then
153 + autotools-utils_src_install -C swig/perl
154 + perl_set_version
155 + insinto "${VENDOR_ARCH}"
156 + doins "${BUILD_DIR}"/swig/perl/LibAppArmor.pm
157 + fi
158 +
159 + if use python ; then
160 + pushd "${BUILD_DIR}"/swig/python > /dev/null
161 + distutils-r1_src_install
162 +
163 + python_moduleinto LibAppArmor
164 + python_foreach_impl python_domodule LibAppArmor.py
165 + popd > /dev/null
166 + fi
167 +}