diff mbox series

package/python-wpaspy: add python-wpaspy

Message ID 20210412151341.50721-1-matthew.weber@rockwellcollins.com
State Changes Requested
Headers show
Series package/python-wpaspy: add python-wpaspy | expand

Commit Message

Matt Weber April 12, 2021, 3:13 p.m. UTC
From: Jared Bents <jared.bents@rockwellcollins.com>

Update to add python-wpaspy. It is a package that includes
python bindings for wpa_ctrl.

Signed-off-by: Jared Bents <jared.bents@rockwellcollins.com>
Signed-off-by: Kalpesh Panchal <kalpesh.panchal@rockwellcollins.com>
Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>
---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...spy-update-setup.py-to-use-wpaspy.py.patch | 45 +++++++++++++++++++
 package/python-wpaspy/Config.in               |  6 +++
 package/python-wpaspy/python-wpaspy.hash      |  3 ++
 package/python-wpaspy/python-wpaspy.mk        | 17 +++++++
 6 files changed, 73 insertions(+)
 create mode 100644 package/python-wpaspy/0001-wpaspy-update-setup.py-to-use-wpaspy.py.patch
 create mode 100644 package/python-wpaspy/Config.in
 create mode 100644 package/python-wpaspy/python-wpaspy.hash
 create mode 100644 package/python-wpaspy/python-wpaspy.mk

Comments

Thomas Petazzoni April 21, 2021, 9:12 p.m. UTC | #1
Hello Matt,

On Mon, 12 Apr 2021 10:13:41 -0500
Matt Weber <matthew.weber@rockwellcollins.com> wrote:

> From: Jared Bents <jared.bents@rockwellcollins.com>
> 
> Update to add python-wpaspy. It is a package that includes
> python bindings for wpa_ctrl.
> 
> Signed-off-by: Jared Bents <jared.bents@rockwellcollins.com>
> Signed-off-by: Kalpesh Panchal <kalpesh.panchal@rockwellcollins.com>
> Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>

Thanks for the patch. Minor nit, commit title should be
"package/python-wpaspy: new package". Of course, I have more
comments/questions below.


> diff --git a/package/python-wpaspy/0001-wpaspy-update-setup.py-to-use-wpaspy.py.patch b/package/python-wpaspy/0001-wpaspy-update-setup.py-to-use-wpaspy.py.patch
> new file mode 100644
> index 0000000000..bfa6e9609a
> --- /dev/null
> +++ b/package/python-wpaspy/0001-wpaspy-update-setup.py-to-use-wpaspy.py.patch
> @@ -0,0 +1,45 @@
> +From b25579dd576ef125741fc72bd39239cb7e60a1e5 Mon Sep 17 00:00:00 2001
> +From: Jared Bents <jared.bents@rockwellcollins.com>
> +Date: Wed, 1 Apr 2020 10:58:49 -0500
> +Subject: [PATCH] wpaspy: update setup.py to use wpaspy.py
> +
> +update setup.py to use wpaspy.py instead of wpaspy.c due to
> +information from Jouni Malinen in the linked mailing list
> +correspondence

This commit log is very unclear, I don't understand what it means. It
proposes to use a pure-Python implementation, instead of a C-based
Python extension? Why?

The commit log only says *what* it does, but it should say *why* it
does that.

> +http://lists.infradead.org/pipermail/hostap/2020-April/041575.html

This link doesn't exist. There were no posts in April 2020 on this
mailing list it seems.


> diff --git a/package/python-wpaspy/Config.in b/package/python-wpaspy/Config.in
> new file mode 100644
> index 0000000000..a35cefb86c
> --- /dev/null
> +++ b/package/python-wpaspy/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_PYTHON_WPASPY
> +	bool "python-wpaspy"
> +	depends on BR2_PACKAGE_WPA_SUPPLICANT #runtime dependency

Nit:

	depends on BR2_PACKAGE_WPA_SUPPLICANT # runtime

> +	help
> +	  Python bindings for wpa_ctrl
> +	  (wpa_supplicant/hostapd control interface)

An upstream homepage would be nice to have.

> diff --git a/package/python-wpaspy/python-wpaspy.mk b/package/python-wpaspy/python-wpaspy.mk
> new file mode 100644
> index 0000000000..45d12844c6
> --- /dev/null
> +++ b/package/python-wpaspy/python-wpaspy.mk
> @@ -0,0 +1,17 @@
> +################################################################################
> +#
> +# python-wpaspy
> +#
> +################################################################################
> +
> +PYTHON_WPASPY_VERSION = 2_9
> +PYTHON_WPASPY_SOURCE = hostap_$(PYTHON_WPASPY_VERSION).tar.gz
> +PYTHON_WPASPY_SITE = https://w1.fi/cgit/hostap/snapshot

I was a bit confused by why you are fetching from Git, instead of using
the wpa_supplicant or hostapd tarball. But it seems like the wpaspy
subdir is only available in the Git repository. Is this the reason for
fetching this Git snapshot? If so, it would be good to state it
somewhere, at least in the commit log.

Also, is there a need for this 2.9 version to be in sync between this
and the wpa_supplicant package ?

> +PYTHON_WPASPY_SUBDIR = wpaspy
> +PYTHON_WPASPY_CFLAGS = $(TARGET_CFLAGS)

This line has no effect.

> +PYTHON_WPASPY_LICENSE = BSD-3-Clause
> +PYTHON_WPASPY_LICENSE_FILES = README
> +PYTHON_WPASPY_CPE_ID_VENDOR = w1.fi

OK, but does CPE knows about python-wpaspy as a product of w1.fi ?

> +PYTHON_WPASPY_SETUP_TYPE = distutils
> +
> +$(eval $(python-package))

Thanks a lot!

Thomas
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 478894582e..e997c0e60a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1793,6 +1793,7 @@  F:	package/python-pyrex/
 F:	package/python-pysftp/
 F:	package/python-tinyrpc/
 F:	package/python-txdbus/
+F:	package/python-wpaspy/
 F:	package/qoriq-rcw/
 F:	package/raptor/
 F:	package/rng-tools/
diff --git a/package/Config.in b/package/Config.in
index 621bdca9d0..3e0b288f88 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1250,6 +1250,7 @@  menu "External python modules"
 	source "package/python-websockets/Config.in"
 	source "package/python-werkzeug/Config.in"
 	source "package/python-whoosh/Config.in"
+	source "package/python-wpaspy/Config.in"
 	source "package/python-wrapt/Config.in"
 	source "package/python-ws4py/Config.in"
 	source "package/python-wsaccel/Config.in"
diff --git a/package/python-wpaspy/0001-wpaspy-update-setup.py-to-use-wpaspy.py.patch b/package/python-wpaspy/0001-wpaspy-update-setup.py-to-use-wpaspy.py.patch
new file mode 100644
index 0000000000..bfa6e9609a
--- /dev/null
+++ b/package/python-wpaspy/0001-wpaspy-update-setup.py-to-use-wpaspy.py.patch
@@ -0,0 +1,45 @@ 
+From b25579dd576ef125741fc72bd39239cb7e60a1e5 Mon Sep 17 00:00:00 2001
+From: Jared Bents <jared.bents@rockwellcollins.com>
+Date: Wed, 1 Apr 2020 10:58:49 -0500
+Subject: [PATCH] wpaspy: update setup.py to use wpaspy.py
+
+update setup.py to use wpaspy.py instead of wpaspy.c due to
+information from Jouni Malinen in the linked mailing list
+correspondence
+
+http://lists.infradead.org/pipermail/hostap/2020-April/041575.html
+
+Signed-off-by: Jared Bents <jared.bents@rockwellcollins.com>
+---
+ wpaspy/setup.py | 18 ++++++------------
+ 1 file changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/wpaspy/setup.py b/wpaspy/setup.py
+index 4dbf76540..6b924f5f1 100644
+--- a/wpaspy/setup.py
++++ b/wpaspy/setup.py
+@@ -8,15 +8,9 @@
+ 
+ from distutils.core import setup, Extension
+ 
+-ext = Extension(name = 'wpaspy',
+-                sources = ['../src/common/wpa_ctrl.c',
+-                           '../src/utils/os_unix.c',
+-                           'wpaspy.c'],
+-                extra_compile_args = ["-I../src/common",
+-                                      "-I../src/utils",
+-                                      "-DCONFIG_CTRL_IFACE",
+-                                      "-DCONFIG_CTRL_IFACE_UNIX"])
+-
+-setup(name = 'wpaspy',
+-      ext_modules = [ext],
+-      description = 'Python bindings for wpa_ctrl (wpa_supplicant/hostapd)')
++setup(
++    name = "wpaspy",
++    description = "Python bindings for wpa_ctrl (wpa_supplicant/hostapd)",
++    py_modules = ["wpaspy"],
++    license = "BSD-3-Clause",
++    )
+-- 
+2.17.1
+
diff --git a/package/python-wpaspy/Config.in b/package/python-wpaspy/Config.in
new file mode 100644
index 0000000000..a35cefb86c
--- /dev/null
+++ b/package/python-wpaspy/Config.in
@@ -0,0 +1,6 @@ 
+config BR2_PACKAGE_PYTHON_WPASPY
+	bool "python-wpaspy"
+	depends on BR2_PACKAGE_WPA_SUPPLICANT #runtime dependency
+	help
+	  Python bindings for wpa_ctrl
+	  (wpa_supplicant/hostapd control interface)
diff --git a/package/python-wpaspy/python-wpaspy.hash b/package/python-wpaspy/python-wpaspy.hash
new file mode 100644
index 0000000000..b27eb79546
--- /dev/null
+++ b/package/python-wpaspy/python-wpaspy.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256  cb8ddbab4bf715aeeae67fbb06d85995fccb6f6180968247ea1aff250115ad44  hostap_2_9.tar.gz
+sha256  9da5dd0776da266b180b915e460ff75c6ff729aca1196ab396529510f24f3761  README
diff --git a/package/python-wpaspy/python-wpaspy.mk b/package/python-wpaspy/python-wpaspy.mk
new file mode 100644
index 0000000000..45d12844c6
--- /dev/null
+++ b/package/python-wpaspy/python-wpaspy.mk
@@ -0,0 +1,17 @@ 
+################################################################################
+#
+# python-wpaspy
+#
+################################################################################
+
+PYTHON_WPASPY_VERSION = 2_9
+PYTHON_WPASPY_SOURCE = hostap_$(PYTHON_WPASPY_VERSION).tar.gz
+PYTHON_WPASPY_SITE = https://w1.fi/cgit/hostap/snapshot
+PYTHON_WPASPY_SUBDIR = wpaspy
+PYTHON_WPASPY_CFLAGS = $(TARGET_CFLAGS)
+PYTHON_WPASPY_LICENSE = BSD-3-Clause
+PYTHON_WPASPY_LICENSE_FILES = README
+PYTHON_WPASPY_CPE_ID_VENDOR = w1.fi
+PYTHON_WPASPY_SETUP_TYPE = distutils
+
+$(eval $(python-package))