File python-canmatrix.spec of Package python-canmatrix
#
# spec file for package python-canmatrix
#
# 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-canmatrix
Version: 1.0
Release: 0
Summary: Converting Can (Controller Area Network) Database Formats
License: BSD-2-Clause
URL: https://github.com/ebroecker/canmatrix
Source0: https://files.pythonhosted.org/packages/source/c/canmatrix/canmatrix-%{version}.tar.gz
Patch0: canmatrix-versioneer_312_fix.patch
Patch1: 0001-742-drop-future-744.patch
Patch2: 0001-remove-six-usage-784.patch
BuildRequires: %{python_module attrs}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module click}
BuildRequires: %{python_module dbf}
BuildRequires: %{python_module ldfparser}
BuildRequires: %{python_module lxml}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module xlrd}
BuildRequires: %{python_module xlwt}
BuildRequires: %{python_module XlsxWriter}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: diff
Requires: python-PyYAML
Requires: python-XlsxWriter
Requires: python-dbf
Requires: python-ldfparser
Requires: python-xlrd
Requires: python-xlwt
Requires: python-XlsxWriter
BuildArch: noarch
# SECTION test requirements
# /SECTION
%python_subpackages
%description
Canmatrix implements a "Python Can Matrix Object" which
describes the can-communication and the needed objects
(Boardunits, Frames, Signals, Values, ...)
Canmatrix also includes two Tools (canconvert and cancompare)
for converting and comparing CAN databases.
%prep
%autosetup -p1 -n canmatrix-%{version}
sed -i '1{/^#!/d}' src/canmatrix/cli/*.py
rm -rf test
mv src/canmatrix/tests/ .
%build
%python_build
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/cancompare
%python_clone -a %{buildroot}%{_bindir}/canconvert
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%post
%python_install_alternative cancompare canconvert
%postun
%python_uninstall_alternative cancompare
%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/cancompare
%python_alternative %{_bindir}/canconvert
%{python_sitelib}/canmatrix
%{python_sitelib}/canmatrix-%{version}*-info
%changelog