Compare commits

4 Commits

2 changed files with 24 additions and 12 deletions

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Jun 4 15:10:04 UTC 2025 - Felix Stegmeier <felix.stegmeier@suse.com>
- fix usage of libalternatives
-------------------------------------------------------------------
Tue May 13 16:19:58 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Thu Oct 27 22:06:14 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-bashate
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
#
%bcond_without libalternatives
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global skip_python2 1
Name: python-bashate
@@ -28,16 +29,18 @@ URL: https://pypi.org/project/bashate/
Source: https://files.pythonhosted.org/packages/source/b/bashate/bashate-%{version}.tar.gz
BuildRequires: %{python_module Babel >= 0.9.6}
BuildRequires: %{python_module pbr}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module testtools}
BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# OpenStack package: stestr is only available for primary python3, only test on this flavor
BuildRequires: python3-stestr
Requires: alts
Requires: python-Babel >= 0.9.6
Requires: python-pbr
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%ifpython2
Requires: python-argparse
@@ -60,31 +63,30 @@ and will continue to evolve over time.
%setup -q -n bashate-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/bashate
%{python_expand #
rm -rf %{buildroot}%{$python_sitelib}/bashate/tests
sed -i -e '/^#!\//, 1d' %{buildroot}%{$python_sitelib}/bashate/bashate.py
}
%python_compileall
%{python_compileall}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
python3 -m stestr.cli run
%post
%python_install_alternative bashate
%postun
%python_uninstall_alternative bashate
%pre
# Removing old update-alternatives entries.
%python_libalternatives_reset_alternative bashate
%files %{python_files}
%license LICENSE
%doc AUTHORS README.rst ChangeLog
%python_alternative %{_bindir}/bashate
%{python_sitelib}/*
%{python_sitelib}/bashate
%{python_sitelib}/bashate-%{version}*-info
%changelog