Skip to contentSkip to conversation

New package: python-dpkt

PATCH New yegorslists at googlemail.com 4 participants 8 messages Dec 14, 2011 – Dec 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH v3 2/2 New package: python-dpkt

From: Yegor Yefremov <[email protected]>

python-dpkt-setup.patch removes dpkt inclusion in setup.py and stores package metadata directly in setup.py. This avoids unneeded host-python dependencies like zlib

---
Changelog:
v3: add description and SoB to setup patch

 package/Config.in                           |    1 +
 package/python-dpkt/Config.in               |   11 +++++++++++
 package/python-dpkt/python-dpkt-setup.patch |   27 +++++++++++++++++++++++++++
 package/python-dpkt/python-dpkt.mk          |   22 ++++++++++++++++++++++
 4 files changed, 61 insertions(+), 0 deletions(-)
 create mode 100644 package/python-dpkt/Config.in
 create mode 100644 package/python-dpkt/python-dpkt-setup.patch
 create mode 100644 package/python-dpkt/python-dpkt.mk
package/Config.in +1 -0
index 6ab893f..bb5e5b0 100644
@@ -238,6 +238,7 @@ source "package/php/Config.in"
 source "package/python/Config.in"
 if BR2_PACKAGE_PYTHON
 menu "external python modules"
+source "package/python-dpkt/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-serial/Config.in"
 endmenu
package/python-dpkt/Config.in new file +11 -0
new file mode 100644
index 0000000..aac9f09
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PYTHON_DPKT
+	bool "python-dpkt"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_ZLIB
+	help
+	  Fast, simple packet creation / parsing, with definitions
+	  for the basic TCP/IP protocols.
+
+	  http://code.google.com/p/dpkt/
+
+
package/python-dpkt/python-dpkt-setup.patch new file +27 -0
new file mode 100644
index 0000000..a025272
@@ -0,0 +1,27 @@
+remove dpkt inclusion in setup.py to avoid unneeded dependencies
+like zlib
+
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ setup.py |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+Index: b/setup.py
+===================================================================
+--- a/setup.py
++++ b/setup.py
+@@ -1,11 +1,10 @@
+ #!/usr/bin/env python
+
+ from distutils.core import setup
+-import dpkt
+
+ setup(name='dpkt',
+-      version=dpkt.__version__,
+-      author=dpkt.__author__,
+-      url=dpkt.__url__,
++      version='1.7',
++      author='Dug Song <[email protected]>',
++      url='http://dpkt.googlecode.com/',
+       description='dumb packet module',
+       packages=[ 'dpkt' ])
package/python-dpkt/python-dpkt.mk new file +22 -0
new file mode 100644
index 0000000..7ac873c
@@ -0,0 +1,22 @@
+#############################################################
+#
+# python-dpkt
+#
+#############################################################
+
+PYTHON_DPKT_VERSION = 1.7
+PYTHON_DPKT_SOURCE  = dpkt-$(PYTHON_DPKT_VERSION).tar.gz
+PYTHON_DPKT_SITE    = http://dpkt.googlecode.com/files
+
+PYTHON_DPKT_DEPENDENCIES = python
+
+define PYTHON_DPKT_BUILD_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
+endef
+
+define PYTHON_DPKT_INSTALL_TARGET_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(call GENTARGETS))
+
Signature · 1 line
1.7.1.1
#1 lore raw

PATCH v3 2/2 New package: python-dpkt

Quoted 7 lines · On Wednesday 14 December 2011 16:38:36 yegorslists at googlemail.com wrote:

From: Yegor Yefremov <[email protected]>

python-dpkt-setup.patch removes dpkt inclusion in setup.py and stores package metadata directly in setup.py. This avoids unneeded host-python dependencies like zlib

[snip]

Quoted 21 lines
package/python-dpkt/python-dpkt-setup.patch new file +15 -0
new file mode 100644
index 0000000..a025272
@@ -0,0 +1,27 @@
+remove dpkt inclusion in setup.py to avoid unneeded dependencies
+like zlib
+
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ setup.py |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+Index: b/setup.py
+===================================================================
+--- a/setup.py
++++ b/setup.py
+@@ -1,11 +1,10 @@
+ #!/usr/bin/env python
+

package/python-dpkt/python-dpkt-setup.patch line 25

Quoted 10 lines
package/python-dpkt/python-dpkt-setup.patch new file +10 -0
+ from distutils.core import setup
+-import dpkt
+
+ setup(name='dpkt',
+-      version=dpkt.__version__,
+-      author=dpkt.__author__,
+-      url=dpkt.__url__,
++      version='1.7',
++      author='Dug Song <[email protected]>',
++      url='http://dpkt.googlecode.com/',

Good idea, but it makes life more difficult for version bumpers. There
should at least be a comment in the .mk file to point the version bumper to this patch, explaining the version should be incremented here as well. Alternatively, the information could be passed in environment variables which are set in the .mk file.

Quoted 21 lines
package/python-dpkt/python-dpkt-setup.patch new file +2 -0
+       description='dumb packet module',
+       packages=[ 'dpkt' ])
package/python-dpkt/python-dpkt.mk new file +12 -0
new file mode 100644
index 0000000..7ac873c
@@ -0,0 +1,22 @@
+#############################################################
+#
+# python-dpkt
+#
+#############################################################
+
+PYTHON_DPKT_VERSION = 1.7
+PYTHON_DPKT_SOURCE  = dpkt-$(PYTHON_DPKT_VERSION).tar.gz
+PYTHON_DPKT_SITE    = http://dpkt.googlecode.com/files
+
+PYTHON_DPKT_DEPENDENCIES = python
+

package/python-dpkt/python-dpkt.mk line 22

Quoted 10 lines
package/python-dpkt/python-dpkt.mk new file +10 -0
+define PYTHON_DPKT_BUILD_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
+endef
+
+define PYTHON_DPKT_INSTALL_TARGET_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(call GENTARGETS))
+

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#2 lore raw

PATCH v3 2/2 New package: python-dpkt

Le Wed, 21 Dec 2011 07:54:28 +0100,
Arnout Vandecappelle <[email protected]> a ?crit :

Quoted 2 lines

Alternatively, the information could be passed in environment variables which are set in the .mk file.

Yerk, no. This patch has to go upstream: it's silly for the setup.py script of a Python module to require this Python module to already be installed.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH v3 2/2 New package: python-dpkt

Am 21.12.2011 09:13, schrieb Thomas Petazzoni:

Quoted 9 lines

Le Wed, 21 Dec 2011 07:54:28 +0100,
Arnout Vandecappelle <[email protected]> a ?crit :

Quoted 2 lines

Alternatively, the information could be passed in environment variables which are set in the .mk file.

Yerk, no. This patch has to go upstream: it's silly for the setup.py script of a Python module to require this Python module to already be installed.

What would speak against compiling host-python with zlib support? I think we'll need it for host-setuputils anyway. AFAIK python-dpkt seems to be neglected for quite a while. Though I submitted a bug report: http://code.google.com/p/dpkt/issues/detail?id=82, I don't think it will be accepted shortly.

Should I prepare a patch for host-python with zlib support?

Best regards,
Yegor

#4 lore raw

PATCH v3 2/2 New package: python-dpkt

Le Wed, 21 Dec 2011 09:21:58 +0100,
Yegor Yefremov <[email protected]> a ?crit :

Quoted 7 lines

What would speak against compiling host-python with zlib support? I think we'll need it for host-setuputils anyway. AFAIK python-dpkt seems to be neglected for quite a while. Though I submitted a bug
report: http://code.google.com/p/dpkt/issues/detail?id=82, I don't think it will be accepted shortly.

Should I prepare a patch for host-python with zlib support?

Adding zlib support in host-python just because dpkt includes itself in its setup.py script is silly. If all packages do that, then we'll end up adding cairo support in host-python, just because some Python module relying on cairo includes itself in its setup.py script.

That said, if zlib support in host-python is needed for host-setuputils, then it's a different story and zlib support can be enabled in host-python. But I definitely don't want the host-python to be cluttered with more and more things simply because some packages do silly stuff in their setup.py.

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH v3 2/2 New package: python-dpkt

Quoted 16 lines · Thomas Petazzoni

Le Wed, 21 Dec 2011 09:21:58 +0100,
Yegor Yefremov <[email protected]> a ?crit :

Quoted 7 lines

What would speak against compiling host-python with zlib support? I think we'll need it for host-setuputils anyway. AFAIK python-dpkt seems to be neglected for quite a while. Though I submitted a bug
report: http://code.google.com/p/dpkt/issues/detail?id=82, I don't think it will be accepted shortly.

Should I prepare a patch for host-python with zlib support?

Adding zlib support in host-python just because dpkt includes itself in its setup.py script is silly. If all packages do that, then we'll end up adding cairo support in host-python, just because some Python module relying on cairo includes itself in its setup.py script.

Quoted 5 lines

That said, if zlib support in host-python is needed for host-setuputils, then it's a different story and zlib support can be enabled in host-python. But I definitely don't want the host-python to be cluttered with more and more things simply because some packages do silly stuff in their setup.py.

I agree with you. So I'll see how far I'll get with adding setuptools. This should have no impact at the current patch for now.

Yegor

#6 lore raw

PATCH v3 2/2 New package: python-dpkt

Quoted 18 lines · Yegor Yefremov
Quoted 16 lines · Thomas Petazzoni

Le Wed, 21 Dec 2011 09:21:58 +0100,
Yegor Yefremov <[email protected]> a ?crit :

Quoted 7 lines

What would speak against compiling host-python with zlib support? I think we'll need it for host-setuputils anyway. AFAIK python-dpkt seems to be neglected for quite a while. Though I submitted a bug
report: http://code.google.com/p/dpkt/issues/detail?id=82, I don't think it will be accepted shortly.

Should I prepare a patch for host-python with zlib support?

Adding zlib support in host-python just because dpkt includes itself in its setup.py script is silly. If all packages do that, then we'll end up adding cairo support in host-python, just because some Python module relying on cairo includes itself in its setup.py script.

Quoted 8 lines
Quoted 5 lines

That said, if zlib support in host-python is needed for host-setuputils, then it's a different story and zlib support can be enabled in host-python. But I definitely don't want the host-python to be cluttered with more and more things simply because some packages do silly stuff in their setup.py.

I agree with you. So I'll see how far I'll get with adding setuptools. This should have no impact at the current patch for now.

By the way as we enable zlib due to setuptools dependency, should I remove the dpkt setup.py patch? It is simpler for us to bump the version without this patch as Arnout mentioned.

Yegor

#7 lore raw

PATCH v3 2/2 New package: python-dpkt

Le Wed, 21 Dec 2011 22:18:05 +0100,
Yegor Yefremov <[email protected]> a ?crit :

Quoted 3 lines

By the way as we enable zlib due to setuptools dependency, should I remove the dpkt setup.py patch? It is simpler for us to bump the version without this patch as Arnout mentioned.

Yes, that's fine.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com