commit 2fa1df0b909008aef9f7628b51493c2213653fe4
Author: Nicolas Viéville <nicolas.vieville(a)univ-valenciennes.fr>
Date: Thu Apr 19 21:22:32 2018 +0200
Added AppStream Metadata
Update new Broadcom upstream URLs in SPEC file
Cleanup and rework SPEC file for RHEL 6.x and 7.x
.gitignore | 1 +
broadcom-wl.spec | 90 +++++++++++++++++-------
com.broadcom.wireless.hybrid.driver.metainfo.xml | 51 ++++++++++++++
generate-modalias-metadata.py | 74 +++++++++++++++++++
sources | 2 +-
5 files changed, 190 insertions(+), 28 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 14cdcea..6d9665f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
hybrid-v35-nodebug-pcoem-6_30_223_271.tar.gz
README_6.30.223.271.txt
+/broadcom-wl-blacklist.conf
diff --git a/broadcom-wl.spec b/broadcom-wl.spec
index c1bb676..b8664aa 100644
--- a/broadcom-wl.spec
+++ b/broadcom-wl.spec
@@ -1,29 +1,48 @@
+%if 0%{?rhel} > 6 || 0%{?fedora}
+ # The common usage uses /usr directory, even if it's not conforming to
+ # Fedora Packaging Guidelines, as well kmod and dracut packages, see:
+ #
https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelin...
+ %global _modprobe_d %{_prefix}/lib/modprobe.d
+ %global _dracut_conf_d %{_prefix}/lib/dracut/dracut.conf.d
+%else #rhel <= 6
+ %global _modprobe_d %{_sysconfdir}/modprobe.d
+ %global _dracut_conf_d %{_sysconfdir}/dracut.conf.d
+%endif
+
Name: broadcom-wl
Version: 6.30.223.271
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Common files for Broadcom 802.11 STA driver
Group: System Environment/Kernel
License: Redistributable, no modification permitted
-URL:
https://www.broadcom.com/support/?gid=1
-Source0:
https://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223...
-Source1:
https://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_...
-Source2:
https://www.broadcom.com/docs/linux_sta/README_6.30.223.271.txt
+URL:
https://www.broadcom.com/support/download-search/?pf=Wireless+LAN+Infrast...
+Source0:
https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35-no...
+Source1:
https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64...
+Source2:
https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/README_6.30.2...
Source3: broadcom-wl-blacklist.conf
Source4: 20-wl.conf
Source5: api
Source6: fedora.readme
+Source7: com.broadcom.wireless.hybrid.driver.metainfo.xml
+Source8: generate-modalias-metadata.py
BuildArch: noarch
-Provides: wl-kmod-common = %{version}
-Requires: wl-kmod >= %{version}
+Provides: wl-kmod-common = %{?epoch}:%{version}
+Requires: wl-kmod >= %{?epoch}:%{version}
ExcludeArch: ppc ppc64
+%if 0%{?fedora} >= 25
+# AppStream metadata generation
+BuildRequires: python3
+BuildRequires: libappstream-glib >= 0.6.3
+%endif
+
%description
-This package contains the license, README.txt and configuration
-files for the Broadcom 802.11 Linux STA Driver for WiFi, a Linux
-device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-,
-BCM4321-, BCM4322-, BCM43142-, BCM43224-, BCM43225-, BCM43227-,
+This package contains the license, README.txt and configuration
+files for the Broadcom 802.11 Linux STA Driver for WiFi, a Linux
+device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-,
+BCM4321-, BCM4322-, BCM43142-, BCM43224-, BCM43225-, BCM43227-,
BCM43228-, BCM4331-, BCM4360 and -BCM4352- based hardware.
%prep
@@ -38,30 +57,47 @@ chmod 644 lib/LICENSE.txt README_6.30.223.271.txt fedora.readme
echo "Nothing to build."
%install
-rm -rf $RPM_BUILD_ROOT
-install -m 0755 -d ${RPM_BUILD_ROOT}%{_prefix}/lib/modprobe.d/
-install -p -m 0644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_prefix}/lib/modprobe.d/
-install -m 0755 -d ${RPM_BUILD_ROOT}%{_sysconfdir}/dracut.conf.d/
-install -p -m 0644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/dracut.conf.d/
-install -m 0755 -d ${RPM_BUILD_ROOT}%{_sysconfdir}/akmods/akmod-wl/
-install -p -m 0644 %{SOURCE5} ${RPM_BUILD_ROOT}%{_sysconfdir}/akmods/akmod-wl/
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+install -m 0755 -d %{buildroot}%{_modprobe_d}
+install -p -m 0644 %{SOURCE3} %{buildroot}%{_modprobe_d}/
+install -m 0755 -d %{buildroot}%{_dracut_conf_d}
+install -p -m 0644 %{SOURCE4} %{buildroot}%{_dracut_conf_d}/
+install -m 0755 -d %{buildroot}%{_sysconfdir}/akmods/akmod-wl/
+install -p -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/akmods/akmod-wl/
+%if 0%{?fedora} >= 25
+# install AppData and add modalias provides
+install -m 0755 -d %{buildroot}%{_datadir}/appdata/
+install -p -m 0644 %{SOURCE7} %{buildroot}%{_datadir}/appdata/
+fn=%{buildroot}%{_datadir}/appdata/com.broadcom.wireless.hybrid.driver.metainfo.xml
+# As appstream-util deletes all comments in the metainfo.xml file, the
+# copyright must be saved and re-written to the resulting file.
+copyright_string=$(grep Copyright ${fn})
+python3 %{SOURCE8} README_6.30.223.271.txt "SUPPORTED DEVICES" | xargs
appstream-util add-provide ${fn} modalias
+grep -q Copyright ${fn} >/dev/null || sed -i
"s%\(^<?xml.*$\)%\1\n${copyright_string}%" ${fn}
+%endif
%files
-%defattr(-,root,root,-)
%doc README_6.30.223.271.txt fedora.readme
-%if 0%{?rhel} || 0%{?fedora} < 21
-%doc lib/LICENSE.txt
-%else
+# Caution - testing rhel or fedora value with < or <= operators is risky,
+# while using > or >= operators seems to give the right result.
+# See 07/03/2017 update on
http://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/
+%if 0%{?rhel} > 6 || 0%{?fedora} > 20
%license lib/LICENSE.txt
+%else
+%doc lib/LICENSE.txt
%endif
-%config(noreplace) %{_prefix}/lib/modprobe.d/broadcom-wl-blacklist.conf
-%config(noreplace) %{_sysconfdir}/dracut.conf.d/20-wl.conf
+%if 0%{?fedora} >= 25
+%{_datadir}/appdata/com.broadcom.wireless.hybrid.driver.metainfo.xml
+%endif
+%config(noreplace) %{_modprobe_d}/broadcom-wl-blacklist.conf
+%config(noreplace) %{_dracut_conf_d}/20-wl.conf
%config(noreplace) %{_sysconfdir}/akmods/akmod-wl/api
%changelog
+* Wed Apr 18 2018 Nicolas Viéville <nicolas.vieville(a)univ-valenciennes.fr> -
6.30.223.271-5
+- Added AppStream Metadata
+- Update new Broadcom upstream URLs in SPEC file
+- Cleanup and rework SPEC file for RHEL 6.x and 7.x
+
* Fri Mar 02 2018 RPM Fusion Release Engineering <leigh123linux(a)googlemail.com> -
6.30.223.271-4
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
diff --git a/com.broadcom.wireless.hybrid.driver.metainfo.xml
b/com.broadcom.wireless.hybrid.driver.metainfo.xml
new file mode 100644
index 0000000..7c0b347
--- /dev/null
+++ b/com.broadcom.wireless.hybrid.driver.metainfo.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2018 Nicolas Viéville <nicolas.vieville(a)univ-valenciennes.fr>
-->
+<component type="driver">
+ <id>com.broadcom.wireless.hybrid.driver</id>
+ <name>Broadcom STA wireless driver</name>
+ <summary>Broadcom proprietary hybrid wireless drivers for certain Broadcom
wireless devices</summary>
+ <description>
+ <p>
+ Broadcom's IEEE 802.11a/b/g/n hybrid Linux device drivers for use
+ with Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-,
+ BCM43142-, BCM43224-, BCM43225-, BCM43227-, BCM43228-, BCM4331-,
+ BCM4360 and -BCM4352- based hardware.
+ </p>
+ </description>
+ <translation/>
+ <url
type="homepage">https://www.broadcom.com/support/download-se...
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>LicenseRef-proprietary:Broadcom</project_license>
+ <developer_name>Broadcom Incorporation</developer_name>
+ <keywords>
+ <keyword>Broadcom</keyword>
+ <keyword>driver</keyword>
+ <keyword>Wireless</keyword>
+ <keyword>hybrid</keyword>
+ <keyword>STA</keyword>
+ </keywords>
+ <url type="bugtracker">https://bugzilla.rpmfusion.org</url>
+ <update_contact>broadcom-wl-owner(a)rpmfusion.org</update_contact>
+ <provides>
+ <!-- Auto-generated by generate-modalias-metadata.py -->
+ <!-- <modalias>pci:v000014e4d*sv*sd*bc02sc80i*</modalias> -->
+ <!-- <modalias>pci:v000014e4d00004311sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004312sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004313sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004315sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004328sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004329sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d0000432asv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d0000432bsv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d0000432csv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d0000432dsv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004331sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004353sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004357sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004358sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004359sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004365sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d000043a0sv*sd*bc02sc80i*</modalias>
-->
+ <!-- <modalias>pci:v000014e4d00004727sv*sd*bc02sc80i*</modalias>
-->
+ </provides>
+</component>
diff --git a/generate-modalias-metadata.py b/generate-modalias-metadata.py
new file mode 100644
index 0000000..16b1f93
--- /dev/null
+++ b/generate-modalias-metadata.py
@@ -0,0 +1,74 @@
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2016 Richard Hughes <richard(a)hughsie.com>
+# Licensed under the GNU General Public License Version or later
+#
+# Modified to parse broadcom-wl README_6.30.223.271.txt and for python3
+# Copyright (C) 2018 Nicolas Viéville <nicolas.vieville(a)univ-valenciennes.fr>
+# Usage example:
+# python3 generate-modalias-metadata.py README_6.30.223.271.txt "SUPPORTED
DEVICES" | \
+# xargs appstream-util add-provide
com.broadcom.driver.wireless.hybrid.test.metainfo.xml
+
+from __future__ import print_function
+import sys
+
+def main():
+ if len(sys.argv) != 3:
+ print("usage: %s README_FILE.txt \"header to match\"" %
sys.argv[0])
+ return 1
+
+ # open file
+ f = open(sys.argv[1])
+ in_section = False
+ in_table = False
+ pids = []
+ for line in f.readlines():
+
+ # find the right data table
+ if line.find(sys.argv[2]) != -1:
+ in_section = True
+ continue
+ if not in_section:
+ continue
+
+ # remove Windows and Linux line endings
+ line = line.replace('\r', '')
+ line = line.replace('\n', '')
+
+ # end of table
+ if len(line) > 0 and not line.startswith(' '):
+ in_table = False
+ continue
+
+ # empty line
+ if len(line) == 0:
+ continue
+
+ # skip the header
+ if line.startswith(' -----'):
+ in_table = True
+ continue
+ if not in_table:
+ continue
+
+ # end of section
+ if len(line) > 0 and not line.startswith(' '):
+ in_section = False
+ in_table = False
+ continue
+
+ if line.find('0x14e4') != -1:
+ # get name
+ pid = int((line.split("0x14e4",1)[1]).split()[0], 16)
+ if not pid in pids:
+ pids.append(pid)
+
+ # output
+ vid = 0x14e4
+ print("pci:v%08xd*sv*sd*bc02sc80i*" % (vid))
+ for pid in pids:
+ print("pci:v%08xd%08xsv*sd*bc02sc80i*" % (vid, pid))
+
+if __name__ == "__main__":
+ main()
diff --git a/sources b/sources
index 4c58ee8..d764dc2 100644
--- a/sources
+++ b/sources
@@ -1,4 +1,4 @@
115903050c41d466161784d4c843f4f9 hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
4e75f4cb7d87f690f9659ffc478495f0 hybrid-v35-nodebug-pcoem-6_30_223_271.tar.gz
3f3fd4d541bb11f12aaf7b3e1dd7ec71 broadcom-wl-blacklist.conf
-458ea8d99c83769d4acf98137f0d46bb README_6.30.223.271.txt
+e3dab6d9dea12b6487ccf24d012e0350 README_6.30.223.271.txt