%global libsolv_version 0.6.4-1
Name: hawkey
Version: 0.6.3
Release: 9%{?dist}
Summary: Library providing simplified C and Python API to libsolv
License: LGPLv2+
URL: https://github.com/rpm-software-management/%{name}
Source0: %{url}/archive/%{name}-%{version}.tar.gz
Patch0001: 0001-sack-don-t-raise-error-when-non-existing-arch-is-use.patch
Patch0002: 0002-Fixes-for-building-with-libsolv-0.6.21-117.patch
Patch0003: 0001-util-detect-armv7hnl-properly.patch
Patch0004: 0001-build-don-t-set-default-build-type-and-define-_GNU_S.patch
Patch0005: 0001-selector-prefer-obsoletes-Related-RhBug-1096506.patch
Patch0006: 0002-nevra-added-_has_just_name-helper-method.patch
BuildRequires: libsolv-devel >= %{libsolv_version}
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: expat-devel
BuildRequires: rpm-devel
BuildRequires: zlib-devel
BuildRequires: check-devel
%ifnarch riscv64 s390
BuildRequires: valgrind
%endif
Requires: libsolv%{?_isa} >= %{libsolv_version}
%description
A Library providing simplified C and Python API to libsolv.
%package devel
Summary: A Library providing simplified C and Python API to libsolv
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libsolv-devel
%description devel
Development files for hawkey.
%prep
%autosetup -p1
sed -i -e "/python/d" -e "/PYTHON/d" {src,tests}/CMakeLists.txt
sed -i -e "/ADD_SUBDIRECTORY (doc)/d" CMakeLists.txt
%build
mkdir %{_target_platform}
pushd %{_target_platform}
%cmake ..
%make_build
#make doc-man
popd
%install
pushd %{_target_platform}
%make_install
popd
%check
if [ "$(id -u)" == "0" ] ; then
cat <<ERROR 1>&2
Package tests cannot be run under superuser account.
Please build the package as non-root user.
ERROR
exit 1
fi
pushd %{_target_platform}
ctest -VV
popd
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%license COPYING
%doc README.rst
%{_libdir}/lib%{name}.so.*
%files devel
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/%{name}/
%changelog
* Tue Jan 17 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.6.3-9
- Prefer obsoletes (RHBZ #1096506)
* Thu Jan 05 2017 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.6.3-8
- Stop providing python subpackages
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 0.6.3-7
- Rebuild for Python 3.6
* Thu Sep 01 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.6.3-6
- Build release version
* Thu Aug 25 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.6.3-5
- Fix armv7hnl detection (RHBZ #1368238)
* Tue Aug 09 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.6.3-4
- Add %%{?system_python_abi}
- Trim changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.3-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Fri Apr 29 2016 Igor Gnatenko <ignatenko@redhat.com> 0.6.3-2
- spec: Fix packaging to comply packaging guidelines (Igor Gnatenko)