Bundle libdnf to match the exact version that rpm-ostree ships

This commit is contained in:
Kalev Lember 2019-02-24 23:45:53 +01:00
parent cce05cbd4a
commit 3f1f74f014
3 changed files with 50 additions and 0 deletions

1
.gitignore vendored
View File

@ -98,3 +98,4 @@
/gnome-software-3.31.1.tar.xz
/gnome-software-3.31.2.tar.xz
/gnome-software-3.31.90.tar.xz
/libdnf-7ecb2f5.tar.gz

View File

@ -9,6 +9,15 @@
%global fwupd_version 1.0.7
%global flatpak_version 1.1.3
%global bundled_libdnf 1
%if 0%{?bundled_libdnf}
%global commit1 7ecb2f5ddc93ae6f819b95ef7940b1d4dd66eb4d
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
%global __requires_exclude ^libdnf[.]so[.].*$
%endif
Name: gnome-software
Version: 3.31.90
Release: 1%{?dist}
@ -17,6 +26,14 @@ Summary: A software center for GNOME
License: GPLv2+
URL: https://wiki.gnome.org/Apps/Software
Source0: https://download.gnome.org/sources/gnome-software/3.31/%{name}-%{version}.tar.xz
%if 0%{?bundled_libdnf}
# libdnf is bundled to be able to match the exact same version that the
# rpm-ostree package bundles. This is only used for the rpm-ostree backend.
Source1: https://github.com/projectatomic/libdnf/archive/%{commit1}/libdnf-%{shortcommit1}.tar.gz
Provides: bundled(libdnf) = 0.12.1
%endif
# Lower appstream-glib version check as we have the required new API backported to
# libappstream-glib-0.7.14-3.fc29.
Patch0: 0001-Lower-as_utils_vercmp_full-version-check-for-Fedora.patch
@ -51,6 +68,14 @@ BuildRequires: liboauth-devel
%if 0%{?fedora}
BuildRequires: snapd-glib-devel >= 1.42
%endif
%if 0%{?bundled_libdnf}
BuildRequires: check-devel
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: librepo-devel
BuildRequires: libsolv-devel
BuildRequires: rpm-devel
%endif
Requires: appstream-data
%if 0%{?fedora}
@ -109,7 +134,30 @@ Adds support for Snap packages from the Snap store.
%prep
%autosetup -p1
%if 0%{?bundled_libdnf}
# Extract libdnf archive
tar -xf %{S:1}
%endif
%build
%if 0%{?bundled_libdnf}
mkdir -p libdnf-%{commit1}/build
pushd libdnf-%{commit1}/build
%cmake \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_SWDB:BOOL=0 \
-DWITH_BINDINGS:BOOL=0 \
-DWITH_HTML:BOOL=0 \
-DWITH_MAN:BOOL=0 \
..
%make_build
sed -i -e "/^Libs:/ s|\${libdir}|`pwd`/libdnf|" \
-e "/^Cflags:/ s|\${includedir}|`pwd`/..|" \
libdnf/libdnf.pc
export PKG_CONFIG_PATH="`pwd`/libdnf"
popd
%endif
%meson \
%if 0%{?fedora}
-Dsnap=true \

View File

@ -1 +1,2 @@
SHA512 (gnome-software-3.31.90.tar.xz) = c0116cbd1e0d47f26429f484df16d01b803a91c91f234dcc3e25c2043e17e455ce5c0d14e41242889e0012e05f4a2ad87a050f3d207f24880b626b5cac460f6d
SHA512 (libdnf-7ecb2f5.tar.gz) = cf062cb62747fcf428268518f62fa6041ea22cd529397a11fa706790c81638fd155dc8326e6fa70b48873a3d169a7b4dd0ebd10de1227f482553902824fc8573