2015-05-29 17:35:44 +02:00
|
|
|
# Template file for 'crda'
|
|
|
|
pkgname=crda
|
|
|
|
version=3.18
|
2015-06-03 19:54:33 +02:00
|
|
|
revision=3
|
2015-05-29 17:35:44 +02:00
|
|
|
_dbname=wireless-regdb
|
|
|
|
_dbversion=2015.01.30
|
|
|
|
_dbsrc="${XBPS_BUILDDIR}/${_dbname}-${_dbversion}/"
|
2016-03-22 10:39:45 +01:00
|
|
|
hostmakedepends="libressl python python-M2Crypto pkg-config"
|
2015-05-29 17:35:44 +02:00
|
|
|
makedepends="libnl-devel libgcrypt-devel"
|
|
|
|
depends="iw"
|
|
|
|
short_desc="Central Regulatory Domain Agent for wireless networks"
|
|
|
|
maintainer="Andrea Brancaleoni <miwaxe@gmail.com>"
|
|
|
|
license="ISC"
|
|
|
|
homepage="http://wireless.kernel.org/en/developers/Regulatory/CRDA"
|
|
|
|
distfiles="https://kernel.org/pub/software/network/crda/${pkgname}-${version}.tar.xz https://www.kernel.org/pub/software/network/wireless-regdb/${_dbname}-${_dbversion}.tar.xz"
|
|
|
|
checksum="43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf 438d7f3d62686bc997098d17fe1aff95c6f6ec061aaab90ab7c2c17e8451ce85"
|
2015-06-03 19:54:00 +02:00
|
|
|
conf_files="/etc/wireless-regdom.conf"
|
2015-05-29 17:35:44 +02:00
|
|
|
|
|
|
|
build_options="wardrive"
|
|
|
|
desc_option_wardrive="Disable CRDA checks for wardriving competitions"
|
|
|
|
|
|
|
|
post_extract() {
|
|
|
|
if [ "$build_option_wardrive" ]; then
|
2015-06-03 02:17:29 +02:00
|
|
|
sed -i 's/([0-9][0-9])/(33)/g' ${_dbsrc}/db.txt # Max 2W =~ 33dBm
|
2015-05-29 17:35:44 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
|
|
|
cd ${_dbsrc}
|
|
|
|
make
|
|
|
|
cp *.pem ${wrksrc}/pubkeys
|
|
|
|
|
|
|
|
cd ${wrksrc}
|
|
|
|
|
|
|
|
make CC="$CC" all_noverify
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2015-06-03 19:44:37 +02:00
|
|
|
make DESTDIR="${DESTDIR}" SBINDIR="/usr/bin/" UDEV_RULE_DIR="/usr/lib/udev/rules.d/" install
|
2015-05-29 17:35:44 +02:00
|
|
|
vlicense LICENSE
|
|
|
|
|
|
|
|
cd ${_dbsrc}
|
|
|
|
vmkdir usr/lib/crda/
|
|
|
|
vinstall regulatory.bin 644 usr/lib/crda/
|
|
|
|
vmkdir etc/conf.d/
|
|
|
|
for dom in $(grep ^country db.txt | cut -d' ' -f2 | sed 's|:||g'); do
|
|
|
|
echo "#WIRELESS_REGDOM=\"${dom}\"" >> ${DESTDIR}/etc/wireless-regdom.tmp
|
|
|
|
done
|
2015-06-03 19:54:00 +02:00
|
|
|
sort -u ${DESTDIR}/etc/wireless-regdom.tmp >> ${DESTDIR}/etc/wireless-regdom.conf
|
2015-05-29 17:35:44 +02:00
|
|
|
rm ${DESTDIR}/etc/wireless-regdom.tmp
|
|
|
|
|
|
|
|
vbin ${FILESDIR}/set-wireless-regdom
|
|
|
|
echo 'ACTION=="add" SUBSYSTEM=="module", DEVPATH=="/module/cfg80211", RUN+="/usr/bin/set-wireless-regdom"' >> ${DESTDIR}/usr/lib/udev/rules.d/85-regulatory.rules
|
|
|
|
|
|
|
|
find ${DESTDIR} -type f -name \*.h -delete # No need for devel files, no package i know uses libreg.so
|
|
|
|
}
|