File python-bsed.spec of Package python-bsed

#
# spec file for package python-bsed
#
# Copyright (c) 2019 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/


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name:           python-bsed
Version:        0.2.5
Release:        0
License:        MIT
Summary:        Simple english syntax for stream editing
Url:            https://github.com/andrewbihl/bsed
Group:          Development/Languages/Python
Source:         https://github.com/andrewbihl/bsed/archive/%{version}.tar.gz#/bsed-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
# SECTION test requirements
BuildRequires:  %{python_module argcomplete}
BuildRequires:  %{python_module typing}
# /SECTION
BuildRequires:  fdupes
Requires:       python-argcomplete
Requires:       python-typing
BuildArch:      noarch

Requires(post):   update-alternatives
Requires(postun):   update-alternatives
%python_subpackages

%description
Simple english syntax for stream editing.

%prep
%setup -q -n bsed-%{version}

%build
export LANG=en_US.UTF-8
%python_build

%install
export LANG=en_US.UTF-8
%python_install
%python_clone -a %{buildroot}%{_bindir}/bsed
%{python_expand rm -r %{buildroot}%{$python_sitelib}/tests
%fdupes %{buildroot}%{$python_sitelib}
}

%check
export LANG=en_US.UTF-8
%python_exec setup.py test

%post
%python_install_alternative bsed

%postun
%python_uninstall_alternative bsed

%files %{python_files}
%license LICENSE
%doc README.md
%python_alternative %{_bindir}/bsed
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by