File python-pygnssutils.spec of Package python-pygnssutils

#
# spec file for package python-pygnssutils
#
# Copyright (c) 2022 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 pythons python3
Name:           python-pygnssutils
Version:        0.1.1alpha
# Need this as RPM versions cannot have a dash.
%define alpha   0.1.1-alpha
Release:        0
Summary:        Read, parse and broadcast GNSS NMEA, UBX and RTCM3 protocols
License:        BSD-3-Clause
Group:          Development/Libraries/Python
URL:            https://github.com/semuconsulting/pygnssutils
Source:         https://files.pythonhosted.org/packages/source/p/pygnssutils/pygnssutils-%{alpha}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pyubx2 >= 1.2.11}
BuildRequires:  %{python_module pynmeagps >= 1.0.13}
BuildRequires:  %{python_module pyrtcm >= 0.2.6}
BuildRequires:  %{python_module pyserial >= 3.4}
BuildRequires:  fdupes
BuildArch:      noarch
%python_subpackages

%description
pygnssutils is an original Python 3 library which reads, parses and broadcasts the NMEA, UBX or RTCM3 output of any GNSS receiver, as well as providing a variety of GNSS utility classes and functions.

It consolidates the common capabilities of three existing core GNSS protocol libraries from the same stable:

1. pynmeagps (NMEA Protocol)
2. pyubx2 (UBX Protocol)
3. pyrtcm (RTCM3 Protocol)

NB: pygnssutils does not replace these libraries. pynmeagps, pyubx2 and pyrtcm will continue to be developed as independent libraries for their specific protocol parsing and generation capabilities, but functionality which is common to all three (such as reading from a GNSS data stream, and certain helper classes and functions) will be incorporated into pygnssutils. The motivation is to reduce code duplication between these libraries, reduce maintenance and testing overheads, minimise churn on the core protocol libraries, and act as a framework for future generic GNSS capabilities.

%prep
%setup -q -n pygnssutils-%{alpha}

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/gnssdump
%python_clone -a %{buildroot}%{_bindir}/gnssserver
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%post
%python_install_alternative gnssdump
%python_install_alternative gnssserver

%postun
%python_uninstall_alternative gnssdump
%python_uninstall_alternative gnssserver

%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/gnssdump
%python_alternative %{_bindir}/gnssserver
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by