# what it's called on pypi
%global srcname Automat
# what it's imported as
%global libname automat
# name of egg info directory
%global eggname %{srcname}
# package name fragment
%global pkgname %{srcname}
%global common_description %{expand:
Automat is a library for concise, idiomatic Python expression of finite-state
automata (particularly deterministic finite-state transducers).}
%bcond_without tests
Name: python-%{pkgname}
Version: 0.7.0
Release: 1%{?dist}
Summary: Self-service finite-state machines for the programmer on the go
License: MIT
URL: https://github.com/glyph/automat
Source0: %pypi_source
BuildArch: noarch
%{?python_enable_dependency_generator}
%description %{common_description}
%package -n python2-%{pkgname}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{pkgname}}
BuildRequires: python2-devel
BuildRequires: python2dist(m2r)
BuildRequires: python2dist(setuptools)
BuildRequires: python2dist(setuptools-scm)
%if %{with tests}
BuildRequires: python2dist(attrs)
BuildRequires: python2dist(graphviz) > 0.5.1
BuildRequires: python2dist(six)
BuildRequires: python2dist(twisted) >= 16.1.1
%endif
%description -n python2-%{pkgname} %{common_description}
%package -n python3-%{pkgname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pkgname}}
BuildRequires: python3-devel
BuildRequires: python3dist(m2r)
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(setuptools-scm)
%if %{with tests}
BuildRequires: python3dist(attrs)
BuildRequires: python3dist(graphviz) > 0.5.1
BuildRequires: python3dist(six)
BuildRequires: python3dist(twisted) >= 16.1.1
%endif
%description -n python3-%{pkgname} %{common_description}
%prep
%autosetup -n %{srcname}-%{version}
# Remove bundled egg-info
rm -rf %{eggname}.egg-info
%build
%py2_build
%py3_build
%install
# Must do the default python version install last because
# the scripts in /usr/bin are overwritten with every setup.py install.
%py2_install
rm -rf %{buildroot}%{_bindir}/*
%py3_install
%check
%if %{with tests}
%{__python2} setup.py test
%{__python3} setup.py test
%endif
%files -n python2-%{pkgname}
%license LICENSE
%doc README.md
%{python2_sitelib}/%{libname}
%{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info
%files -n python3-%{pkgname}
%license LICENSE
%doc README.md
%{_bindir}/automat-visualize
%{python3_sitelib}/%{libname}
%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info
%changelog
* Mon Mar 11 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.7.0-1
- Release 0.7.0 (#1687495)
* Fri Mar 08 2019 Jeroen van Meeuwen <vanmeeuwen+fedora@kolabsys.com> - 0.6.0-5
- Add bcond_without tests
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.6.0-2
- Rebuilt for Python 3.7
* Fri Apr 13 2018 Robert-André Mauchin <zebob.m@gmail.com> - 0.6.0-1
- Initial package.