2015-12-03 12:30:16 +00:00
#
2024-02-19 04:46:05 +00:00
# spec file for package python-pysmi
2015-12-03 12:30:16 +00:00
#
2025-02-04 19:02:55 +00:00
# Copyright (c) 2025 SUSE LLC
2015-12-03 12:30:16 +00:00
#
# 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.
2019-05-06 13:57:38 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2015-12-03 12:30:16 +00:00
#
2021-10-03 14:53:56 +00:00
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
2021-10-06 07:51:06 +00:00
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
2025-07-18 22:38:02 +00:00
%{?sle15_python_module_pythons}
2021-10-06 07:51:06 +00:00
Name : python-pysmi%{psuffix}
2025-07-18 22:36:25 +00:00
Version : 1.6.2
2015-12-03 12:30:16 +00:00
Release : 0
Summary : SNMP SMI/MIB Parser
License : BSD-2-Clause
2024-10-09 06:31:49 +00:00
URL : https://github.com/lextudio/pysmi
2025-07-25 21:50:25 +00:00
# Source: https://files.pythonhosted.org/packages/source/p/pysmi/pysmi-%%{version}.tar.gz
Source : https://github.com/lextudio/pysmi/archive/refs/tags/v%{version} .tar.gz#/pysmi-%{version}.tar.gz
2025-07-25 23:57:34 +00:00
BuildRequires : %{python_module base >= 3.9}
BuildRequires : %{python_module flit-core >= 3.9.0}
2024-02-19 04:46:05 +00:00
BuildRequires : %{python_module pip}
2017-08-14 07:58:20 +00:00
BuildRequires : fdupes
2024-10-09 06:31:49 +00:00
BuildRequires : python-rpm-macros
2021-10-06 07:51:06 +00:00
%if %{with test}
2025-07-25 23:57:34 +00:00
BuildRequires : %{python_module Jinja2 >= 3.1.3}
2024-10-09 06:31:49 +00:00
BuildRequires : %{python_module ply >= 3.11}
BuildRequires : %{python_module pyasn1}
BuildRequires : %{python_module pysmi = %{version} }
2021-10-06 07:51:06 +00:00
BuildRequires : %{python_module pysnmp}
2024-02-19 04:46:05 +00:00
BuildRequires : %{python_module pytest}
2025-07-25 23:57:34 +00:00
BuildRequires : %{python_module requests >= 2.26.0}
2021-10-06 07:51:06 +00:00
%endif
2025-07-25 23:57:34 +00:00
Requires : python-Jinja2 >= 3.1.3
2024-10-09 06:31:49 +00:00
Requires : python-ply >= 3.11
2025-07-25 23:57:34 +00:00
Requires : python-requests >= 2.26.0
2021-10-03 14:53:56 +00:00
%if %{with libalternatives}
2021-10-06 07:36:49 +00:00
BuildRequires : alts
2021-10-03 14:53:56 +00:00
Requires : alts
%else
2017-08-14 07:58:20 +00:00
Requires(post) : update-alternatives
2024-02-19 04:46:05 +00:00
Requires(postun) : update-alternatives
2021-10-03 14:53:56 +00:00
%endif
2015-12-03 12:30:16 +00:00
BuildArch : noarch
2017-08-14 07:58:20 +00:00
%python_subpackages
2015-12-03 12:30:16 +00:00
%description
A pure-Python implementation of SNMP/SMI MIB parsing and conversion library.
Can produce PySNMP MIB modules.
%prep
2024-10-09 06:31:49 +00:00
%autosetup -p1 -n pysmi-%{version}
2015-12-03 12:30:16 +00:00
%build
2024-02-19 04:46:05 +00:00
%pyproject_wheel
2015-12-03 12:30:16 +00:00
%install
2021-10-06 07:51:06 +00:00
%if !%{with test}
2024-02-19 04:46:05 +00:00
%pyproject_install
2021-09-19 17:25:22 +00:00
%python_clone -a %{buildroot} %{_bindir} /mibdump
%python_clone -a %{buildroot} %{_bindir} /mibcopy
2019-10-14 14:17:18 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2021-10-06 07:51:06 +00:00
%endif
2017-08-14 07:58:20 +00:00
2021-10-06 07:51:06 +00:00
%check
%if %{with test}
2025-07-25 23:57:34 +00:00
# Skipping tests because of gh#lextudio/pysnmp#198
%pytest -k 'not (ModuleComplianceReferenceTestCase or NotificationGroupReferenceTestCase or ObjectGroupReferenceTestCase or TypeDeclarationTestCase or TypeDeclarationFixedLengthTestCase)'
2021-10-06 07:51:06 +00:00
%endif
%if !%{with test}
2021-10-03 14:53:56 +00:00
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative mibdump
2017-08-14 07:58:20 +00:00
%post
%python_install_alternative mibdump
%postun
%python_uninstall_alternative mibdump
2015-12-03 12:30:16 +00:00
2017-08-14 07:58:20 +00:00
%files %{python_files}
2018-12-04 17:20:01 +00:00
%license LICENSE.rst
2025-07-18 22:36:25 +00:00
%doc README.md
2024-02-19 04:46:05 +00:00
%{python_sitelib} /pysmi
%{python_sitelib} /pysmi-%{version} .dist-info
2017-08-14 07:58:20 +00:00
%python_alternative %{_bindir} /mibdump
2019-01-10 09:39:20 +00:00
%python_alternative %{_bindir} /mibcopy
2021-10-06 07:51:06 +00:00
%endif
2015-12-03 12:30:16 +00:00
%changelog