bcm43xx-firmware/bcm43xx-firmware.spec
2016-09-03 02:50:54 +00:00

89 lines
3.8 KiB
RPMSpec

#
# spec file for package bcm43xx-firmware
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: bcm43xx-firmware
Version: 20160301
Release: 0
Summary: Firmware for the Broadcom BCM43xx chipset family
License: SUSE-Firmware
Group: System/Kernel
Url: http://www.broadcom.com/products/wireless-connectivity
# From https://github.com/raspberrypi/linux/issues/1325#issuecomment-195560582
# Phil Elwell (Raspberry Pi Foundation) wrote: "Broadcom have said that
# the firmware files for the BCM43438 are covered under this licence:"
Source0: https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/LICENCE.broadcom_bcm43xx
Source3621: http://dl.cubieboard.org/public/Cubieboard/benn/firmware/ap6210/nvram_ap6210.txt#/brcmfmac43362-sdio-cubietruck.txt
Source3622: https://github.com/Bananian/bananian/raw/master/deb/u-boot-m2-bananian_armhf/lib/firmware/brcm/brcmfmac43362-sdio.txt#/brcmfmac43362-sdio-bananapi-m2.txt
Source3623: https://github.com/Bananian/bananian/raw/master/deb/u-boot-pro-bananian_armhf/lib/firmware/brcm/brcmfmac43362-sdio.txt#/brcmfmac43362-sdio-bananapi-m1+.txt
Source4300: https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm80211/brcm/brcmfmac43430-sdio.bin
Source4301: https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm80211/brcm/brcmfmac43430-sdio.txt#/brcmfmac43430-sdio-raspberrypi3b.txt
Source4309: http://phelum.net/temp/BCM43430A1.hcd
# Owns /lib/firmware/brcm and potentially conflicts
BuildRequires: kernel-firmware
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
This package provides the firmware files needed for the
Broadcom BCM43430 Wifi+Bluetooth chipset.
%prep
%setup -q -c -T
cp %{SOURCE0} .
%build
%install
# Used by brcmfmac
install -D -m 0644 %{SOURCE3621} %{buildroot}/lib/firmware/brcm/brcmfmac43362-sdio-cubietruck.txt
install -D -m 0644 %{SOURCE3622} %{buildroot}/lib/firmware/brcm/brcmfmac43362-sdio-bananapi-m2.txt
install -D -m 0644 %{SOURCE3623} %{buildroot}/lib/firmware/brcm/brcmfmac43362-sdio-bananapi-m1+.txt
install -D -m 0644 %{SOURCE4300} %{buildroot}/lib/firmware/brcm/brcmfmac43430-sdio.bin
install -D -m 0644 %{SOURCE4301} %{buildroot}/lib/firmware/brcm/brcmfmac43430-sdio-raspberrypi3b.txt
# Used by bluez (hciattach)
install -D -m 0644 %{SOURCE4309} %{buildroot}/lib/firmware/BCM43430A1.hcd
%post
if [[ -e /sys/firmware/devicetree/base/compatible ]]; then
case "$(cat /sys/firmware/devicetree/base/compatible 2>/dev/null)" in
*cubietech,cubietruck*)
ln -sf brcmfmac43362-sdio-cubietruck.txt /lib/firmware/brcm/brcmfmac43362-sdio.txt
;;
*sinovoip,bpi-m2*)
ln -sf brcmfmac43362-sdio-bananapi-m2.txt /lib/firmware/brcm/brcmfmac43362-sdio.txt
;;
*lemaker,bananapro*)
ln -sf brcmfmac43362-sdio-bananapi-m1+.txt /lib/firmware/brcm/brcmfmac43362-sdio.txt
;;
*raspberrypi,3-model-b*)
ln -sf brcmfmac43430-sdio-raspberrypi3b.txt /lib/firmware/brcm/brcmfmac43430-sdio.txt
;;
esac
fi
%files
%defattr(-,root,root)
%doc LICENCE.broadcom_bcm43xx
/lib/firmware/*.hcd
/lib/firmware/brcm/*.bin
/lib/firmware/brcm/*.txt
%ghost /lib/firmware/brcm/brcmfmac43362-sdio.txt
%ghost /lib/firmware/brcm/brcmfmac43430-sdio.txt
%changelog