Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 460044 | Differences between
and this patch

Collapse All | Expand All

(-)libcap-ng-0.7.3.ebuild (-61 / +38 lines)
Lines 4-13 Link Here
4
4
5
EAPI=5
5
EAPI=5
6
6
7
SUPPORT_PYTHON_ABIS="1"
7
AUTOTOOLS_AUTORECONF=1
8
RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
8
AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
9
PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
9
10
10
inherit autotools flag-o-matic python
11
inherit autotools-utils flag-o-matic python-r1
11
12
12
DESCRIPTION="POSIX 1003.1e capabilities"
13
DESCRIPTION="POSIX 1003.1e capabilities"
13
HOMEPAGE="http://people.redhat.com/sgrubb/libcap-ng/"
14
HOMEPAGE="http://people.redhat.com/sgrubb/libcap-ng/"
Lines 15-67 SRC_URI="http://people.redhat.com/sgrubb Link Here
15
16
16
LICENSE="LGPL-2.1"
17
LICENSE="LGPL-2.1"
17
SLOT="0"
18
SLOT="0"
18
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~arm-linux ~x86-linux"
19
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
19
IUSE="python static-libs"
20
IUSE="python static-libs"
20
21
21
RDEPEND="python? ( dev-lang/python )"
22
RDEPEND="python? ( ${PYTHON_DEPS} )"
22
DEPEND="${RDEPEND}
23
DEPEND="${RDEPEND}
23
	sys-kernel/linux-headers
24
	sys-kernel/linux-headers
24
	python? ( >=dev-lang/swig-2 )"
25
	python? ( >=dev-lang/swig-2 )"
25
26
26
PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
27
28
pkg_setup() {
29
	use python && python_pkg_setup
30
}
31
32
src_prepare() {
27
src_prepare() {
33
	# Disable byte-compilation of Python modules.
34
	>py-compile
35
36
	# Python bindings are built/tested/installed manually.
37
	sed -i -e "/^SUBDIRS/s/ python//" bindings/Makefile.am || die
38
	sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die
28
	sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die
39
29
40
	eautoreconf
30
	autotools-utils_src_prepare
41
31
42
	use sparc && replace-flags -O? -O0
32
	use sparc && replace-flags -O? -O0
43
}
33
}
44
34
45
src_configure() {
35
src_configure() {
46
	econf \
36
	local myeconfargs=(
47
		$(use_enable static-libs static) \
37
		--without-python
48
		$(use_with python)
38
	)
39
40
	# set up the library build
41
	autotools-utils_src_configure
42
43
	if use python; then
44
		python_parallel_foreach_impl \
45
			autotools-utils_src_configure --with-python
46
	fi
49
}
47
}
50
48
51
src_compile() {
49
src_compile() {
52
	default
50
	autotools-utils_src_compile
53
51
54
	if use python; then
52
	if use python; then
55
		python_copy_sources bindings/python
53
		python_compile() {
54
			local CFLAGS=${CFLAGS}
56
55
57
		building() {
56
			python_is_python3 || CFLAGS+=" -fno-strict-aliasing"
58
			emake \
57
59
				CFLAGS="${CFLAGS}" \
58
			emake "${@}" \
60
				PYTHON_VERSION="$(python_get_version)" \
59
				-C "${BUILD_DIR}"/bindings/python
61
				pyexecdir="$(python_get_sitedir)" \
62
				pythondir="$(python_get_sitedir)"
63
		}
60
		}
64
		python_execute_function -s --source-dir bindings/python building
61
62
		# help build system find the right objects
63
		python_foreach_impl python_compile \
64
			VPATH="${BUILD_DIR}"/bindings/python \
65
			LIBS="${BUILD_DIR}"/src/libcap-ng.la
65
	fi
66
	fi
66
}
67
}
67
68
Lines 71-115 src_test() { Link Here
71
		return
72
		return
72
	fi
73
	fi
73
74
74
	default
75
	autotools-utils_src_test
75
76
76
	if use python; then
77
	if use python; then
77
		testing() {
78
		python_foreach_impl \
78
			emake \
79
			autotools-utils_src_compile -C bindings/python check \
79
				PYTHON_VERSION="$(python_get_version)" \
80
			VPATH="${BUILD_DIR}"/bindings/python:"${S}"/bindings/python/test
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
81
	fi
87
}
82
}
88
83
89
src_install() {
84
src_install() {
90
	default
85
	autotools-utils_src_install
91
86
92
	if use python; then
87
	if use python; then
93
		installation() {
88
		python_foreach_impl \
94
			emake \
89
			autotools-utils_src_install -C bindings/python \
95
				DESTDIR="${D}" \
90
			VPATH="${BUILD_DIR}"/bindings/python
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
91
	fi
105
106
	rm -f "${ED}"/usr/lib*/${PN}.la
107
}
108
109
pkg_postinst() {
110
	use python && python_mod_optimize capng.py
111
}
112
113
pkg_postrm() {
114
	use python && python_mod_cleanup capng.py
115
}
92
}

Return to bug 460044