forked from pool/python-pysmi
- Switch to pyproject macros.
- Use pytest for the testsuite. - No more greedy globs in %files. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysmi?expand=0&rev=24
This commit is contained in:
parent
ee9800c4fa
commit
f601ea61a9
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 19 04:44:48 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Switch to pyproject macros.
|
||||||
|
- Use pytest for the testsuite.
|
||||||
|
- No more greedy globs in %files.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Oct 6 07:40:43 UTC 2021 - Matej Cepl <mcepl@suse.com>
|
Wed Oct 6 07:40:43 UTC 2021 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file
|
# spec file for package python-pysmi
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# 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
|
||||||
@ -22,7 +22,6 @@
|
|||||||
%bcond_with libalternatives
|
%bcond_with libalternatives
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
||||||
%global flavor @BUILD_FLAVOR@%{nil}
|
%global flavor @BUILD_FLAVOR@%{nil}
|
||||||
%if "%{flavor}" == "test"
|
%if "%{flavor}" == "test"
|
||||||
%define psuffix -test
|
%define psuffix -test
|
||||||
@ -38,11 +37,15 @@ Summary: SNMP SMI/MIB Parser
|
|||||||
License: BSD-2-Clause
|
License: BSD-2-Clause
|
||||||
URL: http://pysmi.sourceforge.net/
|
URL: http://pysmi.sourceforge.net/
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pysmi/pysmi-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pysmi/pysmi-%{version}.tar.gz
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module ply}
|
BuildRequires: %{python_module ply}
|
||||||
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros >= 20210929
|
BuildRequires: python-rpm-macros >= 20210929
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
BuildRequires: %{python_module pysnmp}
|
BuildRequires: %{python_module pysnmp}
|
||||||
|
BuildRequires: %{python_module pytest}
|
||||||
%endif
|
%endif
|
||||||
Requires: python-ply
|
Requires: python-ply
|
||||||
%if %{with libalternatives}
|
%if %{with libalternatives}
|
||||||
@ -50,7 +53,7 @@ BuildRequires: alts
|
|||||||
Requires: alts
|
Requires: alts
|
||||||
%else
|
%else
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(postun):update-alternatives
|
Requires(postun): update-alternatives
|
||||||
%endif
|
%endif
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
@ -65,11 +68,11 @@ Documentation: http://pysmi.sf.net
|
|||||||
%setup -q -n pysmi-%{version}
|
%setup -q -n pysmi-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
%python_install
|
%pyproject_install
|
||||||
mv %{buildroot}%{_bindir}/mibdump.py %{buildroot}%{_bindir}/mibdump
|
mv %{buildroot}%{_bindir}/mibdump.py %{buildroot}%{_bindir}/mibdump
|
||||||
mv %{buildroot}%{_bindir}/mibcopy.py %{buildroot}%{_bindir}/mibcopy
|
mv %{buildroot}%{_bindir}/mibcopy.py %{buildroot}%{_bindir}/mibcopy
|
||||||
%python_clone -a %{buildroot}%{_bindir}/mibdump
|
%python_clone -a %{buildroot}%{_bindir}/mibdump
|
||||||
@ -79,7 +82,7 @@ mv %{buildroot}%{_bindir}/mibcopy.py %{buildroot}%{_bindir}/mibcopy
|
|||||||
|
|
||||||
%check
|
%check
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
%pyunittest -v tests
|
%pytest
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
@ -96,7 +99,8 @@ mv %{buildroot}%{_bindir}/mibcopy.py %{buildroot}%{_bindir}/mibcopy
|
|||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE.rst
|
%license LICENSE.rst
|
||||||
%doc README.md CHANGES.rst
|
%doc README.md CHANGES.rst
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/pysmi
|
||||||
|
%{python_sitelib}/pysmi-%{version}.dist-info
|
||||||
%python_alternative %{_bindir}/mibdump
|
%python_alternative %{_bindir}/mibdump
|
||||||
%python_alternative %{_bindir}/mibcopy
|
%python_alternative %{_bindir}/mibcopy
|
||||||
%endif
|
%endif
|
||||||
|
Loading…
Reference in New Issue
Block a user