Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/keyutils/files/, sys-apps/keyutils/
Date: Fri, 16 Nov 2018 12:54:04
Message-Id: 1542372705.cbb28eaa7d2cd7b18b874c51f7ab0f0efcbf66b4.polynomial-c@gentoo
1 commit: cbb28eaa7d2cd7b18b874c51f7ab0f0efcbf66b4
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 16 12:51:45 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 16 12:51:45 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbb28eaa
7
8 sys-apps/keyutils: Bump to version 1.6
9
10 Package-Manager: Portage-2.3.51, Repoman-2.3.12
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 sys-apps/keyutils/Manifest | 1 +
14 .../files/keyutils-1.6-endian-check-1.patch | 32 ++++++
15 .../files/keyutils-1.6-makefile-fixup.patch | 25 +++++
16 sys-apps/keyutils/keyutils-1.6.ebuild | 121 +++++++++++++++++++++
17 4 files changed, 179 insertions(+)
18
19 diff --git a/sys-apps/keyutils/Manifest b/sys-apps/keyutils/Manifest
20 index 3892769c71a..2fbe7776b33 100644
21 --- a/sys-apps/keyutils/Manifest
22 +++ b/sys-apps/keyutils/Manifest
23 @@ -1,3 +1,4 @@
24 DIST keyutils-1.5.10.tar.bz2 74190 BLAKE2B 8eeab02ef363b785152ac4576f1ce9792711f482e27c3ba71d906624ecc88ef4ce2ee909d7bc3a35b42b50e971c0bd0600cfdefa9a3db35b25553bfcbe7d2d13 SHA512 7f6f956c7e76cdc2aeb52e74fe670b20a5f9a5d9b543fd2ce971d80c48745f37d05235a42f0a8f152b1128a109c7d8bf07e751282a20d2d3f433a99a5308ae8d
25 DIST keyutils-1.5.11.tar.bz2 87644 BLAKE2B 1a601b7036bcfe69b6272ae2b4fad44cbb22877aa94722fa26460f8addf105ff8898e851ad7c4f28bc755f7fe293c74bc70cffbe877978e462bc21c428c9a11d SHA512 5f0dc5d5ceb673cf0ba71d3a0b525d09adc8d501a795372aa3dc29215ef393cb8577c72051cecabdb9a46dca4fcaa11e629291fb857290872475a7e445f47d43
26 DIST keyutils-1.5.9.tar.bz2 74683 BLAKE2B 8d5133dcc4c1f40e634fcd6584f3e2e56a0fd4ff25ded41c5f94ef3193ef7240ff4a24ef1c5beba6ba835195605a77126bf77aace35a1b4acf025160a2082dcb SHA512 d4ee1dabb87844e18bfd8d094a5bc9ce792c96720b71e77961b6c36bb1addb9acea2a7004ddfba1d09b167af908368162312e5c3656b22a6266955bb57b887e2
27 +DIST keyutils-1.6.tar.bz2 93973 BLAKE2B 250275852d13fb5f77786350e64175c9c0909d1a7e44750e44b09f79217acb9c40536bd61e15d1abdfe36b9e161832f4c59f11b73915d457356a273ad4999990 SHA512 ee50da165099ea26904066d24b27c5165cb1eb78df6768cba3a534aa318a5c8d926ec6e5322a38c8cedaa768cd79bdcb26ef918aa8447df2e5dfbbe7b8f200ff
28
29 diff --git a/sys-apps/keyutils/files/keyutils-1.6-endian-check-1.patch b/sys-apps/keyutils/files/keyutils-1.6-endian-check-1.patch
30 new file mode 100644
31 index 00000000000..e783ec699c3
32 --- /dev/null
33 +++ b/sys-apps/keyutils/files/keyutils-1.6-endian-check-1.patch
34 @@ -0,0 +1,32 @@
35 +From 0a99778774df85448aeda0a37b85c43bc8868a9e Mon Sep 17 00:00:00 2001
36 +From: Lars Wendler <polynomial-c@g.o>
37 +Date: Fri, 16 Nov 2018 12:37:29 +0100
38 +Subject: [PATCH] fix regexp match against `file /proc/$$/exe` for -fPIE bash
39 +
40 +Now that bash is built with PIE enabled, keyutils' check for endianness
41 +fails because file no longer returns "executable", but instead returns
42 +"shared object" for file << 5.33 and "pie executable" for file >= 5.33.
43 +---
44 + tests/toolbox.inc.sh | 4 ++--
45 + 1 file changed, 2 insertions(+), 2 deletions(-)
46 +
47 +diff --git a/tests/toolbox.inc.sh b/tests/toolbox.inc.sh
48 +index 0ce6db0..712c5bd 100644
49 +--- a/tests/toolbox.inc.sh
50 ++++ b/tests/toolbox.inc.sh
51 +@@ -13,10 +13,10 @@
52 + echo === $OUTPUTFILE ===
53 +
54 + endian=`file -L /proc/$$/exe`
55 +-if expr "$endian" : '.* MSB \+\(executable\|shared object\).*' >&/dev/null
56 ++if expr "$endian" : '.* MSB \+\(executable\|shared object\|pie executable\).*' >&/dev/null
57 + then
58 + endian=BE
59 +-elif expr "$endian" : '.* LSB \+\(executable\|shared object\).*' >&/dev/null
60 ++elif expr "$endian" : '.* LSB \+\(executable\|shared object\|pie executable\).*' >&/dev/null
61 + then
62 + endian=LE
63 + else
64 +--
65 +2.19.1
66 +
67
68 diff --git a/sys-apps/keyutils/files/keyutils-1.6-makefile-fixup.patch b/sys-apps/keyutils/files/keyutils-1.6-makefile-fixup.patch
69 new file mode 100644
70 index 00000000000..25dcdeb5fc3
71 --- /dev/null
72 +++ b/sys-apps/keyutils/files/keyutils-1.6-makefile-fixup.patch
73 @@ -0,0 +1,25 @@
74 +From d1a02ed81c86fe7140f93b9a160fbb53be148446 Mon Sep 17 00:00:00 2001
75 +From: Mike Frysinger <vapier@g.o>
76 +Date: Fri, 16 Nov 2018 12:39:12 +0100
77 +Subject: [PATCH] depend on $(DEVELLIB) not -lkeyutils
78 +
79 +---
80 + Makefile | 2 +-
81 + 1 file changed, 1 insertion(+), 1 deletion(-)
82 +
83 +diff --git a/Makefile b/Makefile
84 +index 33a451e..845b8fe 100644
85 +--- a/Makefile
86 ++++ b/Makefile
87 +@@ -184,7 +184,7 @@ ifeq ($(NO_SOLIB),0)
88 + $(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
89 + $(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
90 + mkdir -p $(DESTDIR)$(USRLIBDIR)
91 +- $(LNS) $(LIBDIR)/$(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
92 ++ $(LNS) $(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
93 + sed \
94 + -e 's,@VERSION\@,$(VERSION),g' \
95 + -e 's,@prefix\@,$(PREFIX),g' \
96 +--
97 +2.19.1
98 +
99
100 diff --git a/sys-apps/keyutils/keyutils-1.6.ebuild b/sys-apps/keyutils/keyutils-1.6.ebuild
101 new file mode 100644
102 index 00000000000..ab926f98b57
103 --- /dev/null
104 +++ b/sys-apps/keyutils/keyutils-1.6.ebuild
105 @@ -0,0 +1,121 @@
106 +# Copyright 1999-2018 Gentoo Authors
107 +# Distributed under the terms of the GNU General Public License v2
108 +
109 +EAPI="6"
110 +
111 +inherit multilib toolchain-funcs linux-info multilib-minimal
112 +
113 +DESCRIPTION="Linux Key Management Utilities"
114 +HOMEPAGE="https://people.redhat.com/dhowells/keyutils/"
115 +SRC_URI="https://people.redhat.com/dhowells/${PN}/${P}.tar.bz2"
116 +
117 +LICENSE="GPL-2 LGPL-2.1"
118 +SLOT="0/1.8"
119 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
120 +IUSE="static static-libs test"
121 +
122 +RDEPEND=""
123 +DEPEND="!prefix? ( >=sys-kernel/linux-headers-2.6.11 )"
124 +
125 +PATCHES=(
126 + "${FILESDIR}"/${PN}-1.6-endian-check-1.patch
127 + "${FILESDIR}"/${PN}-1.6-makefile-fixup.patch
128 + "${FILESDIR}"/${PN}-1.5.10-silence-rpm-check.patch #656446
129 + "${FILESDIR}"/${PN}-1.5.10-disable-tests.patch #519062 #522050
130 + "${FILESDIR}"/${PN}-1.5.9-header-extern-c.patch
131 +)
132 +
133 +pkg_setup() {
134 + # To prevent a failure in test phase and false positive bug reports
135 + # we are enforcing the following options because testsuite expects
136 + # that these options are available. I.e. testsuite only decides based
137 + # on kernel version which tests will be called, no feature checking.
138 + if use test ; then
139 + CONFIG_CHECK="KEYS"
140 + ERROR_KEYS="You must have CONFIG_KEYS to run the package testsuite!"
141 +
142 + if kernel_is -ge 2 6 10 && kernel_is -lt 4 0 0 ; then
143 + CONFIG_CHECK="${CONFIG_CHECK} KEYS_DEBUG_PROC_KEYS"
144 + ERROR_KEYS_DEBUG_PROC_KEYS="You must have CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
145 + fi
146 +
147 + if kernel_is -ge 4 7 ; then
148 + CONFIG_CHECK="${CONFIG_CHECK} KEY_DH_OPERATIONS"
149 + ERROR_KEY_DH_OPERATIONS="You must have CONFIG_KEY_DH_OPERATIONS to run the package testsuite!"
150 + fi
151 + else
152 + CONFIG_CHECK="~KEYS"
153 + ERROR_KEYS="You will be unable to use this package on this system because CONFIG_KEYS is not set!"
154 +
155 + if kernel_is -ge 4 7 ; then
156 + CONFIG_CHECK="${CONFIG_CHECK} ~KEY_DH_OPERATIONS"
157 + ERROR_KEY_DH_OPERATIONS="You will be unable to use Diffie-Hellman on this system because CONFIG_KEY_DH_OPERATIONS is not set!"
158 + fi
159 + fi
160 +
161 + linux-info_pkg_setup
162 +}
163 +
164 +src_prepare() {
165 + default
166 +
167 + # The lsb check is useless, so avoid spurious command not found messages.
168 + sed -i -e 's,lsb_release,:,' tests/prepare.inc.sh || die
169 + # All the test files are bash, but try to execute via `sh`.
170 + sed -i -r \
171 + -e 's:([[:space:]])sh([[:space:]]):\1bash\2:' \
172 + tests/{Makefile*,*.sh} || die
173 + find tests/ -name '*.sh' -exec sed -i '1s:/sh$:/bash:' {} + || die
174 + # Some tests call the kernel which calls userspace, but that will
175 + # run the install keyutils rather than the locally compiled one,
176 + # so disable round trip tests.
177 + rm -rf tests/keyctl/requesting/{bad-args,piped,valid}
178 +
179 + multilib_copy_sources
180 +}
181 +
182 +multilib_src_compile() {
183 + tc-export AR CC
184 + sed -i \
185 + -e "1iRPATH = $(usex static -static '')" \
186 + -e '/^C.*FLAGS/s|:=|+=|' \
187 + -e 's:-Werror::' \
188 + -e '/^BUILDFOR/s:=.*:=:' \
189 + -e "/^LIBDIR/s:=.*:= /usr/$(get_libdir):" \
190 + -e '/^USRLIBDIR/s:=.*:=$(LIBDIR):' \
191 + -e "s: /: ${EPREFIX}/:g" \
192 + -e '/^NO_ARLIB/d' \
193 + Makefile || die
194 +
195 + # We need the static lib in order to statically link programs.
196 + if use static ; then
197 + export NO_ARLIB=0
198 + # Hack the progs to depend on the static lib instead.
199 + sed -i \
200 + -e '/^.*:.*[$](DEVELLIB)$/s:$(DEVELLIB):$(ARLIB) $(SONAME):' \
201 + Makefile || die
202 + else
203 + export NO_ARLIB=$(usex static-libs 0 1)
204 + fi
205 + emake
206 +}
207 +
208 +multilib_src_test() {
209 + # Execute the locally compiled code rather than the
210 + # older versions already installed in the system.
211 + LD_LIBRARY_PATH=${BUILD_DIR} \
212 + PATH="${BUILD_DIR}:${PATH}" \
213 + emake test
214 +}
215 +
216 +multilib_src_install() {
217 + # Possibly undo the setting for USE=static (see src_compile).
218 + export NO_ARLIB=$(usex static-libs 0 1)
219 +
220 + default
221 + use static || gen_usr_ldscript -a keyutils
222 +}
223 +
224 +multilib_src_install_all() {
225 + dodoc README
226 +}