File blackmagic.spec of Package blackmagic
#
# spec file for package blackmagic
#
# Copyright (c) 2023 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/
#
Name: blackmagic
Version: 1.10.2
Release: 0
Summary: Black Magic Debug App
License: GPL-3.0-only AND BSD-3-Clause AND MIT
Group: Hardware/Other
URL: https://github.com/blackmagic-debug/blackmagic
Source: https://github.com/blackmagic-debug/blackmagic/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: libhidapi-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libftdi1)
BuildRequires: pkgconfig(libusb)
%if 0%{?suse_version} && 0%{?suse_version} < 1600
BuildRequires: gcc13
%global gcc gcc-13
%else
%global gcc gcc
%endif
%description
The Black Magic Probe is a modern, in-application debugging tool for embedded microprocessors.
It allows you see what is going on 'inside' an application running on an embedded microprocessor
while it executes. It is able to control and examine the state of the target microprocessor using
a JTAG or Serial Wire Debugging (SWD) port and on-chip debug logic provided by the microprocessor.
The probe connects to a host computer using a standard USB interface. The user is able to control
exactly what happens using the GNU source level debugging software, GDB. Serial Wire Output (SWO)
allows the target to write tracing and logging to the host without using usb or serial port.
%prep
%setup -q
# fix group udev rules
sed -i 's|GROUP="plugdev"|GROUP="dialout"|' driver/*.rules
%build
pushd src
# fix missing include/version.h
echo "#define FIRMWARE_VERSION \"v1.10.2\"" > include/version.h
CC=%gcc %make_build PROBE_HOST=hosted
popd
%post
%{udev_rules_update}
%postun
%{udev_rules_update}
%install
install -D -m 0755 src/%{name} %{buildroot}%{_bindir}/%{name}
install -D -m 0644 driver/99-blackmagic-plugdev.rules %{buildroot}%{_udevrulesdir}/99-blackmagic-plugdev.rules
install -D -m 0644 driver/99-stlink-plugdev.rules %{buildroot}%{_udevrulesdir}/99-stlink-plugdev.rules
%files
%doc README.md
%license COPYING COPYING-BSD COPYING-MIT
%{_bindir}/%{name}
%{_udevrulesdir}/99-blackmagic-plugdev.rules
%{_udevrulesdir}/99-stlink-plugdev.rules
%changelog