Blame SPECS/python-argh.spec

ee930d
%if 0%{?fedora} || 0%{?rhel} >= 8
ee930d
%bcond_without python3
ee930d
%else  # 0#{?fedora} || 0#{?rhel} >= 8
ee930d
%bcond_with python3
ee930d
%endif # 0#{?fedora} || 0#{?rhel} >= 8
ee930d
ee930d
%if 0%{?rhel} > 7
ee930d
# Disable python2 build by default
ee930d
%bcond_with python2
ee930d
%else
ee930d
%bcond_without python2
ee930d
%endif
ee930d
ee930d
%global pypi_name argh
ee930d
%global global_sum Unobtrusive argparse wrapper with natural syntax
ee930d
%global global_desc							\
ee930d
Building a command-line interface?  Found yourself uttering “argh!”	\
ee930d
while struggling with the API of argparse?  Don’t want to lose its	\
ee930d
power but don’t need the complexity?					\
ee930d
									\
ee930d
%{name} provides a wrapper for argparse.  Argparse is a very powerful	\
ee930d
tool;  %{name} just makes it easy to use.
ee930d
ee930d
ee930d
Name:		python-%{pypi_name}
ee930d
Version:	0.26.1
ee930d
Release:	8%{?dist}
ee930d
Summary:	%{global_sum}
ee930d
ee930d
License:	LGPLv3+
ee930d
URL:		https://pypi.python.org/pypi/%{pypi_name}
ee930d
Source0:	https://files.pythonhosted.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
ee930d
Source1:	https://www.gnu.org/licenses/lgpl-3.0.txt
ee930d
Source2:	https://www.gnu.org/licenses/gpl-3.0.txt
ee930d
ee930d
# not upstreamed, fixes an assert in testsuite.
ee930d
Patch0001:	python-argh-0.26.1-fix-testsuite.patch
ee930d
ee930d
BuildArch:	noarch
ee930d
ee930d
%description
ee930d
%{global_desc}
ee930d
ee930d
%if %{with python2}
ee930d
%package -n python2-%{pypi_name}
ee930d
Summary:	%{global_sum}
ee930d
ee930d
BuildRequires:	python2-devel
ee930d
BuildRequires:	python2-mock
ee930d
%if %{with python3}
ee930d
BuildRequires:	python2-pytest
ee930d
%else  # with python3
ee930d
BuildRequires:	pytest
ee930d
%endif # with python3
ee930d
BuildRequires:	python2-setuptools
ee930d
%if 0%{?rhel} && 0%{?rhel} <= 6
ee930d
BuildRequires:	python-argparse
ee930d
Requires:	python-argparse
ee930d
%endif
ee930d
ee930d
%{?python_provide:%python_provide python2-%{pypi_name}}
ee930d
ee930d
%description -n python2-%{pypi_name}
ee930d
%{global_desc}
ee930d
%endif # with python2
ee930d
ee930d
ee930d
%if %{with python3}
ee930d
%package -n python3-%{pypi_name}
ee930d
Summary:	%{global_sum}
ee930d
ee930d
BuildRequires:	python3-devel
ee930d
BuildRequires:	python3-mock
ee930d
BuildRequires:	python3-pytest
ee930d
BuildRequires:	python3-setuptools
ee930d
ee930d
%{?python_provide:%python_provide python3-%{pypi_name}}
ee930d
ee930d
%description -n python3-%{pypi_name}
ee930d
%{global_desc}
ee930d
%endif # with python3
ee930d
ee930d
ee930d
%prep
ee930d
%autosetup -n %{pypi_name}-%{version} -p 1
ee930d
ee930d
%{__install} -pm 0644 %{SOURCE1} COPYING
ee930d
%{__install} -pm 0644 %{SOURCE2} .
ee930d
ee930d
ee930d
%build
ee930d
%if %{with python2}
ee930d
%py2_build
ee930d
%endif # with python2
ee930d
%if %{with python3}
ee930d
%py3_build
ee930d
%endif # with python3
ee930d
ee930d
ee930d
%install
ee930d
%if %{with python3}
ee930d
%py3_install
ee930d
%endif # with python3
ee930d
%if %{with python2}
ee930d
%py2_install
ee930d
%endif # with python2
ee930d
ee930d
ee930d
%check
ee930d
# tests need UTF-8 encoding
ee930d
LANG="en_US.UTF-8"
ee930d
LC_CTYPE="en_US.UTF-8"
ee930d
export LANG LC_CTYPE
ee930d
%if %{with python2}
ee930d
%{__python2} setup.py test
ee930d
%endif # with python2
ee930d
%if %{with python3}
ee930d
%{__python3} setup.py test
ee930d
%endif # with python3
ee930d
ee930d
%if %{with python2}
ee930d
%files -n python2-%{pypi_name}
ee930d
%doc README.rst
ee930d
%license COPYING gpl-3.0.txt
ee930d
%{python2_sitelib}/*
ee930d
%endif # with python2
ee930d
ee930d
ee930d
%if %{with python3}
ee930d
%files -n python3-%{pypi_name}
ee930d
%doc README.rst
ee930d
%license COPYING gpl-3.0.txt
ee930d
%{python3_sitelib}/*
ee930d
%endif # with python3
ee930d
ee930d
ee930d
%changelog
ee930d
* Fri Jun 08 2018 Charalampos Stratakis <cstratak@redhat.com> - 0.26.1-8
ee930d
- Conditionalize the python2 subpackage
ee930d
ee930d
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.1-7
ee930d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ee930d
ee930d
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.1-6
ee930d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
ee930d
ee930d
* Tue Jun 20 2017 Björn Esser <besser82@fedoraproject.org> - 0.26.1-5
ee930d
- Adapt spec-file to recent guidelines
ee930d
ee930d
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.1-4
ee930d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ee930d
ee930d
* Tue Dec 20 2016 Miro Hrončok <mhroncok@redhat.com> - 0.26.1-3
ee930d
- Rebuild for Python 3.6
ee930d
ee930d
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
ee930d
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
ee930d
ee930d
* Mon Feb 08 2016 Björn Esser <fedora@besser82.io> - 0.26.1-1
ee930d
- new upstream-release (#1301580)
ee930d
ee930d
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.2-6
ee930d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
ee930d
ee930d
* Fri Nov 06 2015 Robert Kuska <rkuska@redhat.com> - 0.23.2-5
ee930d
- Rebuilt for Python3.5 rebuild
ee930d
ee930d
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.23.2-4
ee930d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ee930d
ee930d
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.23.2-3
ee930d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
ee930d
ee930d
* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 0.23.2-2
ee930d
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
ee930d
ee930d
* Mon Aug 12 2013 Björn Esser <bjoern.esser@gmail.com> - 0.23.2-1
ee930d
- Initial rpm release (#996186)