summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorthomas2009-03-29 13:37:27 +0000
committerPetko Bordjukov2015-06-09 13:47:54 +0300
commite3d10dd59ef0fbae822a236aebe284c4b3098275 (patch)
treeeff89dc192007440b934ef769710fd52c7bfbd85
parent6fac5cfe750c0c3ce70c305a34604a1c39b8c994 (diff)
downloadaur-e3d10dd59ef0fbae822a236aebe284c4b3098275.tar.gz
- Split crda into crda and wireless-regdb (as it is done by all other distros that already include it)
The regdb will probably be updated more often than crda - If crda is installed, the integrity of the regdb is now verified on build and install time (if not, a warning is issued on build time, and nothing happens on install time) A warning is issued if the database is corrupted. - The file /etc/conf.d/wireless-regdom moved from crda to wireless-regdb. If the user has already set the domain there, the .pacorig file overwrites the one from wireless-regdb This is safe, as the only changes that may be in the stock file are newly added domains, which are commented - It is not necessary to add wireless-regdom to DAEMONS any more. As soon as cfg80211 is loaded, the regdom is set (if one is specified in /etc/conf.d/wireless-regdom) This is not only more convenient, but also ensures the regdom is still set after rmmod cfg80211; modprobe cfg80211 git-svn-id: file:///srv/repos/svn-packages/svn@32167 eb2447ed-0c53-47e4-bac8-5bc4a241df78
-rw-r--r--PKGBUILD43
-rw-r--r--crda.conf.d4
-rw-r--r--crda.install16
3 files changed, 29 insertions, 34 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 4c6abd97f1dc..58a068040abc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,48 +3,31 @@
pkgname=crda
pkgver=1.0.1
-_regdbver=2009.01.30
-pkgrel=1
+pkgrel=2
pkgdesc="Central Regulatory Domain Agent"
arch=(i686 x86_64)
url="http://wireless.kernel.org/en/developers/Regulatory/CRDA"
license=('custom')
-depends=('libnl' 'libgcrypt' 'udev' 'iw')
+depends=('wireless-regdb' 'libnl' 'libgcrypt' 'udev' 'iw')
makedepends=('python-m2crypto')
-source=(http://wireless.kernel.org/download/crda/$pkgname-$pkgver.tar.bz2
- http://wireless.kernel.org/download/wireless-regdb/regulatory.bins/${_regdbver}-regulatory.bin
- crda.rc
- crda.conf.d)
-backup=(etc/conf.d/wireless-regdom)
+install=crda.install
+source=(http://wireless.kernel.org/download/crda/${pkgname}-${pkgver}.tar.bz2
+ crda.rc)
md5sums=('03554b71eef2626795befa17eb1d8b9e'
- '2515a1d6ba52f5acef255cf702a6c77d'
- '014eef3f8655e9a130064ec6891317fc'
- '2374dcf1c6530332f375e5362b80169b')
+ '014eef3f8655e9a130064ec6891317fc')
build() {
# Install crda, regdbdump and udev rules
msg "Compiling and installing crda ..."
- cd $srcdir/$pkgname-$pkgver
+ cd ${srcdir}/${pkgname}-${pkgver}
make crda regdbdump || return 1
- make DESTDIR=$pkgdir install || return 1
+ make DESTDIR=${pkgdir} install || return 1
+ # This rule automatically sets the regulatory domain when cfg80211 is loaded
+ echo 'ACTION=="add" SUBSYSTEM=="module", DEVPATH=="/module/cfg80211", RUN+="/etc/rc.d/wireless-regdom start >/dev/null"' >> ${pkgdir}/lib/udev/rules.d/85-regulatory.rules || return 1
- # Install and verify regulatory.bin file
- msg "Installing and verifying the regulatory.bin file ..."
- install -D -m444 $srcdir/${_regdbver}-regulatory.bin $pkgdir/usr/lib/crda/regulatory.bin || return 1
- if $pkgdir/sbin/regdbdump $pkgdir/usr/lib/crda/regulatory.bin > /dev/null; then
- msg "Regulatory database verification was succesful."
- else
- error "Regulatory database verification failed."
- return 1
- fi
-
msg "Installing license ..."
- install -D -m644 $srcdir/$pkgname-$pkgver/LICENSE $pkgdir/usr/share/licenses/crda/LICENSE || return 1
+ install -D -m644 ${srcdir}/${pkgname}-${pkgver}/LICENSE ${pkgdir}/usr/share/licenses/crda/LICENSE || return 1
- msg "Installing boot scripts ..."
- install -D -m755 $srcdir/crda.rc $pkgdir/etc/rc.d/wireless-regdom || return 1
- install -D -m644 $srcdir/crda.conf.d $pkgdir/etc/conf.d/wireless-regdom || return 1
- for dom in $($pkgdir/sbin/regdbdump $pkgdir/usr/lib/crda/regulatory.bin | grep ^country | cut -d' ' -f2 | sed 's|:||g'); do
- echo "#WIRELESS_REGDOM=\"${dom}\"" >> $pkgdir/etc/conf.d/wireless-regdom || return 1
- done
+ msg "Installing boot script ..."
+ install -D -m755 ${srcdir}/crda.rc ${pkgdir}/etc/rc.d/wireless-regdom || return 1
}
diff --git a/crda.conf.d b/crda.conf.d
deleted file mode 100644
index 8511238b967d..000000000000
--- a/crda.conf.d
+++ /dev/null
@@ -1,4 +0,0 @@
-#
-# Wireless regulatory domain configuration
-#
-
diff --git a/crda.install b/crda.install
new file mode 100644
index 000000000000..e64e401a956c
--- /dev/null
+++ b/crda.install
@@ -0,0 +1,16 @@
+## arg 1: the new package version
+post_install() {
+ echo "Uncomment the right regulatory domain in /etc/conf.d/wireless-regdom."
+ echo "It will automatically be set when necessary."
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ # In an upgrade from 1.0.1-1 or older, the wireless-regdom file moves from the crda package
+ # to the new wireless-regdb package. If the user changed the file, it is save to overwrite the one
+ # from wireless-regdb by the user-defined one
+ if [ $(vercmp $2 1.0.1-2) -lt 0 -a -f /etc/conf.d/wireless-regdom.pacorig -a -n "$(grep -v ^# /etc/conf.d/wireless-regdom.pacorig | grep -v ^$)" ]; then
+ mv /etc/conf.d/wireless-regdom.pacorig /etc/conf.d/wireless-regdom
+ fi
+}