%global pypi_name bash8 Name: python-%{pypi_name} Version: 0.1.1 Release: 1%{?dist} Summary: A pep8 equivalent for bash scripts License: ASL 2.0 URL: http://www.openstack.org/ Source0: https://pypi.python.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-oslo-sphinx BuildRequires: python-babel BuildRequires: python-pbr BuildRequires: python-sphinx %description A pep8 equivalent for bash scripts %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info # drop shebang line in non-executable file pushd bash8 sed '1{\@^#!/usr/bin/env python@d}' bash8.py > bash8.new touch -r bash8.py bash8.new mv bash8.new bash8.py popd %build %{__python2} setup.py build # generate html docs sphinx-build doc/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install %{__python2} setup.py install --skip-build --root %{buildroot} %files %doc html README.rst %{!?_licensedir:%global license %%doc} %license LICENSE %{_bindir}/%{pypi_name} %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %changelog * Sat May 23 2015 Haïkel Guémar - 0.1.1-1 - Initial package.