Blame python-dcrpm.spec

64eb008
%bcond_without tests
64eb008
64eb008
# Created by pyp2rpm-3.3.5
64eb008
%global pypi_name dcrpm
64eb008
64eb008
Name:           python-%{pypi_name}
64eb008
Version:        0.6.2
b9319bf
Release:        4%{?dist}
64eb008
Summary:        A tool to detect and correct common issues around RPM database corruption
64eb008
64eb008
License:        GPLv2
64eb008
URL:            https://github.com/facebookincubator/dcrpm
64eb008
Source0:        %{pypi_source}
64eb008
# tests: fix Popen mock
64eb008
Patch0:         %{url}/commit/efc0166793db58e08b57ba3839638f7571355b93.patch
64eb008
# tests: properly mock bdb in db_stat test
64eb008
Patch1:         %{url}/commit/f7f89146e37c009a164e0e81de9b6b23d4874ffc.patch
64eb008
# tests: properly mock yum process name
b72e111
Patch2:         %{url}/commit/efcc4337821b3e498d832d2b6bf4241716acc0b3.patch
64eb008
BuildArch:      noarch
64eb008
64eb008
BuildRequires:  python3-devel
64eb008
BuildRequires:  python3dist(psutil)
64eb008
BuildRequires:  python3dist(setuptools)
64eb008
%if 0%{?el8}
64eb008
# pypandoc is an optional dependency and is not available in EPEL 8
64eb008
%else
64eb008
BuildRequires:  python3dist(pypandoc)
64eb008
%endif
64eb008
%if %{with tests}
64eb008
BuildRequires:  python3dist(mock)
64eb008
BuildRequires:  python3dist(testslide)
64eb008
BuildRequires:  dnf
64eb008
BuildRequires:  libdb-utils
64eb008
%endif
64eb008
64eb008
%description
64eb008
dcrpm is a tool to detect and correct common issues around RPM database
64eb008
corruption.
64eb008
64eb008
%package -n     %{pypi_name}
64eb008
Summary:        %{summary}
b72e111
%if 0%{?fedora} < 33 || 0%{?rhel} < 9
b72e111
%py_provides    python3-%{pypi_name}
b72e111
%endif
64eb008
64eb008
Requires:       python3dist(psutil)
64eb008
Requires:       python3dist(setuptools)
64eb008
Requires:       lsof
64eb008
Recommends:     libdb-utils
64eb008
%description -n %{pypi_name}
b72e111
dcrpm is a tool to detect and correct common issues around RPM database
64eb008
corruption.
64eb008
64eb008
%prep
64eb008
%autosetup -n %{pypi_name}-%{version} -p1
64eb008
# Remove unnecessary shebang
64eb008
sed -e '\|#!/usr/bin/env python|d' -i dcrpm/*.py
64eb008
# Remove bundled egg-info
64eb008
rm -rf %{pypi_name}.egg-info
64eb008
64eb008
%build
64eb008
%py3_build
64eb008
64eb008
%install
64eb008
%py3_install
64eb008
64eb008
%if %{with tests}
64eb008
%check
64eb008
%{__python3} setup.py test
64eb008
%endif
64eb008
64eb008
%files -n %{pypi_name}
64eb008
%license LICENSE
64eb008
%doc README.md CONTRIBUTING.md CODE_OF_CONDUCT.md
64eb008
%doc HISTORY.md MANUAL_RPM_CLEANUP.md
64eb008
%{_bindir}/dcrpm
64eb008
%{python3_sitelib}/%{pypi_name}
64eb008
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
64eb008
64eb008
%changelog
b9319bf
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.2-4
b9319bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
b9319bf
1e467c6
* Sat Jan 23 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.6.2-3
1e467c6
- Enable tests for EPEL builds
1e467c6
b72e111
* Sun Jan  3 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.6.2-2
b72e111
- Update patches
b72e111
64eb008
* Wed Dec 30 2020 Davide Cavalca <dcavalca@fedoraproject.org> - 0.6.2-1
64eb008
- Initial package.