Adapt for libhif->libdnf git repo rename

This commit is contained in:
Kalev Lember 2016-12-19 11:47:28 +01:00
parent 9232d6f3f8
commit 7d44b64558
3 changed files with 24 additions and 20 deletions

1
.gitignore vendored
View File

@ -64,3 +64,4 @@ PackageKit-0.6.7.tar.bz2
/libdnf-9cf4fb3.tar.gz
/PackageKit-1.1.4.tar.xz
/libdnf-ccd2e28.tar.gz
/libdnf-378d315.tar.gz

View File

@ -1,29 +1,29 @@
%global _changelog_trimtime %(date +%s -d "1 year ago")
%global gitdate 20160901
%global bundled_libhif 1
%global bundled_libdnf 1
%global glib2_version 2.46.0
%global libdnf_version 0.7.0
%if 0%{?bundled_libhif}
%global commit1 ccd2e28c0a9557808b9b9cd3011642218149390b
%if 0%{?bundled_libdnf}
%global commit1 378d3157f4a753b7c001e64248a0c47cf096ba39
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
%endif
Summary: Package management service
Name: PackageKit
Version: 1.1.4
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+ and LGPLv2+
URL: http://www.freedesktop.org/software/PackageKit/
Source0: http://www.freedesktop.org/software/PackageKit/releases/%{name}-%{version}.tar.xz
%if 0%{?bundled_libhif}
# https://github.com/rpm-software-management/libhif
%if 0%{?bundled_libdnf}
# https://github.com/rpm-software-management/libdnf
# Bundled because the library is API/ABI unstable, and we're trying to
# avoid being version locked with rpm-ostree/dnf right now.
Source1: https://github.com/rpm-software-management/libhif/archive/%{commit1}/libdnf-%{shortcommit1}.tar.gz
Source1: https://github.com/rpm-software-management/libdnf/archive/%{commit1}/libdnf-%{shortcommit1}.tar.gz
Provides: bundled(libdnf) = 0.7.0
%endif
@ -48,7 +48,7 @@ BuildRequires: gstreamer1-plugins-base-devel
BuildRequires: pango-devel
BuildRequires: fontconfig-devel
BuildRequires: libappstream-glib-devel
%if 0%{?bundled_libhif}
%if 0%{?bundled_libdnf}
BuildRequires: check-devel
BuildRequires: cmake
BuildRequires: librepo-devel
@ -66,7 +66,7 @@ BuildRequires: gobject-introspection-devel
BuildRequires: bash-completion
%endif
%if 0%{?bundled_libhif}
%if 0%{?bundled_libdnf}
# Filter private libraries
%global __provides_exclude ^libdnf[.]so[.].*$
%global __requires_exclude ^libdnf[.]so[.].*$
@ -74,7 +74,7 @@ BuildRequires: bash-completion
Requires: %{name}-glib%{?_isa} = %{version}-%{release}
Requires: glib2%{?_isa} >= %{glib2_version}
%if ! 0%{?bundled_libhif}
%if ! 0%{?bundled_libdnf}
Requires: libdnf%{?_isa} >= %{libdnf_version}
%endif
Requires: shared-mime-info
@ -183,7 +183,7 @@ using PackageKit.
%prep
%setup -q
%if 0%{?bundled_libhif}
%if 0%{?bundled_libdnf}
# Extract libdnf archive
tar -xf %{S:1}
%endif
@ -191,17 +191,17 @@ tar -xf %{S:1}
%patch0 -p1 -b .fedora
%build
%if 0%{?bundled_libhif}
mkdir -p libhif-%{commit1}/build
pushd libhif-%{commit1}/build
%if 0%{?bundled_libdnf}
mkdir -p libdnf-%{commit1}/build
pushd libdnf-%{commit1}/build
%cmake \
-DCMAKE_BUILD_TYPE=Release \
..
%make_build
popd
export DNF_CFLAGS="-I`pwd`/libhif-%{commit1} `pkg-config --cflags appstream-glib`"
export DNF_LIBS="-L`pwd`/libhif-%{commit1}/build/libdnf -ldnf -Wl,-rpath=%{_libdir}/PackageKit `pkg-config --libs appstream-glib`"
export DNF_CFLAGS="-I`pwd`/libdnf-%{commit1} `pkg-config --cflags appstream-glib`"
export DNF_LIBS="-L`pwd`/libdnf-%{commit1}/build/libdnf -ldnf -Wl,-rpath=%{_libdir}/PackageKit `pkg-config --libs appstream-glib`"
%endif
%configure \
--disable-static \
@ -220,9 +220,9 @@ make %{?_smp_mflags} V=1
%install
make install DESTDIR=$RPM_BUILD_ROOT
%if 0%{?bundled_libhif}
%if 0%{?bundled_libdnf}
# Install libdnf to a temporary prefix
make install DESTDIR=`pwd`/libdnf-install -C libhif-%{commit1}/build
make install DESTDIR=`pwd`/libdnf-install -C libdnf-%{commit1}/build
# Cherry pick the shared library
mkdir -p $RPM_BUILD_ROOT%{_libdir}/PackageKit
cp -a libdnf-install%{_libdir}/libdnf*.so.* $RPM_BUILD_ROOT%{_libdir}/PackageKit
@ -292,7 +292,7 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
%exclude %{_libdir}/libpackagekit*.so.*
%{_libdir}/packagekit-backend/libpk_backend_dummy.so
%{_libdir}/packagekit-backend/libpk_backend_test_*.so
%if 0%{?bundled_libhif}
%if 0%{?bundled_libdnf}
%{_libdir}/PackageKit/
%endif
%ghost %verify(not md5 size mtime) %{_localstatedir}/lib/PackageKit/transactions.db
@ -339,6 +339,9 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
%{_datadir}/vala/vapi/packagekit-glib2.vapi
%changelog
* Mon Dec 19 2016 Kalev Lember <klember@redhat.com> - 1.1.4-3
- Adapt for libhif->libdnf git repo rename
* Fri Dec 16 2016 Kalev Lember <klember@redhat.com> - 1.1.4-2
- Update to latest libdnf git snapshot (#1383819)

View File

@ -1,2 +1,2 @@
SHA512 (PackageKit-1.1.4.tar.xz) = fc04d58c46f7e7dbb1386d26627ea246b5f21b8483862788bb734b8a137e4cb1d41de0f471b46f6d649e29337f9605acba0568a845577b27a2ac0faaf391b187
SHA512 (libdnf-ccd2e28.tar.gz) = 1a0bbc3a20297c30b1fce0adb4cedab91ff13e070272b4129545ae9667e0eceaf925020ec563777959d6cd3b51cb68bf6b2ab1851a0c4e3355cc5209c9a048dc
SHA512 (libdnf-378d315.tar.gz) = 9d7b263e3ce1d300bf225dbd15d88a532440c216870767d1ded54f508b0c242a351b65531f2d8a31eec4cd24a2b5ec81378ac1ee963ef73bbe442e71e3a5b04a