Blob Blame History Raw
%global pypi_name argh
%global global_sum Unobtrusive argparse wrapper with natural syntax
%global global_desc							\
Building a command-line interface?  Found yourself uttering “argh!”	\
while struggling with the API of argparse?  Don’t want to lose its	\
power but don’t need the complexity?					\
									\
%{name} provides a wrapper for argparse.  Argparse is a very powerful	\
tool;  %{name} just makes it easy to use.


Name:		python-%{pypi_name}
Version:	0.26.1
Release:	6%{?dist}
Summary:	%{global_sum}

License:	LGPLv3+
URL:		https://pypi.python.org/pypi/%{pypi_name}
Source0:	https://files.pythonhosted.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Source1:	https://www.gnu.org/licenses/lgpl-3.0.txt
Source2:	https://www.gnu.org/licenses/gpl-3.0.txt

# not upstreamed, fixes an assert in testsuite.
Patch0001:	python-argh-0.26.1-fix-testsuite.patch

BuildArch:	noarch

%description
%{global_desc}


%package -n python2-%{pypi_name}
Summary:	%{global_sum}

BuildRequires:	python2-devel
BuildRequires:	python-mock
%if %{with python3}
BuildRequires:	python-pytest
%else  # with python3
BuildRequires:	pytest
%endif # with python3
BuildRequires:	python-setuptools
%if 0%{?rhel} && 0%{?rhel} <= 6
BuildRequires:	python-argparse
Requires:	python-argparse
%endif

%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
%{global_desc}


%package -n python%{python3_pkgversion}-%{pypi_name}
Summary:	%{global_sum}

BuildRequires:	python%{python3_pkgversion}-devel
BuildRequires:	python%{python3_pkgversion}-mock
BuildRequires:	python%{python3_pkgversion}-pytest
BuildRequires:	python%{python3_pkgversion}-setuptools

%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}

%description -n python%{python3_pkgversion}-%{pypi_name}
%{global_desc}


%prep
%autosetup -n %{pypi_name}-%{version} -p 1

%{__install} -pm 0644 %{SOURCE1} COPYING
%{__install} -pm 0644 %{SOURCE2} .


%build
%py2_build
%py3_build


%install
%py3_install
%py2_install


%check
# tests need UTF-8 encoding
LANG="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
export LANG LC_CTYPE
%{__python2} setup.py test
%{__python3} setup.py test


%files -n python2-%{pypi_name}
%doc README.rst
%license COPYING gpl-3.0.txt
%{python2_sitelib}/%{pypi_name}*/


%files -n python%{python3_pkgversion}-%{pypi_name}
%doc README.rst
%license COPYING gpl-3.0.txt
%{python3_sitelib}/%{pypi_name}*/


%changelog
* Tue Oct 01 2019 Miro Hrončok <mhroncok@redhat.com> - 0.26.1-6
- Add Python 3 package (#1728642)

* Tue Jun 20 2017 Björn Esser <besser82@fedoraproject.org> - 0.26.1-5
- Adapt spec-file to recent guidelines

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Dec 20 2016 Miro Hrončok <mhroncok@redhat.com> - 0.26.1-3
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon Feb 08 2016 Björn Esser <fedora@besser82.io> - 0.26.1-1
- new upstream-release (#1301580)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Nov 06 2015 Robert Kuska <rkuska@redhat.com> - 0.23.2-5
- Rebuilt for Python3.5 rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.23.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.23.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 0.23.2-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Mon Aug 12 2013 Björn Esser <bjoern.esser@gmail.com> - 0.23.2-1
- Initial rpm release (#996186)