%global _lib_path /usr/lib/firmware
%global _license_path /usr/share/licenses/raspi
%global debug_package %{nil}

Name:		raspberrypi-firmware
Version:	20200717
Release:	1
Summary:	Firmware files used for RaspberryPi
License:	GPL+ and GPLv2+ and MIT and Redistributable, no modification permitted
ExclusiveArch: aarch64

Provides:	raspberrypi-firmware = %{version}-%{release}

Source0:	%{name}-%{version}.tar.gz
Source1:	LICENCE.bluez-firmware
Source2:	LICENCE.broadcom_bcm43xx
Source3:	LICENCE.broadcom
Source4:	LICENCE.COPYING.linux
Source5:	LICENCE.wireless-regdb

%prep
%setup -q -c

%description
This package contains firmware images required by some RaspberryPi devices.

%install
mkdir -p %{buildroot}%{_lib_path}/brcm
mkdir -p %{buildroot}%{_license_path}
mkdir -p %{buildroot}/boot
install -p -m 644 %{_sourcedir}/LICENCE.* %{buildroot}%{_license_path}
install -p -m 644 $(find firmware/ -maxdepth 1 -type f) %{buildroot}%{_lib_path}
install -p -m 644 firmware/brcm/* %{buildroot}%{_lib_path}/brcm
install -p -m 644 firmware-boot/* %{buildroot}/boot

%files
%dir %{_lib_path}
%dir %{_license_path}
%{_license_path}
%{_lib_path}/*
/boot/*

%changelog
* Wed May 20 2020 EulixOS Buildteam <isrc-support@iscas.ac.cn> - 20200512-1
- Add firmware file from RaspberryPi firmware, bluez-firmware and firmware-nonfree.
