%global srcname pyparsing Name: python3-%{srcname} Version: 2.3.1 Release: 1%{?dist} Summary: Python package with an object-oriented approach to text processing License: MIT URL: https://github.com/%{srcname}/%{srcname} Source0: https://github.com/%{srcname}/%{srcname}/archive/%{srcname}_%{version}/%{srcname}-%{srcname}_%{version}.tar.gz BuildArch: noarch BuildRequires: dos2unix %description pyparsing is a module that can be used to easily and directly configure syntax definitions for any number of text parsing applications. %package doc Summary: Documentation for %{srcname} python package BuildRequires: python%{python3_pkgversion}-sphinx %description doc The package contains documentation for %{srcname}. %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} pyparsing is a module that can be used to easily and directly configure syntax definitions for any number of text parsing applications. %prep %autosetup -p1 -n %{srcname}-%{srcname}_%{version} find examples -name '*.dfm' \ -or -name '*.py' \ -or -name '*.g' \ -or -name '*.h' \ -or -name '*.ics' \ -or -name '*.ini' \ | xargs dos2unix -k CHANGES LICENSE docs/HowToUsePyparsing.rst find examples -name '*.py' \ | xargs sed -i '1{s|^#!/usr/bin\(/env \)\?python$|#!%{__python3}|}' # Theme is not available sed -i '/alabaster/d' docs/conf.py %build %py3_build sphinx-build-%{python3_version} -b html docs docs/html rm -rf docs/html/.{buildinfo,doctrees} %install %py3_install %check %{__python3} unitTests.py %{__python3} simple_unit_tests.py %files doc %license LICENSE %doc CHANGES README.rst docs/html examples %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE %doc CHANGES README.rst %{python3_sitelib}/%{srcname}.py %{python3_sitelib}/__pycache__/%{srcname}.*.pyc %{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ %changelog * Thu Apr 04 2019 Scott K Logan - 2.3.1-1 - Initial package