From d4c91d673460150d6d990bccdcabd4100cf3a476815923981369a8292b7915be Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Sat, 6 Mar 2021 08:04:46 +0000 Subject: [PATCH] Accepting request 877355 from home:cyphar:lxc - Prefix all binaries with lxd- if they don't start with "lx[cd]". This is to avoid having cases like lxd-generate where there's a binary in /usr/bin that has a super-generic name. OBS-URL: https://build.opensuse.org/request/show/877355 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=79 --- lxd.changes | 3 +++ lxd.spec | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lxd.changes b/lxd.changes index 3dea55b..1ac4042 100644 --- a/lxd.changes +++ b/lxd.changes @@ -16,6 +16,9 @@ Fri Mar 5 16:31:52 UTC 2021 - Aleksa Sarai - Updated packaging to support VMs, though note that LXD's usage of QEMU causes issues with QEMU 5.2 on openSUSE (because of how we package it). See for more details. bsc#1181549 +- Prefix all binaries with lxd- if they don't start with "lx[cd]". This is to + avoid having cases like lxd-generate where there's a binary in /usr/bin that + has a super-generic name. ------------------------------------------------------------------- Fri Feb 5 07:41:04 UTC 2021 - Aleksa Sarai diff --git a/lxd.spec b/lxd.spec index 34b194c..c734843 100644 --- a/lxd.spec +++ b/lxd.spec @@ -171,7 +171,12 @@ export GOPATH="$GOPATH:$PKGDIR/_dist" mkdir bin for mainpkg in "${mainpkgs[@]}" do + # Make sure all binaries *except* "lxc" have an lxd- prefix. binary="$(basename "$mainpkg")" + if ( echo "$binary" | grep -Eqv '^lx[cd].*$' ) + then + binary="lxd-$binary" + fi ( # We need to link against our particular dylib deps. export \ @@ -244,6 +249,7 @@ done mkdir man ./bin/lxc manpage man/ +# Final sanity-check during build. pushd bin/ for bin in * do @@ -353,7 +359,7 @@ grep -q '^root:' /etc/subgid || \ %defattr(-,root,root) %doc AUTHORS README.md doc/ %license COPYING -%{_bindir}/* +%{_bindir}/lx{c,d}* %{_mandir}/man*/* %{_libdir}/%{name}