17
0

2 Commits

Author SHA256 Message Date
da50097309 Sync with factory 2026-02-18 12:16:11 +01:00
d3e0964b1d Convert to libalternatives, bsc#1245883 2025-11-03 15:09:13 +01:00
5 changed files with 61 additions and 5 deletions

3
.gitattributes vendored
View File

@@ -1,4 +1,4 @@
## Default LFS *.changes merge=merge-changes
*.7z filter=lfs diff=lfs merge=lfs -text *.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text *.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text *.bz2 filter=lfs diff=lfs merge=lfs -text
@@ -12,6 +12,7 @@
*.pdf filter=lfs diff=lfs merge=lfs -text *.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text *.rpm filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text *.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text *.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text *.tgz filter=lfs diff=lfs merge=lfs -text

5
.gitignore vendored
View File

@@ -1 +1,4 @@
.osc *.obscpio
*.osc
_build.*
.pbuild

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Wed Feb 4 11:50:45 UTC 2026 - Daniel Garcia <daniel.garcia@suse.com>
- Add pythons_for_pypi macro. This macro will help to build the python
minimal stack for different python versions.
-------------------------------------------------------------------
Mon Aug 25 14:26:40 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems
-------------------------------------------------------------------
Wed Feb 5 12:20:58 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
- Use multibuild for tests
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Mar 16 14:23:15 UTC 2024 - Dirk Müller <dmueller@suse.com> Sat Mar 16 14:23:15 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-userpath # spec file for package python-userpath
# #
# Copyright (c) 2024 SUSE LLC # Copyright (c) 2026 SUSE LLC and contributors
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,8 +16,22 @@
# #
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?pythons_for_pypi}
%{?sle15_python_module_pythons} %{?sle15_python_module_pythons}
Name: python-userpath Name: python-userpath%{psuffix}
Version: 1.9.2 Version: 1.9.2
Release: 0 Release: 0
Summary: Tool for adding locations to the user PATH Summary: Tool for adding locations to the user PATH
@@ -30,12 +44,20 @@ BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-click Requires: python-click
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
BuildArch: noarch %endif
%if %{with test}
# SECTION test requirements # SECTION test requirements
BuildRequires: %{python_module click} BuildRequires: %{python_module click}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module userpath = %{version}}
%endif
# /SECTION # /SECTION
%python_subpackages %python_subpackages
@@ -47,28 +69,39 @@ with no elevated privileges required.
%autosetup -p1 -n userpath-%{version} %autosetup -p1 -n userpath-%{version}
%build %build
%if !%{with test}
%pyproject_wheel %pyproject_wheel
%endif
%install %install
%if !%{with test}
%pyproject_install %pyproject_install
%python_clone -a %{buildroot}%{_bindir}/userpath %python_clone -a %{buildroot}%{_bindir}/userpath
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check %check
%if %{with test}
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
%pytest %pytest
%endif
%if !%{with test}
%post %post
%python_install_alternative userpath %python_install_alternative userpath
%postun %postun
%python_uninstall_alternative userpath %python_uninstall_alternative userpath
%pre
%python_libalternatives_reset_alternative userpath
%files %{python_files} %files %{python_files}
%doc README.md %doc README.md
%license LICENSE.txt %license LICENSE.txt
%python_alternative %{_bindir}/userpath %python_alternative %{_bindir}/userpath
%{python_sitelib}/userpath %{python_sitelib}/userpath
%{python_sitelib}/userpath-%{version}*-info %{python_sitelib}/userpath-%{version}*-info
%endif
%changelog %changelog