%global pypi_name ghp-import2 Name: python-%{pypi_name} Version: 1.0.1 Release: 2%{?dist} Summary: A GitHub Pages import tool License: Tumbolia URL: https://github.com/ionelmc/python-ghp-import Source0: %{pypi_source} BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(setuptools) %description A GitHub Pages import tool. Warning: This will **DESTROY** your gh-pages branch. If you love it, you'll want to take backups before playing with this. This script assumes that gh-pages is 100% derivative. You should never edit files in your gh-pages branch by hand if you're using this script because you will lose your work. %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3dist(setuptools) %description -n python3-%{pypi_name} A GitHub Pages import tool. Warning: This will **DESTROY** your gh-pages branch. If you love it, you'll want to take backups before playing with this. This script assumes that gh-pages is 100% derivative. You should never edit files in your gh-pages branch by hand if you're using this script because you will lose your work. %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info # remove shebang line from the python scripts for lib in $(find -type f -name '*.py'); do sed -i.python -e '1{\@^#!@d}' $lib done %build %py3_build %install %py3_install %check %{__python3} setup.py test %files -n python3-%{pypi_name} %license LICENSE %doc README.rst %{_bindir}/ghp-import %{python3_sitelib}/ghp_import %{python3_sitelib}/ghp_import2-%{version}-py?.?.egg-info %changelog * Tue Jun 11 2019 José Matos - 1.0.1-2 - fix source url, license short hand, description and summary. - remove shebang lines from python scripts. * Sat Sep 1 2018 José Matos - 1.0.1-1 - initial package.