Files
stlink/stlink.spec
Wojciech Kazubski 285c65ea21 Accepting request 1147020 from home:amanzini:branches:electronics
- Update to 1.8.0. Check CHANGELOG.md for the full list of changes
  + New features:
    * Support for writing option bytes on STM32F0/F1/F3
    * Initial support for STM32 L5 & U5 devices and minor changes
    * Added chip-IDs for STM32G0B0/G0B1/G0C1/G050/G051/G061
    * Added option byte info for STM32F411XX
    * Expanded and revised list of chips
    * STM32H72X/3X: Added full access to all device memory
    * Erase addr size / section of the flash memory with st-flash 
    * Added support for STM32L4Q5 
    * Added writing and reading for STM32WL option bytes
    * Added parametres option_base, option_size for F401xD_xE 
    * Added support for option bytes to F1xx_XLD
    * Added option byte address for L4Rx devices
    * Added udev-rule rule for the STLink v3 MINIE programmer
    * Added support for STM32C0x1 devices
    * First Implementation of the OTP Read/Write function
  + Updates & changes:
    * code and documentation refactoring
    * Ability to flash F7 devices when in dual-bank mode 
    * Improved chipid checks and printouts
    * End of support for macOS
  + Fixes:
    * Fixed some flashing issues on STM32L0
    * Fixed clearance of the H7 dual bank flag
    * Fixed get_stm32l0_flash_base address for STM32L152RE
    * Fixed segfault if chip was not found in chip config files
    * Corrected flash_pagesize to use hex format
    * Fixed flash regs addr for STM32L152RET6 in common_flash.c 
    * Fixed flash, dbgmcu and rcc registers for STM32L1

OBS-URL: https://build.opensuse.org/request/show/1147020
OBS-URL: https://build.opensuse.org/package/show/electronics/stlink?expand=0&rev=21
2024-02-22 20:08:59 +00:00

132 lines
3.8 KiB
RPMSpec

#
# spec file for package stlink
#
# 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/
#
%if 0%{?suse_version} < 1550 && 0%{?sle_version} <= 150300
# systemd-rpm-macros is wrong in 15.3 and below
%define _modprobedir /lib/modprobe.d
%endif
%global modprobe_d_files stlink_v1.conf
%define sover 1
Name: stlink
Version: 1.8.0
Release: 0
Summary: STM32 discovery line linux programmer
License: BSD-3-Clause
Group: Development/Tools/Debuggers
URL: https://github.com/stlink-org/stlink/
Source0: https://github.com/stlink-org/stlink/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: gtk3-devel >= 3.22.30
BuildRequires: pkg-config
BuildRequires: systemd-rpm-macros
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(libusb-1.0) >= 1.0.22
BuildRequires: pkgconfig(udev)
Requires: udev
%description
STLINK v1/v2 JTAG/SWD debugging/flashing tool for STM32 microcontrollers.
%package gui
Summary: GUI for STM32 discovery line linux programmer
Group: Development/Tools/Debuggers
Requires: %{name} = %{version}
%description gui
STLINK v1/v2 JTAG/SWD debugging/flashing tool for STM32 microcontrollers.
%package -n libstlink%{sover}
Summary: Shared library for stlink
Group: Development/Tools/Debuggers
%description -n libstlink%{sover}
STLINK v1/v2 JTAG/SWD debugging/flashing tool for STM32 microcontrollers.
%package devel
Summary: Development files for stlink package
Group: Development/Tools/Debuggers
Requires: libstlink%{sover} = %{version}
%description devel
STLINK v1/v2 JTAG/SWD debugging/flashing tool for STM32 microcontrollers.
%prep
%autosetup -p1
%build
%cmake -DSTLINK_UDEV_RULES_DIR="%_udevrulesdir" \
-DSTLINK_MODPROBED_DIR="%_modprobedir" \
-DCMAKE_EXE_LINKER_FLAGS="-pie"
%cmake_build
%install
%cmake_install
# remove static lib sdi
rm %{buildroot}%{_libdir}/*.a
%suse_update_desktop_file -r stlink-gui Development Debugger
%pre
# Avoid restoring outdated stuff in posttrans
for _f in %{?modprobe_d_files}; do
[ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \
mv -f "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}.rpmsave.old" || :
done
%posttrans
# Migration of modprobe.conf files to _modprobedir
for _f in %{?modprobe_d_files}; do
[ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \
mv -fv "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}" || :
done
%post -n libstlink%{sover} -p /sbin/ldconfig
%postun -n libstlink%{sover} -p /sbin/ldconfig
%files
%doc README.md CHANGELOG.md doc/supported_devices.md doc/tutorial.md doc/flashloaders.md
%license LICENSE.md
%{_bindir}/st-*
%{_udevrulesdir}/49-stlink*
%dir %{_modprobedir}
%{_modprobedir}/stlink_v1.conf
%{_mandir}/man1/st-flash.1*
%{_mandir}/man1/st-info.1*
%{_mandir}/man1/st-util.1*
%files -n libstlink%{sover}
%{_libdir}/libstlink.so.1*
%files gui
%{_bindir}/stlink-gui
%{_datadir}/stlink/
%{_datadir}/applications/stlink-gui.desktop
%{_datadir}/icons/hicolor/scalable/apps/stlink-gui.svg
%files devel
%dir %{_includedir}/stlink
%{_includedir}/stlink/
%{_libdir}/libstlink.so
%changelog