Blame python-Automat.spec

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