From 6da7c49a32e14a5eb01072e7a997963400fe59e6 Mon Sep 17 00:00:00 2001
From: Bryan Zuelly <bzuelly@outlook.com>
Date: Sat, 29 Mar 2025 21:42:03 +0000
Subject: [PATCH] initial w/ metadata

---
 .gitignore                    |  1 +
 .rpi-firmware-bluez.metadata  |  1 +
 SPECS/rpi-firmware-bluez.spec | 60 +++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 .rpi-firmware-bluez.metadata
 create mode 100644 SPECS/rpi-firmware-bluez.spec

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..335ec95
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.tar.gz
diff --git a/.rpi-firmware-bluez.metadata b/.rpi-firmware-bluez.metadata
new file mode 100644
index 0000000..7479786
--- /dev/null
+++ b/.rpi-firmware-bluez.metadata
@@ -0,0 +1 @@
+d090636b996d44d418f56a61b69dd31e385a799e463ab82bb37df767ae23287e  SOURCES/bluez-firmware-a6d4105d0989103ea6384b65940c76add1914127.tar.gz
diff --git a/SPECS/rpi-firmware-bluez.spec b/SPECS/rpi-firmware-bluez.spec
new file mode 100644
index 0000000..66d0271
--- /dev/null
+++ b/SPECS/rpi-firmware-bluez.spec
@@ -0,0 +1,60 @@
+%global	_fwpath	/usr/lib/firmware
+%global	bluez_commit	a6d4105d0989103ea6384b65940c76add1914127
+%global	bluez_srcdir	bluez-firmware-%{bluez_commit}
+
+Name:		rpi-firmware-bluez
+Version:	1.2
+Release:	3%{?dist}
+Summary:	Supplemental firmware used by Linux kernel for some Raspberry Pi models
+BuildArch:	noarch
+ExclusiveArch:	aarch64
+
+License:	CYPRESS-WIRELESS-CONNECTIVITY-DEVICES-DRIVER-END-USER-LICENSE-AGREEMENT
+URL:		https://github.com/RPi-Distro/bluez-firmware
+
+Source0:	https://github.com/RPi-Distro/bluez-firmware/archive/%{bluez_commit}/bluez-firmware-%{bluez_commit}.tar.gz
+
+Requires:	linux-firmware
+
+%description
+This package provides supplemental firmware files not included in linux-firmware
+package to enable Bluetooth/Wi-Fi on some Raspberry Pi models.
+
+%prep
+%setup -n %{bluez_srcdir} 
+
+%build
+
+%install
+install -d %{buildroot}%{_fwpath}/brcm
+install -d %{buildroot}/usr/share/licenses/bluez-brcm
+
+cp debian/copyright %{buildroot}/usr/share/licenses/bluez-brcm/
+
+# Bluetooth for RPi Zero 2W
+cp broadcom/BCM43430B0.hcd %{buildroot}%{_fwpath}/brcm/
+# Bluetooth for RPi 3B+, 4, 5
+cp broadcom/BCM43430A1.hcd %{buildroot}%{_fwpath}/brcm/
+cp broadcom/BCM4345C0.hcd %{buildroot}%{_fwpath}/brcm/
+# Bluetooth for RPi 400
+cp broadcom/BCM4345C5.hcd %{buildroot}%{_fwpath}/brcm/
+
+# compress these firmware files
+xz -C crc32 %{buildroot}%{_fwpath}/brcm/BCM43430A1.hcd
+xz -C crc32 %{buildroot}%{_fwpath}/brcm/BCM43430B0.hcd
+xz -C crc32 %{buildroot}%{_fwpath}/brcm/BCM4345C0.hcd
+xz -C crc32 %{buildroot}%{_fwpath}/brcm/BCM4345C5.hcd
+
+# Raspberry Pi 5
+ln -s BCM4345C0.hcd.xz %{buildroot}%{_fwpath}/brcm/BCM4345C0.raspberrypi,5-model-b.hcd.xz
+ln -s brcmfmac43455-sdio.bin.xz %{buildroot}%{_fwpath}/brcm/brcmfmac43455-sdio.raspberrypi,5-model-b.bin.xz
+ln -s brcmfmac43455-sdio.clm_blob.xz %{buildroot}%{_fwpath}/brcm/brcmfmac43455-sdio.raspberrypi,5-model-b.clm_blob.xz
+
+%files
+%license /usr/share/licenses/bluez-brcm/copyright
+%{_fwpath}/brcm/*
+
+%changelog
+* Sat Mar 01 2025 Bryan Zuelly <bzuelly@outlook.com> - 20221219-1
+- Initial
+- influenced by linux-firmware-raspberrypi from Alma Linux
-- 
GitLab