%global distname fedrepo_req
Name: fedrepo-req
Version: 1.0.0
Release: 2%{?dist}
Summary: CLI for Fedora package repo requests
License: GPLv2+
URL: https://pagure.io/fedrepo_req
Source0: https://pypi.io/packages/source/f/%{distname}/%{distname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-bugzilla
BuildRequires: python-fedora
BuildRequires: PyYAML
BuildRequires: python-six
BuildRequires: help2man
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: python2-setuptools
BuildRequires: python2-requests
%if 0%{?fedora} < 25
BuildRequires: python-click
%else
BuildRequires: python2-click
%endif
%else
BuildRequires: python-setuptools
BuildRequires: python-click
BuildRequires: python-requests
%endif
# For tests
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: python2-mock
BuildRequires: python2-pytest
%else
BuildRequires: python-mock
%if 0%{?rhel}
BuildRequires: pytest
%else
BuildRequires: python-pytest
%endif
%endif
Requires: python2-fedrepo-req = %{version}-%{release}
# Some people are confused that the repo is called fedrepo_req while the rpm is
# called fedrepo-req. This line should allow people to search for and install
# 'fedrepo_req' by name.
Provides: fedrepo_req
%description
CLI for Fedora package request
%package -n python2-fedrepo-req
Summary: Common dependencies for fedrepo-req and fedrepo-req-admin
%{?python_provide:%python_provide python2-fedrepo-req}
Requires: git
Requires: python-bugzilla
Requires: python-fedora
Requires: PyYAML
Requires: python-six
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: python2-requests
%if 0%{?fedora} < 25
Requires: python-click
%else
Requires: python2-click
%endif
%else
Requires: python-click
Requires: python-requests
%endif
%description -n python2-fedrepo-req
Common dependencies for fedrepo-req and fedrepo-req-admin
%package -n fedrepo-req-admin
Summary: CLI tool for processing Fedora packaging repo requests
Requires: python2-fedrepo-req = %{version}-%{release}
%description -n fedrepo-req-admin
CLI tool for processing Fedora packaging repo requests
%prep
%setup -q -n %{distname}-%{version}
%build
%py2_build
export PYTHONPATH=%{buildroot}/%{python2_sitelib}
mkdir -p %{buildroot}/%{_mandir}/man1
help2man -N --version-string=%{version} %{buildroot}/%{_bindir}/fedrepo-req > %{buildroot}/%{_mandir}/man1/fedrepo-req.1
help2man -N --version-string=%{version} %{buildroot}/%{_bindir}/fedrepo-req-branch > %{buildroot}/%{_mandir}/man1/fedrepo-req-branch.1
help2man -N --version-string=%{version} %{buildroot}/%{_bindir}/fedrepo-req-admin > %{buildroot}/%{_mandir}/man1/fedrepo-req-admin.1
%%check
export PYTHONPATH=%{buildroot}/%{python2_sitelib}
export FEDREPO_REQ_TEST_CONFIG=true
py.test tests/
unset FEDREPO_REQ_TEST_CONFIG
%install
%py2_install
%files
%doc README.md
%license LICENSE
%{python2_sitelib}/%{distname}/fedrepo_req.py*
%{python2_sitelib}/%{distname}/fedrepo_req_branch.py*
%{_bindir}/fedrepo-req
%{_bindir}/fedrepo-req-branch
%{_mandir}/man1/fedrepo-req.1*
%{_mandir}/man1/fedrepo-req-branch.1*
%files -n python2-fedrepo-req
%doc README.md
%license LICENSE
%dir %{_sysconfdir}/fedrepo_req/
%config(noreplace) %{_sysconfdir}/fedrepo_req/config.ini
%dir %{python2_sitelib}/%{distname}/
%{python2_sitelib}/%{distname}/__init__.py*
%{python2_sitelib}/%{distname}/bugzilla.py*
%{python2_sitelib}/%{distname}/config.py*
%{python2_sitelib}/%{distname}/exceptions.py*
%{python2_sitelib}/%{distname}/fas.py*
%{python2_sitelib}/%{distname}/git.py*
%{python2_sitelib}/%{distname}/pagure.py*
%{python2_sitelib}/%{distname}/pdc.py*
%{python2_sitelib}/%{distname}/request_utils.py*
%{python2_sitelib}/%{distname}/utils.py*
%{python2_sitelib}/%{distname}*.egg-info
%files -n fedrepo-req-admin
%doc README.md
%license LICENSE
%{python2_sitelib}/%{distname}/fedrepo_req_admin.py*
%{_bindir}/fedrepo-req-admin
%{_mandir}/man1/fedrepo-req-admin.1*
%changelog
* Mon Aug 14 2017 Matt Prahl <mprahl@redhat.com> - 1.0.0-2
- Add man pages
* Thu Aug 10 2017 Matt Prahl <mprahl@redhat.com> - 1.0.0-1
- Bump to version 1.0.0
* Wed Aug 09 2017 Matt Prahl <mprahl@redhat.com> - 0.8.0-1
- Bump to version 0.8.0
* Wed Aug 09 2017 Ralph Bean <rbean@redhat.com> - 0.6.0-2
- Add provides on fedrepo_req, for convenience and ease!
* Tue Aug 08 2017 Matt Prahl <mprahl@redhat.com> - 0.6.0-1
- Bump to version 0.6.0
* Fri Jul 07 2017 Matt Prahl <mprahl@redhat.com> - 0.1.6-1
- Initial packaging