Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-libs/libcap-ng/, sys-libs/libcap-ng/files/
Date: Sat, 22 Feb 2014 16:02:17
Message-Id: 1393085014.4ccddb2765deea49149670e021a04cfb6e17aa5e.blueness@gentoo
1 commit: 4ccddb2765deea49149670e021a04cfb6e17aa5e
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 22 16:03:34 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 22 16:03:34 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=4ccddb27
7
8 sys-libs/libcap-ng: add missing unistd.h
9
10 Package-Manager: portage-2.2.7
11 RepoMan-Options: --force
12 Manifest-Sign-Key: 0xF52D4BBA
13
14 ---
15 .../libcap-ng-0.7.3-add-missing-unistd_h.patch | 11 ++
16 sys-libs/libcap-ng/libcap-ng-0.7.3-r99.ebuild | 117 +++++++++++++++++++++
17 sys-libs/libcap-ng/metadata.xml | 10 ++
18 3 files changed, 138 insertions(+)
19
20 diff --git a/sys-libs/libcap-ng/files/libcap-ng-0.7.3-add-missing-unistd_h.patch b/sys-libs/libcap-ng/files/libcap-ng-0.7.3-add-missing-unistd_h.patch
21 new file mode 100644
22 index 0000000..fa6fab2
23 --- /dev/null
24 +++ b/sys-libs/libcap-ng/files/libcap-ng-0.7.3-add-missing-unistd_h.patch
25 @@ -0,0 +1,11 @@
26 +diff -Naur libcap-ng-0.7.3.orig/utils/proc-llist.c libcap-ng-0.7.3/utils/proc-llist.c
27 +--- libcap-ng-0.7.3.orig/utils/proc-llist.c 2012-11-09 19:59:13.000000000 +0000
28 ++++ libcap-ng-0.7.3/utils/proc-llist.c 2014-02-22 15:58:17.933566760 +0000
29 +@@ -24,6 +24,7 @@
30 + #include "config.h"
31 + #include <stdlib.h>
32 + #include <string.h>
33 ++#include <unistd.h>
34 + #include "proc-llist.h"
35 +
36 + void list_create(llist *l)
37
38 diff --git a/sys-libs/libcap-ng/libcap-ng-0.7.3-r99.ebuild b/sys-libs/libcap-ng/libcap-ng-0.7.3-r99.ebuild
39 new file mode 100644
40 index 0000000..2bada81
41 --- /dev/null
42 +++ b/sys-libs/libcap-ng/libcap-ng-0.7.3-r99.ebuild
43 @@ -0,0 +1,117 @@
44 +# Copyright 1999-2014 Gentoo Foundation
45 +# Distributed under the terms of the GNU General Public License v2
46 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap-ng/libcap-ng-0.7.3.ebuild,v 1.14 2014/01/19 20:11:39 vapier Exp $
47 +
48 +EAPI=5
49 +
50 +SUPPORT_PYTHON_ABIS="1"
51 +RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
52 +
53 +inherit autotools eutils flag-o-matic python
54 +
55 +DESCRIPTION="POSIX 1003.1e capabilities"
56 +HOMEPAGE="http://people.redhat.com/sgrubb/libcap-ng/"
57 +SRC_URI="http://people.redhat.com/sgrubb/${PN}/${P}.tar.gz"
58 +
59 +LICENSE="LGPL-2.1"
60 +SLOT="0"
61 +KEYWORDS="amd64 arm x86"
62 +IUSE="python static-libs"
63 +
64 +RDEPEND="python? ( dev-lang/python )"
65 +DEPEND="${RDEPEND}
66 + sys-kernel/linux-headers
67 + python? ( >=dev-lang/swig-2 )"
68 +
69 +PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
70 +
71 +pkg_setup() {
72 + use python && python_pkg_setup
73 +}
74 +
75 +src_prepare() {
76 + epatch "${FILESDIR}"/${P}-add-missing-unistd_h.patch
77 +
78 + # Disable byte-compilation of Python modules.
79 + >py-compile
80 +
81 + # Python bindings are built/tested/installed manually.
82 + sed -i -e "/^SUBDIRS/s/ python//" bindings/Makefile.am || die
83 + sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die
84 +
85 + eautoreconf
86 +
87 + use sparc && replace-flags -O? -O0
88 +}
89 +
90 +src_configure() {
91 + econf \
92 + $(use_enable static-libs static) \
93 + $(use_with python)
94 +}
95 +
96 +src_compile() {
97 + default
98 +
99 + if use python; then
100 + python_copy_sources bindings/python
101 +
102 + building() {
103 + emake \
104 + CFLAGS="${CFLAGS}" \
105 + PYTHON_VERSION="$(python_get_version)" \
106 + pyexecdir="$(python_get_sitedir)" \
107 + pythondir="$(python_get_sitedir)"
108 + }
109 + python_execute_function -s --source-dir bindings/python building
110 + fi
111 +}
112 +
113 +src_test() {
114 + if [[ "${EUID}" -eq 0 ]]; then
115 + ewarn "Skipping tests due to root permissions."
116 + return
117 + fi
118 +
119 + default
120 +
121 + if use python; then
122 + testing() {
123 + emake \
124 + PYTHON_VERSION="$(python_get_version)" \
125 + pyexecdir="$(python_get_sitedir)" \
126 + pythondir="$(python_get_sitedir)" \
127 + TESTS_ENVIRONMENT="PYTHONPATH=..:../.libs" \
128 + check
129 + }
130 + python_execute_function -s --source-dir bindings/python testing
131 + fi
132 +}
133 +
134 +src_install() {
135 + default
136 +
137 + if use python; then
138 + installation() {
139 + emake \
140 + DESTDIR="${D}" \
141 + PYTHON_VERSION="$(python_get_version)" \
142 + pyexecdir="$(python_get_sitedir)" \
143 + pythondir="$(python_get_sitedir)" \
144 + install
145 + }
146 + python_execute_function -s --source-dir bindings/python installation
147 +
148 + python_clean_installation_image
149 + fi
150 +
151 + rm -f "${ED}"/usr/lib*/${PN}.la
152 +}
153 +
154 +pkg_postinst() {
155 + use python && python_mod_optimize capng.py
156 +}
157 +
158 +pkg_postrm() {
159 + use python && python_mod_cleanup capng.py
160 +}
161
162 diff --git a/sys-libs/libcap-ng/metadata.xml b/sys-libs/libcap-ng/metadata.xml
163 new file mode 100644
164 index 0000000..703c252
165 --- /dev/null
166 +++ b/sys-libs/libcap-ng/metadata.xml
167 @@ -0,0 +1,10 @@
168 +<?xml version = '1.0' encoding = 'UTF-8'?>
169 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
170 +<pkgmetadata>
171 + <herd>base-system</herd>
172 + <longdescription>The libcap-ng library is intended to make programming with
173 + POSIX capabilities much easier than the traditional libcap library. It
174 + includes utilities that can analyse all currently running applications and
175 + print out any capabilities and whether or not it has an open ended bounding
176 + set.</longdescription>
177 +</pkgmetadata>