File sedbgmux.spec of Package sedbgmux

#
# spec file for package sedbgmux
#
# Copyright (c) 2024, Martin Hauke <mardnh@gmx.de>
#
# 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/
#


Name:           sedbgmux
Version:        0~git20250610
Release:        0
Summary:        DebugMux client for [Sony] Ericsson phones and modems
License:        GPL-3.0-or-later
Group:          Productivity/Telephony/Other
URL:            https://gitea.osmocom.org/fixeria/sedbgmux
#Git-Clone:     https://gitea.osmocom.org/fixeria/sedbgmux.git
Source:         %{name}-%{version}.tar.xz
BuildRequires:  python-rpm-macros
BuildRequires:  python3-setuptools
Requires:       python3-construct
Requires:       python3-pyserial
Requires:       python3-crcmod
Requires:       python3-cmd2
Recommends:     python3-pyshark
BuildArch:      noarch

%description
DebugMux client for [Sony] Ericsson phones and modems.

The following uilities are currently available:
 * sedbgmux-shell - interactive shell.
 * sedbgmux-dump  - dump management utility

%prep
%setup -q
# drop shebang
find sedbgmux -name "*.py" -exec sed -i '/^#!\//, 1d' {} \;

%build
python%{python_version} setup.py build

%install
python%{python_version} setup.py install --root=%{buildroot}
# strip .py file extension from scripts
cd %{buildroot}%{_bindir} && find . -name "*.py" -exec sh -c 'mv $0 `basename "$0" .py`' '{}' \;

%check
# No tests yet

%files
%license LICENSE.txt
%doc README.md
%doc contrib/sedbgmux.lua
%{_bindir}/sedbgmux-dump
%{_bindir}/sedbgmux-shell
%{python3_sitelib}/sedbgmux*

%changelog
openSUSE Build Service is sponsored by