2015-12-03 13:30:16 +01:00
|
|
|
#
|
2024-02-19 05:46:05 +01:00
|
|
|
# spec file for package python-pysmi
|
2015-12-03 13:30:16 +01:00
|
|
|
#
|
2024-02-19 05:46:05 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2015-12-03 13:30:16 +01: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 15:57:38 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2015-12-03 13:30:16 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2021-10-03 16:53:56 +02:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
|
|
|
|
2021-10-06 09:51:06 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
|
|
|
Name: python-pysmi%{psuffix}
|
2019-05-06 15:57:38 +02:00
|
|
|
Version: 0.3.4
|
2015-12-03 13:30:16 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: SNMP SMI/MIB Parser
|
|
|
|
License: BSD-2-Clause
|
2018-12-04 18:20:01 +01:00
|
|
|
URL: http://pysmi.sourceforge.net/
|
2017-08-14 09:58:20 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pysmi/pysmi-%{version}.tar.gz
|
2024-02-19 05:46:05 +01:00
|
|
|
BuildRequires: %{python_module pip}
|
2017-08-14 09:58:20 +02:00
|
|
|
BuildRequires: %{python_module ply}
|
2024-02-19 05:46:05 +01:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: %{python_module wheel}
|
2017-08-14 09:58:20 +02:00
|
|
|
BuildRequires: fdupes
|
2021-10-03 16:53:56 +02:00
|
|
|
BuildRequires: python-rpm-macros >= 20210929
|
2021-10-06 09:51:06 +02:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module pysnmp}
|
2024-02-19 05:46:05 +01:00
|
|
|
BuildRequires: %{python_module pytest}
|
2021-10-06 09:51:06 +02:00
|
|
|
%endif
|
2015-12-03 13:30:16 +01:00
|
|
|
Requires: python-ply
|
2021-10-03 16:53:56 +02:00
|
|
|
%if %{with libalternatives}
|
2021-10-06 09:36:49 +02:00
|
|
|
BuildRequires: alts
|
2021-10-03 16:53:56 +02:00
|
|
|
Requires: alts
|
|
|
|
%else
|
2017-08-14 09:58:20 +02:00
|
|
|
Requires(post): update-alternatives
|
2024-02-19 05:46:05 +01:00
|
|
|
Requires(postun): update-alternatives
|
2021-10-03 16:53:56 +02:00
|
|
|
%endif
|
2015-12-03 13:30:16 +01:00
|
|
|
BuildArch: noarch
|
2017-08-14 09:58:20 +02:00
|
|
|
%python_subpackages
|
2015-12-03 13:30:16 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
A pure-Python implementation of SNMP/SMI MIB parsing and conversion library.
|
|
|
|
Can produce PySNMP MIB modules.
|
|
|
|
|
|
|
|
Documentation: http://pysmi.sf.net
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pysmi-%{version}
|
|
|
|
|
|
|
|
%build
|
2024-02-19 05:46:05 +01:00
|
|
|
%pyproject_wheel
|
2015-12-03 13:30:16 +01:00
|
|
|
|
|
|
|
%install
|
2021-10-06 09:51:06 +02:00
|
|
|
%if !%{with test}
|
2024-02-19 05:46:05 +01:00
|
|
|
%pyproject_install
|
2015-12-03 13:30:16 +01:00
|
|
|
mv %{buildroot}%{_bindir}/mibdump.py %{buildroot}%{_bindir}/mibdump
|
2019-01-10 10:39:20 +01:00
|
|
|
mv %{buildroot}%{_bindir}/mibcopy.py %{buildroot}%{_bindir}/mibcopy
|
2021-09-19 19:25:22 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/mibdump
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/mibcopy
|
2019-10-14 16:17:18 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2021-10-06 09:51:06 +02:00
|
|
|
%endif
|
2017-08-14 09:58:20 +02:00
|
|
|
|
2021-10-06 09:51:06 +02:00
|
|
|
%check
|
|
|
|
%if %{with test}
|
2024-02-19 05:46:05 +01:00
|
|
|
%pytest
|
2021-10-06 09:51:06 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if !%{with test}
|
2021-10-03 16:53:56 +02:00
|
|
|
%pre
|
|
|
|
# If libalternatives is used: Removing old update-alternatives entries.
|
|
|
|
%python_libalternatives_reset_alternative mibdump
|
|
|
|
|
2017-08-14 09:58:20 +02:00
|
|
|
%post
|
|
|
|
%python_install_alternative mibdump
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative mibdump
|
2015-12-03 13:30:16 +01:00
|
|
|
|
2017-08-14 09:58:20 +02:00
|
|
|
%files %{python_files}
|
2018-12-04 18:20:01 +01:00
|
|
|
%license LICENSE.rst
|
|
|
|
%doc README.md CHANGES.rst
|
2024-02-19 05:46:05 +01:00
|
|
|
%{python_sitelib}/pysmi
|
|
|
|
%{python_sitelib}/pysmi-%{version}.dist-info
|
2017-08-14 09:58:20 +02:00
|
|
|
%python_alternative %{_bindir}/mibdump
|
2019-01-10 10:39:20 +01:00
|
|
|
%python_alternative %{_bindir}/mibcopy
|
2021-10-06 09:51:06 +02:00
|
|
|
%endif
|
2015-12-03 13:30:16 +01:00
|
|
|
|
|
|
|
%changelog
|