Files
python-pymdstat/python-pymdstat.spec

67 lines
2.3 KiB
RPMSpec

#
# spec file for package python-pymdstat
#
# Copyright (c) 2024 SUSE LLC
#
# 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 skip_python311 1
%define skip_python312 1
%define short_name pymdstat
Name: python-pymdstat
Version: 0.4.3
Release: 0
Summary: Python library to parse Linux /proc/mdstat
License: MIT
URL: https://github.com/nicolargo/pymdstat
Source: https://files.pythonhosted.org/packages/source/p/pymdstat/pymdstat-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildArch: noarch
%python_subpackages
%description
A pythonic library to parse Linux /proc/mdstat file.
%prep
%autosetup -p1 -n pymdstat-%{version}
find . -type f -exec sed -i 's@#!%{_bindir}/env python$@#!%{_bindir}/python@' {} +
find . -type f -exec sed -i 's@#!%{_bindir}/env python3$@#!%{_bindir}/python3@' {} +
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand sed -i '1d' %{buildroot}%{$python_sitelib}/%{short_name}/__init__.py
%python_expand sed -i '1d' %{buildroot}%{$python_sitelib}/%{short_name}/%{short_name}.py
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_expand mkdir -vp %{buildroot}%{_defaultdocdir}/$python-%{short_name}
%python_expand cp -v %{buildroot}%{_datadir}/doc/%{short_name}/* %{buildroot}%{_defaultdocdir}/$python-%{short_name}/
rm -vrf %{buildroot}%{_datadir}/doc/%{short_name}
%files %{python_files}
%{python_sitelib}/%{short_name}
%{python_sitelib}/%{short_name}-%{version}.dist-info
%dir %{_defaultdocdir}/python%{python_version_nodots}-%{short_name}
%{_defaultdocdir}/python%{python_version_nodots}-%{short_name}/*
%changelog