commit
a18c7769da
5
srcpkgs/crda/files/set-wireless-regdom
Normal file
5
srcpkgs/crda/files/set-wireless-regdom
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
unset WIRELESS_REGDOM
|
||||
. /etc/wireless-regdom
|
||||
[ -n "${WIRELESS_REGDOM}" ] && iw reg set ${WIRELESS_REGDOM}
|
57
srcpkgs/crda/template
Normal file
57
srcpkgs/crda/template
Normal file
@ -0,0 +1,57 @@
|
||||
# Template file for 'crda'
|
||||
pkgname=crda
|
||||
version=3.18
|
||||
_dbname=wireless-regdb
|
||||
_dbversion=2015.01.30
|
||||
_dbsrc="${XBPS_BUILDDIR}/${_dbname}-${_dbversion}/"
|
||||
revision=1
|
||||
hostmakedepends="libressl-openssl python python-M2Crypto pkg-config"
|
||||
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"
|
||||
conf_files="/etc/wireless-regdom"
|
||||
|
||||
build_options="wardrive"
|
||||
desc_option_wardrive="Disable CRDA checks for wardriving competitions"
|
||||
|
||||
|
||||
post_extract() {
|
||||
if [ "$build_option_wardrive" ]; then
|
||||
sed -i 's/([0-9][0-9])/(33)/g' db.txt # Max 2W =~ 33dBm
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
cd ${_dbsrc}
|
||||
make
|
||||
cp *.pem ${wrksrc}/pubkeys
|
||||
|
||||
cd ${wrksrc}
|
||||
|
||||
make CC="$CC" all_noverify
|
||||
}
|
||||
|
||||
do_install() {
|
||||
make DESTDIR="${DESTDIR}" SBINDIR="/usr/bin" UDEV_RULE_DIR="/usr/lib/udev/rules.d/" install
|
||||
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
|
||||
sort -u ${DESTDIR}/etc/wireless-regdom.tmp >> ${DESTDIR}/etc/wireless-regdom
|
||||
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
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
From 803188070e486030cb1d2e53692b39305c742b17 Mon Sep 17 00:00:00 2001
|
||||
From: Joe Julian <jjulian@io.com>
|
||||
Date: Tue, 19 May 2015 23:54:08 -0700
|
||||
Subject: [PATCH] Use swig generated python loader
|
||||
|
||||
---
|
||||
.gitignore | 6 +++++-
|
||||
M2Crypto/__init__.py | 4 ++--
|
||||
M2Crypto/m2.py | 4 +---
|
||||
SWIG/_m2crypto.def | 2 +-
|
||||
SWIG/_m2crypto.i | 2 +-
|
||||
setup.py | 25 +++++++++++++++++++++----
|
||||
6 files changed, 31 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/M2Crypto/__init__.py b/M2Crypto/__init__.py
|
||||
index 647e057..38dbbd5 100644
|
||||
--- a/M2Crypto/__init__.py
|
||||
+++ b/M2Crypto/__init__.py
|
||||
@@ -19,7 +19,7 @@ Copyright 2008-2011 Heikki Toivonen. All rights reserved.
|
||||
version_info = (0, 22)
|
||||
version = '.'.join([str(_v) for _v in version_info])
|
||||
|
||||
-import __m2crypto
|
||||
+import m2crypto
|
||||
import m2
|
||||
import ASN1
|
||||
import AuthCookie
|
||||
@@ -47,4 +47,4 @@ import m2xmlrpclib
|
||||
import threading
|
||||
import util
|
||||
|
||||
-__m2crypto.lib_init()
|
||||
+m2crypto.lib_init()
|
||||
diff --git a/M2Crypto/m2.py b/M2Crypto/m2.py
|
||||
index e4bb695..516cadb 100644
|
||||
--- a/M2Crypto/m2.py
|
||||
+++ b/M2Crypto/m2.py
|
||||
@@ -25,7 +25,5 @@ Portions created by Open Source Applications Foundation (OSAF) are
|
||||
Copyright (C) 2004 OSAF. All Rights Reserved.
|
||||
"""
|
||||
|
||||
-from __m2crypto import *
|
||||
+from m2crypto import *
|
||||
lib_init()
|
||||
-
|
||||
-
|
||||
diff --git a/SWIG/_m2crypto.def b/SWIG/_m2crypto.def
|
||||
index 753db2c..3e9d5bc 100644
|
||||
--- a/SWIG/_m2crypto.def
|
||||
+++ b/SWIG/_m2crypto.def
|
||||
@@ -1,2 +1,2 @@
|
||||
EXPORTS
|
||||
-init__m2crypto
|
||||
+init_m2crypto
|
||||
diff --git a/SWIG/_m2crypto.i b/SWIG/_m2crypto.i
|
||||
index 50be5c3..e491222 100644
|
||||
--- a/SWIG/_m2crypto.i
|
||||
+++ b/SWIG/_m2crypto.i
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
-%module(threads=1) _m2crypto
|
||||
+%module(threads=1) m2crypto
|
||||
/* We really don't need threadblock (PyGILState_Ensure() etc.) anywhere.
|
||||
Disable threadallow as well, only enable it for operations likely to
|
||||
block. */
|
||||
diff --git a/setup.py b/setup.py
|
||||
index bac6f9f..fc89513 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -17,9 +17,22 @@ import os, sys, platform
|
||||
from setuptools import setup
|
||||
from setuptools.command import build_ext
|
||||
|
||||
+from distutils.util import get_platform
|
||||
from distutils.core import Extension
|
||||
from distutils.spawn import find_executable
|
||||
|
||||
+from distutils.command.build import build
|
||||
+from setuptools.command.install import install
|
||||
+
|
||||
+class CustomBuild(build):
|
||||
+ def run(self):
|
||||
+ self.run_command('build_ext')
|
||||
+ build.run(self)
|
||||
+
|
||||
+class CustomInstall(install):
|
||||
+ def run(self):
|
||||
+ self.run_command('build_ext')
|
||||
+ self.do_egg_install()
|
||||
|
||||
class _M2CryptoBuildExt(build_ext.build_ext):
|
||||
'''Specialization of build_ext to enable swig_opts to inherit any
|
||||
@@ -70,11 +83,12 @@ class _M2CryptoBuildExt(build_ext.build_ext):
|
||||
|
||||
self.add_multiarch_paths()
|
||||
|
||||
- opensslIncludeDir = os.path.join(self.openssl, 'include')
|
||||
+ includeDir = os.path.join(self.openssl, 'include')
|
||||
+ opensslIncludeDir = os.path.join(self.openssl, 'include', 'openssl')
|
||||
opensslLibraryDir = os.path.join(self.openssl, 'lib')
|
||||
|
||||
self.swig_opts = ['-I%s' % i for i in self.include_dirs + \
|
||||
- [opensslIncludeDir, os.path.join(opensslIncludeDir, "openssl")]]
|
||||
+ [opensslIncludeDir, includeDir]]
|
||||
self.swig_opts.append('-includeall')
|
||||
self.swig_opts.append('-modern')
|
||||
|
||||
@@ -85,6 +99,9 @@ class _M2CryptoBuildExt(build_ext.build_ext):
|
||||
elif platform.architecture()[0] == '32bit':
|
||||
self.swig_opts.append('-D__i386__')
|
||||
|
||||
+ self.swig_opts.append('-outdir')
|
||||
+ self.swig_opts.append(os.path.join(os.getcwd(),'M2Crypto'))
|
||||
+
|
||||
self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir),
|
||||
os.path.join(os.getcwd(), 'SWIG')]
|
||||
|
||||
@@ -103,7 +120,7 @@ if sys.platform == 'darwin':
|
||||
else:
|
||||
my_extra_compile_args = []
|
||||
|
||||
-m2crypto = Extension(name = 'M2Crypto.__m2crypto',
|
||||
+m2crypto = Extension(name = 'M2Crypto._m2crypto',
|
||||
sources = ['SWIG/_m2crypto.i'],
|
||||
extra_compile_args = ['-DTHREADING'] + my_extra_compile_args,
|
||||
#extra_link_args = ['-Wl,-search_paths_first'], # Uncomment to build Universal Mac binaries
|
||||
@@ -145,5 +162,5 @@ interface.''',
|
||||
|
||||
ext_modules = [m2crypto],
|
||||
test_suite='tests.alltests.suite',
|
||||
- cmdclass = {'build_ext': _M2CryptoBuildExt}
|
||||
+ cmdclass = {'build': CustomBuild, 'install': CustomInstall, 'build_ext': _M2CryptoBuildExt}
|
||||
)
|
||||
--
|
||||
2.4.1
|
||||
|
@ -0,0 +1,23 @@
|
||||
From 2353ea9bd2aadea66e7b31707ed1f9a971f2d4a3 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Gilbert <floppym@gentoo.org>
|
||||
Date: Wed, 27 May 2015 14:09:17 -0400
|
||||
Subject: [PATCH] setup.py: Fix custom install class to not force an egg
|
||||
install
|
||||
|
||||
---
|
||||
setup.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 0967216..ff82e7c 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -33,7 +33,7 @@ def run(self):
|
||||
class CustomInstall(install):
|
||||
def run(self):
|
||||
self.run_command('build_ext')
|
||||
- self.do_egg_install()
|
||||
+ install.run(self)
|
||||
|
||||
class _M2CryptoBuildExt(build_ext.build_ext):
|
||||
'''Specialization of build_ext to enable swig_opts to inherit any
|
18
srcpkgs/python-M2Crypto/template
Normal file
18
srcpkgs/python-M2Crypto/template
Normal file
@ -0,0 +1,18 @@
|
||||
# Template file for 'python-M2Crypto'
|
||||
_mname=M2Crypto
|
||||
pkgname="python-${_mname}"
|
||||
version=0.22.3
|
||||
revision=1
|
||||
wrksrc="${_mname}-${version}"
|
||||
build_style=python-module
|
||||
pycompile_module="${_mname}"
|
||||
hostmakedepends="python python-setuptools swig"
|
||||
makedepends="libressl-devel python-devel"
|
||||
short_desc="OpenSSL for Python"
|
||||
maintainer="Andrea Brancaleoni <miwaxe@gmail.com>"
|
||||
license="GPL-3"
|
||||
homepage="https://github.com/M2Crypto/M2Crypto"
|
||||
distfiles="${PYPI_SITE}/M/${_mname}/${_mname}-${version}.tar.gz"
|
||||
checksum=6071bfc817d94723e9b458a010d565365104f84aa73f7fe11919871f7562ff72
|
||||
patch_args="-Np1"
|
||||
nocross=yes
|
Loading…
x
Reference in New Issue
Block a user