File python-pyacl.spec of Package python-pyacl
#
# spec file for package python-pyacl
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2024 Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net>
#
# 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 https://bugs.opensuse.org/
#
%define appname pyacl
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-%{appname}%{psuffix}
Version: 1.0.5
Release: 0
Summary: High level POSIX ACL library
License: EUPL-1.2
Group: Development/Languages/Python
URL: https://git.com.de/Georg/pyacl
Source: %{appname}-%{version}.tar.zst
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pylibacl
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module pyacl}
BuildRequires: %{python_module pytest}
BuildRequires: acl
%endif
%python_subpackages
%description
High level abstractions over pylibacl.
%prep
%autosetup -n %{appname}-%{version}
%build
%if !%{with test}
%pyproject_wheel
%endif
%install
%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}/%{appname}
%endif
%if %{with test}
%check
# test suite expects a user called "user" by default, use one which exists in our build environment instead
sed -i 's/user:user/user:abuild/' tests/*.yaml
sed -i 's/^ user:$/ abuild:/' tests/matrix.yaml
sed -Ei -e 's/^ user:$/ abuild:/' -e 's/(target_name: )user/\1abuild/' tests/matrix-apply.yaml
%pytest
%endif
%if !%{with test}
%files %{python_files}
%license LICENSE
%doc README.md
%dir %{python_sitelib}/%{appname}
%pycache_only %{python_sitelib}/%{appname}/__pycache__
%{python_sitelib}/%{appname}/__{init,version}__.py
%{python_sitelib}/%{appname}/acl.py
%{python_sitelib}/%{appname}-%{version}.dist-info
%endif
%changelog