%global srcname snagboot Name: python-%{srcname} Version: 1.2 Release: %autorelease Summary: Generic recovery and reflashing tool for embedded platforms License: GPL-2.0-or-later URL: https://github.com/bootlin/snagboot Source: %{pypi_source} BuildArch: noarch BuildRequires: python3-devel BuildRequires: systemd-rpm-macros %global _description %{expand: Snagboot intends to be an open-source and generic replacement to the vendor-specific, sometimes proprietary, tools used to recover and/or reflash embedded platforms. Examples of such tools include STM32CubeProgrammer, SAM-BA ISP, UUU, and sunxi-fel. Snagboot is made of two separate parts: - snagrecover uses vendor-specific ROM code mechanisms to initialize external RAM and run U-Boot, without modifying any non-volatile memories; - snagflash communicates with U-Boot to flash system images to non-volatile memories, using either DFU, UMS or Fastboot.} %description %_description %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %_description %package -n %{srcname} Summary: %{summary} Requires: python3-%{srcname} = %{version}-%{release} Requires: udev %description -n %{srcname} %_description %prep %autosetup -p1 -n %{srcname}-%{version} # Dependency fixes # * Use the correct package name for libfdt and remove pin due to mismatch # * Remove version pin for tftpy due to mismatch # * Drop unneeded swig dependency sed -i pyproject.toml \ -e 's/"pylibfdt >=.*",/"libfdt",/' \ -e 's/"tftpy >=.*",/"tftpy",/' \ -e '/swig/d' %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files snagflash snagrecover install -Dpm0644 -t %{buildroot}%{_udevrulesdir} \ src/snagrecover/50-snagboot.rules %check %pyproject_check_import %files -n python3-%{srcname} -f %{pyproject_files} %files -n snagboot %doc README.md %{_bindir}/snagflash %{_bindir}/snagrecover %{_udevrulesdir}/50-snagboot.rules %changelog %autochangelog