From 39af35d87f2407b23fd48ea2b453cf5bf8f6c4cd Mon Sep 17 00:00:00 2001 From: John W. Linville Date: Feb 14 2014 21:06:56 +0000 Subject: Update crda to version 3.13 - Remove obsolete patch for regdbdump to display DFS region - Add patch to use DESTDIR rule for crda libreg installation - Add patch to avoid calling ldconfig from crda Makefile - Remove PREFIX='' lines from make commands - Use SBINDIR and LIBDIR definitions in make commands --- diff --git a/.gitignore b/.gitignore index 4e70d0a..959387c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/crda-1.1.3.tar.bz2 -/wireless-regdb-2013.11.27.tar.bz2 +/crda-3.13.tar.xz +/wireless-regdb-2013.11.27.tar.xz diff --git a/crda-Add-DESTDIR-support-in-install-libreg-rules-in-.patch b/crda-Add-DESTDIR-support-in-install-libreg-rules-in-.patch new file mode 100644 index 0000000..32f1e7d --- /dev/null +++ b/crda-Add-DESTDIR-support-in-install-libreg-rules-in-.patch @@ -0,0 +1,36 @@ +From 79f5cb8d130a635e0ee3eeb6a061a31d6bd7286e Mon Sep 17 00:00:00 2001 +From: "John W. Linville" +Date: Fri, 14 Feb 2014 13:39:14 -0500 +Subject: [PATCH] crda: Add DESTDIR support in install-libreg* rules in + Makefile + +Signed-off-by: John W. Linville +--- + Makefile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 4a351c645bf4..807a53819453 100644 +--- a/Makefile ++++ b/Makefile +@@ -119,13 +119,13 @@ $(LIBREG): regdb.h reglib.h reglib.c + + install-libreg-headers: + $(NQ) ' INSTALL libreg-headers' +- $(Q)mkdir -p $(INCLUDE_DIR) +- $(Q)cp *.h $(INCLUDE_DIR)/ ++ $(Q)mkdir -p $(DESTDIR)/$(INCLUDE_DIR) ++ $(Q)cp *.h $(DESTDIR)/$(INCLUDE_DIR)/ + + install-libreg: + $(NQ) ' INSTALL libreg' +- $(Q)mkdir -p $(LIBDIR) +- $(Q)cp $(LIBREG) $(LIBDIR)/ ++ $(Q)mkdir -p $(DESTDIR)/$(LIBDIR) ++ $(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/ + $(Q)ldconfig + + %.o: %.c regdb.h $(LIBREG) +-- +1.8.5.3 + diff --git a/crda-display-DFS-regulatory-domain-in-regdbdump.patch b/crda-display-DFS-regulatory-domain-in-regdbdump.patch deleted file mode 100644 index 3ef85c2..0000000 --- a/crda-display-DFS-regulatory-domain-in-regdbdump.patch +++ /dev/null @@ -1,51 +0,0 @@ -From d169aaf0290c2a6f8b38769e22ced4d3850da7a9 Mon Sep 17 00:00:00 2001 -From: Zefir Kurtisi -Date: Wed, 3 Apr 2013 15:51:58 +0200 -Subject: [PATCH] crda: display DFS regulatory domain in regdbdump - -Signed-off-by: Zefir Kurtisi -Signed-off-by: Luis R. Rodriguez ---- - print-regdom.c | 19 ++++++++++++++++++- - 1 file changed, 18 insertions(+), 1 deletion(-) - -diff --git a/print-regdom.c b/print-regdom.c -index 075eea890579..9c65872d4775 100644 ---- a/print-regdom.c -+++ b/print-regdom.c -@@ -7,6 +7,22 @@ - - #include "reglib.h" - -+static const char *dfs_domain_name(enum nl80211_dfs_regions region) -+{ -+ switch (region) { -+ case NL80211_DFS_UNSET: -+ return "DFS-UNSET"; -+ case NL80211_DFS_FCC: -+ return "DFS-FCC"; -+ case NL80211_DFS_ETSI: -+ return "DFS-ETSI"; -+ case NL80211_DFS_JP: -+ return "DFS-JP"; -+ default: -+ return "DFS-invalid"; -+ } -+} -+ - static void print_reg_rule(struct ieee80211_reg_rule *rule) - { - struct ieee80211_freq_range *freq; -@@ -57,7 +73,8 @@ static void print_reg_rule(struct ieee80211_reg_rule *rule) - void print_regdom(struct ieee80211_regdomain *rd) - { - unsigned int i; -- printf("country %.2s:\n", rd->alpha2); -+ printf("country %.2s: %s\n", rd->alpha2, -+ dfs_domain_name(rd->dfs_region)); - for (i = 0; i < rd->n_reg_rules; i++) - print_reg_rule(&rd->reg_rules[i]); - printf("\n"); --- -1.8.1.4 - diff --git a/crda-remove-ldconfig.patch b/crda-remove-ldconfig.patch new file mode 100644 index 0000000..b9ba785 --- /dev/null +++ b/crda-remove-ldconfig.patch @@ -0,0 +1,11 @@ +diff -up crda-3.13/Makefile.ldconfig crda-3.13/Makefile +--- crda-3.13/Makefile.ldconfig 2014-02-14 13:47:10.674521882 -0500 ++++ crda-3.13/Makefile 2014-02-14 13:47:14.284552473 -0500 +@@ -126,7 +126,6 @@ install-libreg: + $(NQ) ' INSTALL libreg' + $(Q)mkdir -p $(DESTDIR)/$(LIBDIR) + $(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/ +- $(Q)ldconfig + + %.o: %.c regdb.h $(LIBREG) + $(NQ) ' CC ' $@ diff --git a/crda.spec b/crda.spec index 8e32088..f12b036 100644 --- a/crda.spec +++ b/crda.spec @@ -1,9 +1,9 @@ -%define crda_version 1.1.3 +%define crda_version 3.13 %define regdb_version 2013.11.27 Name: crda Version: %{crda_version}_%{regdb_version} -Release: 3%{?dist} +Release: 1%{?dist} Summary: Regulatory compliance daemon for 802.11 wireless networking Group: System Environment/Base @@ -20,14 +20,17 @@ BuildRequires: openssl Requires: udev, iw Requires: systemd >= 190 -Source0: http://www.kernel.org/pub/software/network/crda/crda-%{crda_version}.tar.bz2 -Source1: http://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-%{regdb_version}.tar.bz2 +Source0: http://www.kernel.org/pub/software/network/crda/crda-%{crda_version}.tar.xz +Source1: http://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-%{regdb_version}.tar.xz Source2: setregdomain Source3: setregdomain.1 # Add udev rule to call setregdomain on wireless device add Patch0: regulatory-rules-setregdomain.patch -Patch1: crda-display-DFS-regulatory-domain-in-regdbdump.patch +# Add DESTDIR in install rules for libreg in crda Makefile +Patch1: crda-Add-DESTDIR-support-in-install-libreg-rules-in-.patch +# Do not call ldconfig in crda Makefile +Patch2: crda-remove-ldconfig.patch %description @@ -37,6 +40,15 @@ for communication. CRDA is intended to be run only through udev communication from the kernel. +%package devel +Summary: Header files for use with libreg. +Group: Development/System + + +%description devel +Header files to make use of libreg for accessing regulatory info. + + %prep %setup -q -c %setup -q -T -D -a 1 @@ -44,8 +56,8 @@ communication from the kernel. %patch0 -p1 -b .setregdomain cd crda-%{crda_version} -%patch1 -p1 -b .display-DFS - +%patch1 -p1 -b .libreg-DESTDIR +%patch2 -p1 -b .ldconfig-remove %build export CFLAGS="%{optflags}" @@ -60,7 +72,8 @@ make %{?_smp_mflags} REGDB_PRIVKEY=key.priv.pem REGDB_PUBKEY=key.pub.pem cd ../crda-%{crda_version} cp ../wireless-regdb-%{regdb_version}/key.pub.pem pubkeys -make %{?_smp_mflags} REG_BIN=../wireless-regdb-%{regdb_version}/regulatory.bin +make %{?_smp_mflags} SBINDIR=%{_sbindir}/ LIBDIR=%{_libdir}/ \ + REG_BIN=../wireless-regdb-%{regdb_version}/regulatory.bin %install @@ -68,28 +81,34 @@ rm -rf %{buildroot} cd crda-%{crda_version} cp README README.crda -make install DESTDIR=%{buildroot} PREFIX='' MANDIR=%{_mandir} +make install DESTDIR=%{buildroot} MANDIR=%{_mandir}/ \ + SBINDIR=%{_sbindir}/ LIBDIR=%{_libdir}/ cd ../wireless-regdb-%{regdb_version} cp README README.wireless-regdb -make install DESTDIR=%{buildroot} PREFIX='' MANDIR=%{_mandir} +make install DESTDIR=%{buildroot} MANDIR=%{_mandir} -install -D -pm 0755 %SOURCE2 %{buildroot}/sbin +install -D -pm 0755 %SOURCE2 %{buildroot}%{_sbindir} install -D -pm 0644 %SOURCE3 %{buildroot}%{_mandir}/man1/setregdomain.1 +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + + %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) -/sbin/%{name} -/sbin/regdbdump -/sbin/setregdomain +%{_sbindir}/%{name} +%{_sbindir}/regdbdump +%{_sbindir}/setregdomain +%{_libdir}/libreg.so /lib/udev/rules.d/85-regulatory.rules -# location of database is hardcoded to /lib/%{name} -/lib/%{name} +# location of database is hardcoded to /usr/lib/%{name} +/usr/lib/%{name} %{_mandir}/man1/setregdomain.1* %{_mandir}/man5/regulatory.bin.5* %{_mandir}/man8/crda.8* @@ -98,7 +117,22 @@ rm -rf %{buildroot} %doc wireless-regdb-%{regdb_version}/README.wireless-regdb +%files devel +%{_includedir}/reglib/nl80211.h +%{_includedir}/reglib/regdb.h +%{_includedir}/reglib/reglib.h + + + %changelog +* Fri Feb 14 2014 John W. Linville - 3.13_2013.11.27-1 +- Update crda to version 3.13 +- Remove obsolete patch for regdbdump to display DFS region +- Add patch to use DESTDIR rule for crda libreg installation +- Add patch to avoid calling ldconfig from crda Makefile +- Remove PREFIX='' lines from make commands +- Use SBINDIR and LIBDIR definitions in make commands + * Thu Jan 23 2014 John W. Linville - 1.1.3_2013.11.27-3 - Correct a typo in setregdomain diff --git a/regulatory-rules-setregdomain.patch b/regulatory-rules-setregdomain.patch index 806209e..d9e79ab 100644 --- a/regulatory-rules-setregdomain.patch +++ b/regulatory-rules-setregdomain.patch @@ -1,10 +1,10 @@ -diff -up crda-1.1.3_2013.01.11/crda-1.1.3/udev/regulatory.rules.setregdomain crda-1.1.3_2013.01.11/crda-1.1.3/udev/regulatory.rules ---- crda-1.1.3_2013.01.11/crda-1.1.3/udev/regulatory.rules.setregdomain 2012-01-18 21:19:09.000000000 -0500 -+++ crda-1.1.3_2013.01.11/crda-1.1.3/udev/regulatory.rules 2013-01-25 14:10:57.818931320 -0500 +diff -up crda-3.13_2013.11.27/crda-3.13/udev/regulatory.rules.setregdomain crda-3.13_2013.11.27/crda-3.13/udev/regulatory.rules +--- crda-3.13_2013.11.27/crda-3.13/udev/regulatory.rules.setregdomain 2012-01-18 21:19:09.000000000 -0500 ++++ crda-3.13_2013.11.27/crda-3.13/udev/regulatory.rules 2013-01-25 14:10:57.818931320 -0500 @@ -2,4 +2,6 @@ # For more information see: # http://wireless.kernel.org/en/developers/Regulatory/CRDA -+SUBSYSTEM=="ieee80211", ACTION=="add", RUN+="/sbin/setregdomain" ++SUBSYSTEM=="ieee80211", ACTION=="add", RUN+="/usr/sbin/setregdomain" + KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="$(SBINDIR)crda" diff --git a/setregdomain b/setregdomain index 1e846e6..e8a1ed0 100755 --- a/setregdomain +++ b/setregdomain @@ -35,7 +35,7 @@ then . $REGDOMAIN if [ -n "$COUNTRY" ] then - /sbin/iw reg set $COUNTRY + /usr/sbin/iw reg set $COUNTRY exit fi fi @@ -63,4 +63,4 @@ then exit fi -/sbin/iw reg set $COUNTRY +/usr/sbin/iw reg set $COUNTRY diff --git a/sources b/sources index 846d9eb..eb69346 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -29579185e06a75675507527243d28e5c crda-1.1.3.tar.bz2 -43169247d6bc7ebe16dce6757bffb788 wireless-regdb-2013.11.27.tar.bz2 +66b1b0417c1ad19f0009a5c0c0c1aebc crda-3.13.tar.xz +5d00474713f4d3d287b0ca19860a83e8 wireless-regdb-2013.11.27.tar.xz