Hello community, here is the log from the commit of package lxd for openSUSE:Factory checked in at 2019-09-26 20:40:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lxd (Old) and /work/SRC/openSUSE:Factory/.lxd.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lxd" Thu Sep 26 20:40:40 2019 rev:5 rq:733136 version:3.17 Changes: -------- --- /work/SRC/openSUSE:Factory/lxd/lxd.changes 2019-09-25 08:45:43.118244911 +0200 +++ /work/SRC/openSUSE:Factory/.lxd.new.2352/lxd.changes 2019-09-26 20:40:45.486618790 +0200 @@ -1,0 +2,5 @@ +Wed Sep 25 11:03:42 UTC 2019 - Aleksa Sarai <asa...@suse.com> + +- Clean up a few remaining specfile bits left over from the 3.17 update. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lxd.spec ++++++ --- /var/tmp/diff_new_pack.MSmIpu/_old 2019-09-26 20:40:46.826615210 +0200 +++ /var/tmp/diff_new_pack.MSmIpu/_new 2019-09-26 20:40:46.826615210 +0200 @@ -100,24 +100,25 @@ # Make sure any leftover go build caches are gone. go clean -cache -# Keep track of the current set of paths needed to generate the include-related -# variables for later stages. -declare -a CURRENT_DEPLIST - # Set up GOPATH. export GOPATH="$PWD/.gopath" export PKGDIR="$GOPATH/src/%{import_path}" mkdir -p "$PKGDIR" cp -a * "$PKGDIR" -# First we need to build the sqlite fork and dqlite. We need to build them -# dynamically (to avoid binary bloat), but we also then need to mess with -# patchelf to stop us from breaking openSUSE packaging. +# Set up temporary installation paths. +export INSTALL_ROOT="$PKGDIR/.install" +export INSTALL_INCLUDEDIR="$INSTALL_ROOT/%{_includedir}" +export INSTALL_LIBDIR="$INSTALL_ROOT/%{_libdir}/%{name}" + +# We first need to build all of the LXD-specific dependencies. To avoid binary +# bloat, we build them as dylibs -- but we then later need to mess around with +# the ELF headers to stop the openSUSE packaging scripts from freaking out. export CFLAGS="%{optflags} -fPIC -DPIC" -# We have a temporary-install directory which contains our pkg-configs. -export PKG_CONFIG_SYSROOT_DIR="$PKGDIR/.install" -export PKG_CONFIG_PATH="$PKG_CONFIG_SYSROOT_DIR/%{_libdir}/%{name}/pkgconfig:$PKG_CONFIG_SYSROOT_DIR/%{_datadir}/pkgconfig" +# We have a temporary-install directory which contains all of the dylib deps. +export PKG_CONFIG_SYSROOT_DIR="$INSTALL_ROOT" +export PKG_CONFIG_PATH="$INSTALL_LIBDIR/pkgconfig" # SQLite pushd "$PKGDIR/_dist/deps/sqlite" @@ -129,9 +130,7 @@ --disable-tcl make clean make %{?_smp_mflags} -make DESTDIR="$PKGDIR/.install" install -# Add sqlite to dependency list. -CURRENT_DEPLIST+=("$PWD") +make DESTDIR="$INSTALL_ROOT" install popd # libco @@ -141,10 +140,8 @@ PREFIX="" \ INCLUDEDIR="%{_includedir}" \ LIBDIR="%{_libdir}/%{name}" \ - DESTDIR="$PKGDIR/.install" \ + DESTDIR="$INSTALL_ROOT" \ all install -# Add libco to dependency list. -CURRENT_DEPLIST+=("$PWD") popd # raft @@ -154,9 +151,7 @@ --libdir="%{_libdir}/%{name}" \ --disable-static make %{?_smp_mflags} -make DESTDIR="$PKGDIR/.install" install -# Add raft to dependency list. -CURRENT_DEPLIST+=("$PWD") +make DESTDIR="$INSTALL_ROOT" install popd # dqlite @@ -168,10 +163,8 @@ --disable-static make clean make %{?_smp_mflags} -make DESTDIR="$PKGDIR/.install" install +make DESTDIR="$INSTALL_ROOT" install ) -# Add raft to dependency list. -CURRENT_DEPLIST+=("$PWD") popd # Find all of the main packages using go-list. @@ -186,11 +179,11 @@ do binary="$(basename "$mainpkg")" ( - # We need to link against sqlite and dqlite only when dealing with lxd proper. + # We need to link against our dylib deps when dealing with lxd proper. [ "$binary" == "lxd" ] && export \ BUILDTAGS="libsqlite3" \ - CGO_CFLAGS="-I $PKGDIR/.install/%{_includedir}" \ - CGO_LDFLAGS="-L $PKGDIR/.install/%{_libdir}/%{name}" ||: + CGO_CFLAGS="-I $INSTALL_INCLUDEDIR" \ + CGO_LDFLAGS="-L $INSTALL_LIBDIR" ||: go build -buildmode=pie -tags "$BUILDTAGS" -o "bin/$binary" "$mainpkg" ) done @@ -224,27 +217,29 @@ # 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/.install/%{_libdir}/%{name}" - ./bin/lxd help >/dev/null + export LD_LIBRARY_PATH="$INSTALL_LIBDIR" + ./bin/lxd help ) -for lib in $PKGDIR/.install/%{_libdir}/%{name}/lib*.so +for lib in "$INSTALL_LIBDIR"/lib*.so do # Strip off last two version digits. name="$(basename "$(readlink "$lib")" | sed -E 's/\.[0-9]+\.[0-9]+$//')" # Give our libraries unrecognisable DT_SONAME entries. patchelf --set-soname "._LXD_INTERNAL-$name" "$lib" + # Make sure they're executable. + chmod +x "$lib" done # Switch to absolute DT_NEEDED for all dylibs we have as well as the main LXD # binary. We do this for all dylibs to make sure we don't end up with weird # chain-loading problems. -for target in bin/lxd $PKGDIR/.install/%{_libdir}/%{name}/lib*.so +for target in bin/lxd "$INSTALL_LIBDIR"/lib*.so do # Drop RPATH in case it got included during builds. patchelf --remove-rpath "$target" # And now replace all the possible DT_NEEDEDs to absolute paths. - for lib in $PKGDIR/.install/%{_libdir}/%{name}/lib*.so + for lib in "$INSTALL_LIBDIR"/lib*.so do # Strip off last two version digits. name="$(basename "$(readlink "$lib")" | sed -E 's/\.[0-9]+\.[0-9]+$//')" @@ -267,12 +262,11 @@ %install export GOPATH="$PWD/.gopath" export PKGDIR="$GOPATH/src/%{import_path}" +export INSTALL_LIBDIR="$PKGDIR/.install/%{_libdir}/%{name}" install -d -m 0755 %{buildroot}%{_libdir}/%{name} -pushd "$PKGDIR" # We can't use install because *.so.$n are symlinks. -cp -avt %{buildroot}%{_libdir}/%{name}/ $PKGDIR/.install/%{_libdir}/%{name}/lib*.so.* -popd +cp -avt %{buildroot}%{_libdir}/%{name}/ "$INSTALL_LIBDIR"/lib*.so.* # Install all the binaries. pushd bin/