b17a2ec
7e6e9f3
%global upstream_version 1.4
b17a2ec
d65035f
# Note that EPEL7 *does* have a Python 3 stack, but we are still missing
d65035f
# Python 3 bindings for RPM so we don't build any Python 3 support on EPEL7.
d65035f
%if 0%{?fedora} || 0%{?rhel} >= 8
d65035f
%bcond_without python3
d65035f
%else
d65035f
%bcond_with python3
d65035f
%endif
d65035f
b17a2ec
Name:           rpmdeplint
7e6e9f3
Version:        1.4
7e6e9f3
Release:        1%{?dist}
b17a2ec
Summary:        Tool to find errors in RPM packages in the context of their dependency graph
b17a2ec
License:        GPLv2+
1576eda
URL:            https://pagure.io/rpmdeplint
b17a2ec
Source0:        https://files.pythonhosted.org/packages/source/r/%{name}/%{name}-%{upstream_version}.tar.gz
b17a2ec
BuildArch:      noarch
d65035f
d65035f
# The base package is just the CLI, which pulls in the rpmdeplint
d65035f
# Python modules to do the real work.
d65035f
%if %{with python3}
1576eda
Requires:       python3-%{name} = %{version}-%{release}
d65035f
%else
1576eda
Requires:       python2-%{name} = %{version}-%{release}
d65035f
%endif
d65035f
d65035f
%description
d65035f
Rpmdeplint is a tool to find errors in RPM packages in the context of their 
d65035f
dependency graph.
d65035f
d65035f
%package -n python2-%{name}
d65035f
%{?python_provide:%python_provide python2-%{name}}
d65035f
Summary:        %{summary}
b17a2ec
BuildRequires:  python2-devel
7e6e9f3
%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8
7e6e9f3
BuildRequires:  python2-sphinx
7e6e9f3
BuildRequires:  python2-pytest
7e6e9f3
BuildRequires:  python2-six
7e6e9f3
BuildRequires:  python2-rpm
7e6e9f3
BuildRequires:  python2-hawkey
7e6e9f3
BuildRequires:  python2-librepo
7e6e9f3
Requires:       python2-six
7e6e9f3
Requires:       python2-rpm
7e6e9f3
Requires:       python2-hawkey
7e6e9f3
Requires:       python2-librepo
7e6e9f3
%else
b17a2ec
BuildRequires:  python-sphinx
b17a2ec
BuildRequires:  pytest
b17a2ec
BuildRequires:  python-six
b17a2ec
BuildRequires:  rpm-python
b17a2ec
BuildRequires:  python-hawkey
b17a2ec
BuildRequires:  python-librepo
b17a2ec
Requires:       python-six
b17a2ec
Requires:       rpm-python
b17a2ec
Requires:       python-hawkey
b17a2ec
Requires:       python-librepo
7e6e9f3
%endif
b17a2ec
d65035f
%description -n python2-%{name}
b17a2ec
Rpmdeplint is a tool to find errors in RPM packages in the context of their 
b17a2ec
dependency graph.
b17a2ec
d65035f
This package provides a Python 2 API for performing the checks.
d65035f
d65035f
%if %{with python3}
d65035f
%package -n python3-%{name}
d65035f
%{?python_provide:%python_provide python3-%{name}}
d65035f
Summary:        %{summary}
d65035f
BuildRequires:  python3-devel
d65035f
BuildRequires:  python3-sphinx
d65035f
BuildRequires:  python3-pytest
d65035f
BuildRequires:  python3-six
7e6e9f3
%if 0%{?fedora} >= 25 || 0%{?rhel} >= 8
7e6e9f3
BuildRequires:  python3-rpm
7e6e9f3
%else
d65035f
BuildRequires:  rpm-python3
7e6e9f3
%endif
d65035f
BuildRequires:  python3-hawkey
d65035f
BuildRequires:  python3-librepo
d65035f
Requires:       python3-six
7e6e9f3
%if 0%{?fedora} >= 25 || 0%{?rhel} >= 8
7e6e9f3
Requires:       python3-rpm
7e6e9f3
%else
d65035f
Requires:       rpm-python3
7e6e9f3
%endif
d65035f
Requires:       python3-hawkey
d65035f
Requires:       python3-librepo
d65035f
d65035f
%description -n python3-%{name}
d65035f
Rpmdeplint is a tool to find errors in RPM packages in the context of their 
d65035f
dependency graph.
d65035f
d65035f
This package provides a Python 3 API for performing the checks.
d65035f
%endif
d65035f
b17a2ec
%prep
b17a2ec
%setup -q -n %{name}-%{upstream_version}
d65035f
rm -rf rpmdeplint.egg-info
b17a2ec
b17a2ec
%build
b17a2ec
%py2_build
d65035f
%if %{with python3}
d65035f
%py3_build
d65035f
%endif
b17a2ec
b17a2ec
%install
b17a2ec
%py2_install
d65035f
%if %{with python3}
d65035f
%py3_install
d65035f
%endif
b17a2ec
b17a2ec
%check
d65035f
%if 0%{?rhel} == 7
d65035f
alias py.test-2="py.test-2.7"
d65035f
%endif
d65035f
py.test-2 rpmdeplint
d65035f
%if %{with python3}
d65035f
py.test-3 rpmdeplint
d65035f
%endif
b17a2ec
# Acceptance tests do not work in mock because they require .i686 packages.
b17a2ec
b17a2ec
%files
b17a2ec
%{_bindir}/%{name}
b17a2ec
%{_mandir}/man1/%{name}.1.*
d65035f
d65035f
%files -n python2-%{name}
d65035f
%license COPYING
d65035f
%doc README.rst
47c9a09
%{python2_sitelib}/%{name}/
b17a2ec
%{python2_sitelib}/%{name}*.egg-info
b17a2ec
d65035f
%if %{with python3}
d65035f
%files -n python3-%{name}
d65035f
%license COPYING
d65035f
%doc README.rst
47c9a09
%{python3_sitelib}/%{name}/
d65035f
%{python3_sitelib}/%{name}*.egg-info
d65035f
%endif
d65035f
b17a2ec
%changelog
7e6e9f3
* Mon Nov 20 2017 Dan Callaghan <dcallagh@redhat.com> - 1.4-1
7e6e9f3
- upstream bug fix release 1.4:
7e6e9f3
  https://rpmdeplint.readthedocs.io/en/latest/CHANGES.html
7e6e9f3
42bebbf
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-3
42bebbf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
42bebbf
1576eda
* Wed Jun 21 2017 Dan Callaghan <dcallagh@redhat.com> - 1.3-2
1576eda
- subpackage requirement should be versioned (RHBZ#1462047)
1576eda
6e03352
* Fri Apr 28 2017 Dan Callaghan <dcallagh@redhat.com> - 1.3-1
6e03352
- upstream bug fix release 1.3:
6e03352
  https://rpmdeplint.readthedocs.io/en/latest/CHANGES.html
6e03352
72911b8
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-4
72911b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
72911b8
734335b
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 1.2-3
734335b
- Rebuild for Python 3.6
734335b
d65035f
* Thu Oct 20 2016 Dan Callaghan <dcallagh@redhat.com> - 1.2-2
d65035f
- split Python module into its own package, ship both Python 2 and
d65035f
  Python 3 versions
d65035f
b17a2ec
* Mon Oct 17 2016 Dan Callaghan <dcallagh@redhat.com> - 1.2-1
b17a2ec
- initial version