libkdumpfile/libkdumpfile.spec

138 lines
3.5 KiB
RPMSpec
Raw Normal View History

# some tests are failing, toggle this to try building without the
# patches disabling them
%bcond_with all_tests
%global mainlibsover 9
%global addrlibsover 2
2021-04-05 02:23:40 +00:00
Name: libkdumpfile
Version: 0.4.1
Release: %autorelease
2021-04-05 02:23:40 +00:00
Summary: Kernel coredump file access
License: LGPLv3+ or GPLv2+
URL: https://github.com/ptesarik/libkdumpfile
Source: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz
# disable the union of failing tests. Reported upstream:
# https://github.com/ptesarik/libkdumpfile/issues/40
Source1: %{name}-disable-failing-tests.patch
# this only applies to %%{ix86}
Source2: %{name}-disable-erroring-tests.patch
Patch1: %{name}-0.4.1-fix-for-gcc12.patch
Patch2: %{name}-disable-python-test_addrxlat.patch
2021-04-05 02:23:40 +00:00
BuildRequires: gcc-c++
BuildRequires: doxygen
BuildRequires: make
BuildRequires: sed
BuildRequires: lzo-devel
BuildRequires: python3-devel
BuildRequires: snappy-devel
BuildRequires: zlib-devel
%global _description %{expand:
libkdumpfile is a library to read kdump-compressed kernel core dumps.}
%description %{_description}
2021-04-05 02:23:40 +00:00
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel %{_description}
2021-04-05 02:23:40 +00:00
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package doc
Summary: Documentation for %{name}
%description doc %{_description}
2021-04-05 02:23:40 +00:00
The %{name}-doc package contains documentation for %{name}.
%package -n python3-%{name}
2021-04-05 02:23:40 +00:00
Summary: Python bindings for %{name}
Obsoletes: %{name}-python < 0.4.0-6
Provides: %{name}-python = %{version}-%{release}
Provides: %{name}-python%{?_isa} = %{version}-%{release}
2021-04-05 02:23:40 +00:00
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python3-%{name} %{_description}
The python3-%{name} package contains Python bindings for %{name}.
2021-04-05 02:23:40 +00:00
%package util
Summary: Utilities to read kernel core dumps
Requires: %{name}%{?_isa} = %{version}-%{release}
%description util %{_description}
2021-04-05 02:23:40 +00:00
The %{name}-devel package contains misc utilities built with %{name}.
2021-04-05 02:23:40 +00:00
%prep
%autosetup -p1
%if %{without all_tests}
%ifnarch x86_64
# patch disabling union of tests failing on other arches
cat %{SOURCE1} | patch -p1
%endif
%ifarch %{ix86}
# this test errors out only on 32-bit x86
cat %{SOURCE2} | patch -p1
%endif
%endif
2021-04-05 02:23:40 +00:00
# Remove unneeded shebang
sed -e "\|#!/usr/bin/env python|d" -i python/*/*.py
2021-04-05 02:23:40 +00:00
%build
%configure
2021-04-05 02:23:40 +00:00
%make_build
%{__make} doxygen-doc
%install
%make_install
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
# static artifacts are needed to run tests, but we don't
# want to ship them
find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';'
%check
%make_build check
2021-04-05 02:23:40 +00:00
2021-04-05 02:23:40 +00:00
%files
%license COPYING COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv3
%doc README.md NEWS
%{_libdir}/libaddrxlat.so.%{addrlibsover}{,.*}
%{_libdir}/libkdumpfile.so.%{mainlibsover}{,.*}
2021-04-05 02:23:40 +00:00
%files devel
%{_includedir}/%{name}/
%{_libdir}/libaddrxlat.so
%{_libdir}/libkdumpfile.so
2021-04-05 02:23:40 +00:00
%{_libdir}/pkgconfig/libaddrxlat.pc
%{_libdir}/pkgconfig/libkdumpfile.pc
%files doc
%license COPYING COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv3
%doc doc/html
%files -n python3-%{name}
%{python3_sitearch}/%{name}-%{version}-*.egg-info
%{python3_sitearch}/addrxlat/
%{python3_sitearch}/_addrxlat.*.so
%{python3_sitearch}/kdumpfile/
%{python3_sitearch}/_kdumpfile.*.so
2021-04-05 02:23:40 +00:00
%files util
%{_bindir}/dumpattr
%{_bindir}/listxendoms
%{_bindir}/showxlat
2021-04-05 02:23:40 +00:00
%changelog
%autochangelog