1a22e14
# what it's called on pypi
1a22e14
%global srcname Automat
1a22e14
# what it's imported as
1a22e14
%global libname automat
1a22e14
# name of egg info directory
1a22e14
%global eggname %{srcname}
1a22e14
# package name fragment
1a22e14
%global pkgname %{srcname}
2bd5ba5
2bd5ba5
%global common_description %{expand:
Jeroen van Meeuwen (Kolab Systems) f0e32c4
Automat is a library for concise, idiomatic Python expression of finite-state
2bd5ba5
automata (particularly deterministic finite-state transducers).}
2bd5ba5
a57ce6c
%bcond_without  tests
a57ce6c
%bcond_without  python2
Jeroen van Meeuwen (Kolab Systems) f0e32c4
1a22e14
Name:           python-%{pkgname}
837bccf
Version:        0.7.0
81a7356
Release:        4%{?dist}
2bd5ba5
Summary:        Self-service finite-state machines for the programmer on the go
2bd5ba5
2bd5ba5
License:        MIT
d2d419d
URL:            https://github.com/glyph/automat
940d3de
Source0:        %pypi_source
1104da8
# PEP 570 adds "positional only" arguments to Python, which changes the
1104da8
# code object constructor. This adds support for Python 3.8.
1104da8
# https://github.com/glyph/automat/pull/111
1104da8
Patch0:         0001-Add-support-for-positional-only-arguments.patch
1104da8
2bd5ba5
BuildArch:      noarch
Jeroen van Meeuwen (Kolab Systems) f0e32c4
2bd5ba5
%{?python_enable_dependency_generator}
Jeroen van Meeuwen (Kolab Systems) f0e32c4
1a22e14
%description %{common_description}
2bd5ba5
2bd5ba5
a57ce6c
%if %{with python2}
1a22e14
%package -n     python2-%{pkgname}
2bd5ba5
Summary:        %{summary}
91bcbc6
Provides:       python2-%{libname}
1a22e14
%{?python_provide:%python_provide python2-%{pkgname}}
Jeroen van Meeuwen (Kolab Systems) f0e32c4
2bd5ba5
BuildRequires:  python2-devel
2bd5ba5
BuildRequires:  python2dist(m2r)
2bd5ba5
BuildRequires:  python2dist(setuptools)
2bd5ba5
BuildRequires:  python2dist(setuptools-scm)
Jeroen van Meeuwen (Kolab Systems) f0e32c4
%if %{with tests}
ed3723a
BuildRequires:  python2dist(pytest)
4ae4b0c
BuildRequires:  python2dist(attrs) >= 16.1
5b5e1bd
BuildRequires:  python2dist(graphviz) > 0.5.1
5b5e1bd
BuildRequires:  python2dist(six)
2bd5ba5
BuildRequires:  python2dist(twisted) >= 16.1.1
Jeroen van Meeuwen (Kolab Systems) f0e32c4
%endif
2bd5ba5
1a22e14
%description -n python2-%{pkgname} %{common_description}
a57ce6c
%endif
2bd5ba5
2bd5ba5
1a22e14
%package -n     python3-%{pkgname}
2bd5ba5
Summary:        %{summary}
91bcbc6
Provides:       python3-%{libname}
1a22e14
%{?python_provide:%python_provide python3-%{pkgname}}
Jeroen van Meeuwen (Kolab Systems) f0e32c4
2bd5ba5
BuildRequires:  python3-devel
2bd5ba5
BuildRequires:  python3dist(m2r)
2bd5ba5
BuildRequires:  python3dist(setuptools)
2bd5ba5
BuildRequires:  python3dist(setuptools-scm)
Jeroen van Meeuwen (Kolab Systems) f0e32c4
%if %{with tests}
ed3723a
BuildRequires:  python3dist(pytest)
4ae4b0c
BuildRequires:  python3dist(attrs) >= 16.1
5b5e1bd
BuildRequires:  python3dist(graphviz) > 0.5.1
5b5e1bd
BuildRequires:  python3dist(six)
2bd5ba5
BuildRequires:  python3dist(twisted) >= 16.1.1
Jeroen van Meeuwen (Kolab Systems) f0e32c4
%endif
2bd5ba5
1a22e14
%description -n python3-%{pkgname} %{common_description}
2bd5ba5
2bd5ba5
2bd5ba5
%prep
1104da8
%autosetup  -p1 -n %{srcname}-%{version}
2bd5ba5
# Remove bundled egg-info
1a22e14
rm -rf %{eggname}.egg-info
2bd5ba5
2bd5ba5
2bd5ba5
%build
a57ce6c
%if %{with python2}
2bd5ba5
%py2_build
a57ce6c
%endif
2bd5ba5
%py3_build
2bd5ba5
2bd5ba5
2bd5ba5
%install
2bd5ba5
# Must do the default python version install last because
2bd5ba5
# the scripts in /usr/bin are overwritten with every setup.py install.
a57ce6c
%if %{with python2}
2bd5ba5
%py2_install
2bd5ba5
rm -rf %{buildroot}%{_bindir}/*
a57ce6c
%endif
2bd5ba5
%py3_install
2bd5ba5
2bd5ba5
2bd5ba5
%check
Jeroen van Meeuwen (Kolab Systems) f0e32c4
%if %{with tests}
a57ce6c
%if %{with python2}
ed3723a
PYTHONPATH=%{buildroot}%{python2_sitelib} pytest-%{python2_version} --verbose automat/_test
a57ce6c
%endif
ed3723a
PYTHONPATH=%{buildroot}%{python3_sitelib} pytest-%{python3_version} --verbose automat/_test
Jeroen van Meeuwen (Kolab Systems) f0e32c4
%endif
2bd5ba5
2bd5ba5
a57ce6c
%if %{with python2}
1a22e14
%files -n python2-%{pkgname}
2bd5ba5
%license LICENSE
2bd5ba5
%doc README.md
1a22e14
%{python2_sitelib}/%{libname}
1a22e14
%{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info
a57ce6c
%endif
2bd5ba5
2bd5ba5
1a22e14
%files -n python3-%{pkgname}
2bd5ba5
%license LICENSE
2bd5ba5
%doc README.md
2bd5ba5
%{_bindir}/automat-visualize
1a22e14
%{python3_sitelib}/%{libname}
1a22e14
%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info
2bd5ba5
2bd5ba5
2bd5ba5
%changelog
81a7356
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.0-4
81a7356
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
81a7356
1104da8
* Mon May 27 21:26:47 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.7.0-3
1104da8
- Add patch supporting for positional only arguments for Python 3.8
1104da8
91bcbc6
* Sat Apr 06 2019 Carl George <carl@george.computer> - 0.7.0-2
91bcbc6
- Add provides for lowercase name
ed3723a
- Run tests with pytest like upstream does
91bcbc6
837bccf
* Mon Mar 11 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.7.0-1
837bccf
- Release 0.7.0 (#1687495)
837bccf
48252e5
* Fri Mar 08 2019 Jeroen van Meeuwen <vanmeeuwen+fedora@kolabsys.com> - 0.6.0-5
48252e5
 - Add bcond_without tests
48252e5
adf99bf
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-4
adf99bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
adf99bf
2ea5381
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
2ea5381
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2ea5381
b1dab18
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.6.0-2
b1dab18
- Rebuilt for Python 3.7
b1dab18
2bd5ba5
* Fri Apr 13 2018 Robert-André Mauchin <zebob.m@gmail.com> - 0.6.0-1
2bd5ba5
- Initial package.