%global pypi_name bashate %if 0%{?fedora} %global with_python3 1 %endif Name: python-%{pypi_name} Version: 0.3.1 Release: 2%{?dist} Summary: A pep8 equivalent for bash scripts License: ASL 2.0 URL: https://pypi.python.org/pypi/bashate Source0: https://pypi.python.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description It is a pep8 equivalent for bash scripts. This program attempts to be an automated style checker for bash scripts to fill the same part of code review that pep8 does in most OpenStack projects. It started from humble beginnings in the DevStack project, and will continue to evolve over time. %package -n python2-%{pypi_name} Summary: A pep8 equivalent for bash scripts %{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python-pbr Requires: python-setuptools Requires: python-pbr Requires: python-babel %description -n python2-%{pypi_name} It is a pep8 equivalent for bash scripts. This program attempts to be an automated style checker for bash scripts to fill the same part of code review that pep8 does in most OpenStack projects. It started from humble beginnings in the DevStack project, and will continue to evolve over time. %if 0%{with_python3} %package -n python3-%{pypi_name} Summary: A pep8 equivalent for bash scripts %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-pbr Requires: python3-setuptools Requires: python3-pbr Requires: python3-babel %description -n python3-%{pypi_name} It is a pep8 equivalent for bash scripts. This program attempts to be an automated style checker for bash scripts to fill the same part of code review that pep8 does in most OpenStack projects. It started from humble beginnings in the DevStack project, and will continue to evolve over time. %endif %package -n python-%{pypi_name}-doc Summary: Documentation for bashate module BuildRequires: python-sphinx BuildRequires: python-oslo-sphinx Requires: python2-%{pypi_name} %description -n python-%{pypi_name}-doc Documentation for the bashate module %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info rm -rf {test-,}requirements.txt %build %py2_build # doc export PYTHONPATH="$( pwd ):$PYTHONPATH" pushd doc sphinx-build -b html -d build/doctrees source build/html popd rm -fr doc/build/html/.buildinfo %if 0%{with_python3} %py3_build %endif %install %py2_install chmod +x %{buildroot}/%{python2_sitelib}/%{pypi_name}/%{pypi_name}.py %if 0%{with_python3} %py3_install chmod +x %{buildroot}/%{python3_sitelib}/%{pypi_name}/%{pypi_name}.py %endif %check %{__python2} setup.py test %if 0%{with_python3} %{__python3} setup.py test %endif %files -n python2-%{pypi_name} %doc README.rst %license LICENSE %{_bindir}/%{pypi_name} %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{with_python3} %files -n python3-%{pypi_name} %doc README.rst %license LICENSE %{_bindir}/%{pypi_name} %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif %files -n python-%{pypi_name}-doc %doc doc/build/html %license LICENSE %changelog * Wed Sep 30 2015 Chandan Kumar -0.3.1-2 - Added python2 and python3 subpackage * Wed Aug 12 2015 chandankumar - 0.3.1-1 - Initial package.