* [Buildroot] [PATCH] New package: python-dpkt
@ 2011-12-14 10:35 yegorslists at googlemail.com
2011-12-14 10:39 ` Yegor Yefremov
0 siblings, 1 reply; 4+ messages in thread
From: yegorslists at googlemail.com @ 2011-12-14 10:35 UTC (permalink / raw)
To: buildroot
From: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
package/Config.in | 1 +
package/python-dpkt/Config.in | 11 +++++++++++
package/python-dpkt/python-dpkt.mk | 29 +++++++++++++++++++++++++++++
3 files changed, 41 insertions(+), 0 deletions(-)
create mode 100644 package/python-dpkt/Config.in
create mode 100644 package/python-dpkt/python-dpkt.mk
diff --git a/package/Config.in b/package/Config.in
index cca2b0a..e5c2cae 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -239,6 +239,7 @@ source "package/python/Config.in"
if BR2_PACKAGE_PYTHON
menu "external python modules"
source "package/multimedia/python-mad/Config.in"
+source "package/python-dpkt/Config.in"
source "package/python-serial/Config.in"
endmenu
endif
diff --git a/package/python-dpkt/Config.in b/package/python-dpkt/Config.in
new file mode 100644
index 0000000..2d337dd
--- /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.mk b/package/python-dpkt/python-dpkt.mk
new file mode 100644
index 0000000..a76e8ca
--- /dev/null
+++ b/package/python-dpkt/python-dpkt.mk
@@ -0,0 +1,29 @@
+#############################################################
+#
+# 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); \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDSHARED="$(TARGET_CC) -shared" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ $(HOST_DIR)/usr/bin/python setup.py build_ext \
+ --include-dirs=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR))
+ (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] 4+ messages in thread
* [Buildroot] [PATCH] New package: python-dpkt
2011-12-14 10:35 [Buildroot] [PATCH] New package: python-dpkt yegorslists at googlemail.com
@ 2011-12-14 10:39 ` Yegor Yefremov
2011-12-14 10:46 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Yegor Yefremov @ 2011-12-14 10:39 UTC (permalink / raw)
To: buildroot
> +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); \
> + CC="$(TARGET_CC)" \
> + CFLAGS="$(TARGET_CFLAGS)" \
> + LDSHARED="$(TARGET_CC) -shared" \
> + LDFLAGS="$(TARGET_LDFLAGS)" \
> + $(HOST_DIR)/usr/bin/python setup.py build_ext \
> + --include-dirs=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR))
> + (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))
> +
I have following problem building this package:
Traceback (most recent call last):
File "setup.py", line 4, in <module>
import dpkt
File "/home/YegorYefremov/projects/versioned/tests/br-queue-python/output/build/python-dpkt-1.7/dpkt/__init__.py", line 26, in <module>
import gzip
File "/home/YegorYefremov/projects/versioned/tests/br-queue-python/output/build/python-dpkt-1.7/dpkt/gzip.py", line 5, in <module>
import struct, zlib
ImportError: No module named zlib
zlib is selected as core python component. Nevertheless it cannot be found. At first I tried to mimic python-serial build script, than python-mad, but they both don't require zlib.
Any idea?
Yegor
^ permalink raw reply [flat|nested] 4+ messages in thread* [Buildroot] [PATCH] New package: python-dpkt
2011-12-14 10:39 ` Yegor Yefremov
@ 2011-12-14 10:46 ` Thomas Petazzoni
2011-12-14 11:37 ` Yegor Yefremov
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2011-12-14 10:46 UTC (permalink / raw)
To: buildroot
Le Wed, 14 Dec 2011 11:39:05 +0100,
Yegor Yefremov <yegor_sub1@visionsystems.de> a ?crit :
> I have following problem building this package:
>
> Traceback (most recent call last):
> File "setup.py", line 4, in <module>
> import dpkt
> File
> "/home/YegorYefremov/projects/versioned/tests/br-queue-python/output/build/python-dpkt-1.7/dpkt/__init__.py",
> line 26, in <module> import gzip File
> "/home/YegorYefremov/projects/versioned/tests/br-queue-python/output/build/python-dpkt-1.7/dpkt/gzip.py",
> line 5, in <module> import struct, zlib ImportError: No module named
> zlib
At build time, the host-python is used. And the fact that you enabled
"zlib" for the target python has no impact on the configuration of the
host python. Why does it require zlib support in Python at build time?
Or, said otherwise, why does it tries to import the dpkt Python module
you're building, at build time?
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] 4+ messages in thread
* [Buildroot] [PATCH] New package: python-dpkt
2011-12-14 10:46 ` Thomas Petazzoni
@ 2011-12-14 11:37 ` Yegor Yefremov
0 siblings, 0 replies; 4+ messages in thread
From: Yegor Yefremov @ 2011-12-14 11:37 UTC (permalink / raw)
To: buildroot
Am 14.12.2011 11:46, schrieb Thomas Petazzoni:
> Le Wed, 14 Dec 2011 11:39:05 +0100,
> Yegor Yefremov <yegor_sub1@visionsystems.de> a ?crit :
>
>> I have following problem building this package:
>>
>> Traceback (most recent call last):
>> File "setup.py", line 4, in <module>
>> import dpkt
>> File
>> "/home/YegorYefremov/projects/versioned/tests/br-queue-python/output/build/python-dpkt-1.7/dpkt/__init__.py",
>> line 26, in <module> import gzip File
>> "/home/YegorYefremov/projects/versioned/tests/br-queue-python/output/build/python-dpkt-1.7/dpkt/gzip.py",
>> line 5, in <module> import struct, zlib ImportError: No module named
>> zlib
> At build time, the host-python is used. And the fact that you enabled
> "zlib" for the target python has no impact on the configuration of the
> host python. Why does it require zlib support in Python at build time?
> Or, said otherwise, why does it tries to import the dpkt Python module
> you're building, at build time?
This is a good question to maintainer of dpkt. I copied version, author and other stuff from dpkt/_init_.py to setup.py, commented import dpkt and could successfully install this package. Still haven't tested it. Because I need netifaces and this package needs setuptools :-(
Yegor
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-14 11:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14 10:35 [Buildroot] [PATCH] New package: python-dpkt yegorslists at googlemail.com
2011-12-14 10:39 ` Yegor Yefremov
2011-12-14 10:46 ` Thomas Petazzoni
2011-12-14 11:37 ` Yegor Yefremov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox