All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 2/2] New package: python-dpkt
@ 2011-12-14 15:38 yegorslists at googlemail.com
  2011-12-21  6:54 ` Arnout Vandecappelle
  0 siblings, 1 reply; 8+ messages in thread
From: yegorslists at googlemail.com @ 2011-12-14 15:38 UTC (permalink / raw)
  To: buildroot

From: Yegor Yefremov <yegorslists@googlemail.com>

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

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
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

diff --git a/package/Config.in b/package/Config.in
index 6ab893f..bb5e5b0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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
diff --git a/package/python-dpkt/Config.in b/package/python-dpkt/Config.in
new file mode 100644
index 0000000..aac9f09
--- /dev/null
+++ b/package/python-dpkt/Config.in
@@ -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/
+
+
diff --git a/package/python-dpkt/python-dpkt-setup.patch b/package/python-dpkt/python-dpkt-setup.patch
new file mode 100644
index 0000000..a025272
--- /dev/null
+++ b/package/python-dpkt/python-dpkt-setup.patch
@@ -0,0 +1,27 @@
+remove dpkt inclusion in setup.py to avoid unneeded dependencies
+like zlib
+
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+---
+ 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 <dugsong@monkey.org>',
++      url='http://dpkt.googlecode.com/',
+       description='dumb packet module',
+       packages=[ 'dpkt' ])
diff --git a/package/python-dpkt/python-dpkt.mk b/package/python-dpkt/python-dpkt.mk
new file mode 100644
index 0000000..7ac873c
--- /dev/null
+++ b/package/python-dpkt/python-dpkt.mk
@@ -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))
+
-- 
1.7.1.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] New package: python-dpkt
  2011-12-14 15:38 [Buildroot] [PATCH v3 2/2] New package: python-dpkt yegorslists at googlemail.com
@ 2011-12-21  6:54 ` Arnout Vandecappelle
  2011-12-21  8:13   ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2011-12-21  6:54 UTC (permalink / raw)
  To: buildroot

On Wednesday 14 December 2011 16:38:36 yegorslists at googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> 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
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

[snip]
> diff --git a/package/python-dpkt/python-dpkt-setup.patch b/package/python-dpkt/python-dpkt-setup.patch
> new file mode 100644
> index 0000000..a025272
> --- /dev/null
> +++ b/package/python-dpkt/python-dpkt-setup.patch
> @@ -0,0 +1,27 @@
> +remove dpkt inclusion in setup.py to avoid unneeded dependencies
> +like zlib
> +
> +Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> +---
> + 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 <dugsong@monkey.org>',
> ++      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.

> +       description='dumb packet module',
> +       packages=[ 'dpkt' ])
> diff --git a/package/python-dpkt/python-dpkt.mk b/package/python-dpkt/python-dpkt.mk
> new file mode 100644
> index 0000000..7ac873c
> --- /dev/null
> +++ b/package/python-dpkt/python-dpkt.mk
> @@ -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))
> +
> 

 Regards,
 Arnout

-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] New package: python-dpkt
  2011-12-21  6:54 ` Arnout Vandecappelle
@ 2011-12-21  8:13   ` Thomas Petazzoni
  2011-12-21  8:21     ` Yegor Yefremov
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2011-12-21  8:13 UTC (permalink / raw)
  To: buildroot

Le Wed, 21 Dec 2011 07:54:28 +0100,
Arnout Vandecappelle <arnout@mind.be> a ?crit :

> 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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] New package: python-dpkt
  2011-12-21  8:13   ` Thomas Petazzoni
@ 2011-12-21  8:21     ` Yegor Yefremov
  2011-12-21  8:38       ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2011-12-21  8:21 UTC (permalink / raw)
  To: buildroot

Am 21.12.2011 09:13, schrieb Thomas Petazzoni:
> Le Wed, 21 Dec 2011 07:54:28 +0100,
> Arnout Vandecappelle <arnout@mind.be> a ?crit :
> 
>> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] New package: python-dpkt
  2011-12-21  8:21     ` Yegor Yefremov
@ 2011-12-21  8:38       ` Thomas Petazzoni
  2011-12-21  8:48         ` Yegor Yefremov
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2011-12-21  8:38 UTC (permalink / raw)
  To: buildroot

Le Wed, 21 Dec 2011 09:21:58 +0100,
Yegor Yefremov <yegor_sub1@visionsystems.de> a ?crit :

> 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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] New package: python-dpkt
  2011-12-21  8:38       ` Thomas Petazzoni
@ 2011-12-21  8:48         ` Yegor Yefremov
  2011-12-21 21:18           ` Yegor Yefremov
  0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2011-12-21  8:48 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 21, 2011 at 9:38 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Le Wed, 21 Dec 2011 09:21:58 +0100,
> Yegor Yefremov <yegor_sub1@visionsystems.de> a ?crit :
>
>> 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.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] New package: python-dpkt
  2011-12-21  8:48         ` Yegor Yefremov
@ 2011-12-21 21:18           ` Yegor Yefremov
  2011-12-21 22:25             ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2011-12-21 21:18 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 21, 2011 at 9:48 AM, Yegor Yefremov
<yegorslists@googlemail.com> wrote:
> On Wed, Dec 21, 2011 at 9:38 AM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Le Wed, 21 Dec 2011 09:21:58 +0100,
>> Yegor Yefremov <yegor_sub1@visionsystems.de> a ?crit :
>>
>>> 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.
>
> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] New package: python-dpkt
  2011-12-21 21:18           ` Yegor Yefremov
@ 2011-12-21 22:25             ` Thomas Petazzoni
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2011-12-21 22:25 UTC (permalink / raw)
  To: buildroot

Le Wed, 21 Dec 2011 22:18:05 +0100,
Yegor Yefremov <yegorslists@googlemail.com> a ?crit :

> 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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-12-21 22:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14 15:38 [Buildroot] [PATCH v3 2/2] New package: python-dpkt yegorslists at googlemail.com
2011-12-21  6:54 ` Arnout Vandecappelle
2011-12-21  8:13   ` Thomas Petazzoni
2011-12-21  8:21     ` Yegor Yefremov
2011-12-21  8:38       ` Thomas Petazzoni
2011-12-21  8:48         ` Yegor Yefremov
2011-12-21 21:18           ` Yegor Yefremov
2011-12-21 22:25             ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.