14
0
Files
python-Automat/python-Automat.spec

82 lines
2.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-Automat
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
Name: python-Automat
Version: 0.4.0
Release: 0
License: MIT
Summary: Self-service finite-state machines for the programmer on the go
Url: https://github.com/glyph/automat
Group: Development/Languages/Python
Source: https://pypi.org/packages/source/A/Automat/Automat-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: python-setuptools_scm
BuildRequires: python-attrs
BuildRequires: python-six
Requires: python-attrs
Requires: python-six
Suggests: python-graphviz > 0.5.1
Suggests: python-Twisted >= 16.1.1
Requires(post): update-alternatives
Requires(preun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
Automat is a library for concise, idiomatic Python expression of finite-state
automata (particularly deterministic finite-state transducers).
%prep
%setup -q -n Automat-%{version}
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%check
python setup.py test
# Prepare for update-alternatives usage
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
mv %{buildroot}%{_bindir}/automat-visualize %{buildroot}%{_bindir}/automat-visualize-%{py_ver}
ln -s -f %{_sysconfdir}/alternatives/automat-visualize %{buildroot}%{_bindir}/automat-visualize
# create a dummy target for /etc/alternatives/automat-visualize
touch %{buildroot}%{_sysconfdir}/alternatives/automat-visualize
%post
%_sbindir/update-alternatives \
--install %{_bindir}/automat-visualize automat-visualize %{_bindir}/automat-visualize-%{py_ver} 30
%preun
if [ $1 -eq 0 ] ; then
%_sbindir/update-alternatives --remove automat-visualize %{_bindir}/automat-visualize-%{py_ver}
fi
%files
%defattr(-,root,root,-)
%doc LICENSE README.md
%{_bindir}/automat-visualize
%{_bindir}/automat-visualize-%{py_ver}
%ghost %{_sysconfdir}/alternatives/automat-visualize
%{python_sitelib}/*