File python-python-utils.spec of Package python-python-utils

#
# spec file for package python-python-utils
#
# Copyright (c) 2022 Marcus Schäfer
#
# 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/
#
# If they aren't provided by a system installed macro, define them
%{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc}

%if 0%{?suse_version} && 0%{?suse_version} < 1600
%global __python3 /usr/bin/python3.11
%global python3_pkgversion 311
%else
%{!?__python3: %global __python3 /usr/bin/python3}
%{!?python3_pkgversion:%global python3_pkgversion 3}
%endif

%if %{undefined python3_sitelib}
%global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%endif

%if %{undefined python3_version}
%global python3_version %(%{__python3} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
%endif

%if %{undefined python3_version_nodots}
%global python3_version_nodots %(%{__python3} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
%endif

%if 0%{?debian} || 0%{?ubuntu}
%global is_deb 1
%global pygroup python
%global sysgroup admin
%global develsuffix dev
%else
%global pygroup Development/Languages/Python
%global sysgroup System/Management
%global develsuffix devel
%endif

Name:           python-python-utils
Version:        3.3.0
Release:        0
Summary:        Python library to provide a collection of useful functions
License:        BSD-3-Clause
Group:          %{pygroup}
URL:            https://python-utils.readthedocs.org/en/latest
Source:         python-utils-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if "%{_vendor}" == "debbuild"
# Needed to set Maintainer in output debs
Packager:       Marcus Schaefer <marcus.schaefer@gmail.com>
%endif
BuildRequires:  python%{python3_pkgversion}-%{develsuffix} >= 3.6
BuildRequires:  python%{python3_pkgversion}-setuptools
%if 0%{?fedora} || 0%{?suse_version}
BuildRequires:  fdupes
%endif
BuildArch:      noarch

%description
Python Utils is a collection of small Python functions and classes which make
common patterns shorter and easier.

# python3-python-utils
%package -n python%{python3_pkgversion}-python-utils
Summary:        Python library to provide a collection of useful functions
Group:          %{pygroup}
Requires:       python%{python3_pkgversion} >= 3.6

%description -n python%{python3_pkgversion}-python-utils
Python Utils is a collection of small Python functions and classes which make
common patterns shorter and easier.

%prep
%setup -q -n python-utils-%{version}
rm pytest.ini

%build
# no compile action for this module

%install
# Install Python 3 version
install -d -m 644 %{buildroot}/usr/share/doc/python-python-utils
%{__python3} setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb}
mkdir -p %{buildroot}/%{_defaultdocdir}/python-python-utils

%files -n python%{python3_pkgversion}-python-utils
%dir %{_defaultdocdir}/python-python-utils
%{python3_sitelib}/python_utils*

%changelog
openSUSE Build Service is sponsored by