summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCoprDistGit <copr-devel@lists.fedorahosted.org>2024-02-11 16:13:27 +0000
committerCoprDistGit <copr-devel@lists.fedorahosted.org>2024-02-11 16:13:27 +0000
commit18e1d90c945b323ba7d6e3490c09c6d2816ebfa0 (patch)
tree6062764d06406cf0f3a7d437db48b893c53009dd
parent0b951fbdf734418fb67f2bbac02e4ef789b04baa (diff)
automatic import of python-snagbootHEADmasterf39f38
-rw-r--r--.gitignore1
-rw-r--r--python-snagboot.spec79
-rw-r--r--sources1
3 files changed, 81 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..c8b834c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/snagboot-1.2.tar.gz
diff --git a/python-snagboot.spec b/python-snagboot.spec
new file mode 100644
index 0000000..69c6de5
--- /dev/null
+++ b/python-snagboot.spec
@@ -0,0 +1,79 @@
+%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
diff --git a/sources b/sources
new file mode 100644
index 0000000..95d1618
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+4d6e205ae0e2ccec043d303fdcd9274e snagboot-1.2.tar.gz