From 6a00d13f46b31a907b69b5630c549d8982568722b2a105f24f1e7a7dd77239b7 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 20 Jun 2019 08:36:13 +0000 Subject: [PATCH] Accepting request 711033 from home:cyphar:lxc Fix builds. OBS-URL: https://build.opensuse.org/request/show/711033 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=20 --- lxd.spec | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lxd.spec b/lxd.spec index 621b478..e7ab74e 100644 --- a/lxd.spec +++ b/lxd.spec @@ -188,6 +188,14 @@ done # # [1]: https://github.com/NixOS/nixpkgs/issues/24844 +( + # A simple check that lxd isn't broken. We can't do this after patchelf + # because we'd need to chroot(2) into {buildroot} which isn't permitted due + # to user namespaces being blocked inside rpmbuild. boo#1138769 + export LD_LIBRARY_PATH="$PKGDIR/dist/sqlite/.libs/:$PKGDIR/dist/dqlite/.libs/" + ./bin/lxd help >/dev/null +) + # Give our libraries unrecognisable DT_SONAME entries. patchelf --set-soname '._LXD_INTERNAL-libsqlite3.so.0' "$PKGDIR/dist/sqlite/.libs/libsqlite3.so.0" patchelf --set-soname '._LXD_INTERNAL-libdqlite.so.0' "$PKGDIR/dist/dqlite/.libs/libdqlite.so.0" @@ -204,6 +212,14 @@ patchelf --replace-needed {,%{_libdir}/%{name}/}'libsqlite3.so.0' "$PKGDIR/dist/ mkdir man ./bin/lxc manpage man/ +# Ensure that all our binaries are dynamic. boo#1138769 +pushd bin/ +for bin in * +do + file "$bin" | grep 'dynamically linked' +done +popd + %install export GOPATH="$PWD/.gopath" export PKGDIR="$GOPATH/src/%{import_path}" @@ -250,11 +266,6 @@ install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} %fdupes %{buildroot} -%check -# Make sure the main binaries work enough to print help information. boo#1138769 -%{_bindir}/lxd help >/dev/null -%{_bindir}/lxc help >/dev/null - %pre # Group which owns the lxd socket, which allows people to administer it. getent group %{name} >/dev/null || groupadd -r %{name}