All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/5] Introduce New Package PySnmp
@ 2013-10-04  1:12 Ryan Barnett
  2013-10-04  1:12 ` [Buildroot] [PATCH 1/5] python-pyasn: new package Ryan Barnett
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Ryan Barnett @ 2013-10-04  1:12 UTC (permalink / raw)
  To: buildroot

I apologies for the first patch set, I thought I tested it more
throughly than I actually did. I guess that is what I get for multi-
tasking...

The first version of this patch set has problem with cross-compiling
PyCrypto which it really didn't do. This second version fixes those
problems but because I wasn't compiling PyCrypto correctly, it lead
to more changes than I anticipated.

This updated patchset has added host compiling support for PyASN,
PySNMP, and PyCrypto because there are issues with the installing
PySNMP-Apps to target and not being able to find installed versions
of PyASN/PySNMP and PyCrypto since it uses setuptools and doesn't
search in the correct location (TARGET_DIR). The workaround for the
problem is to compile PyASN, PyCrypto and PySNMP for the target to
fake-out setuptools into thinking that packages are installed.

Note: PySNMP-Apps will install in the correct location just doesn't
search for the dependancies in the correct location.

========================================

This patchset adds support for building PySnmp. One thing that I'm not
sure on and am open to debate is the naming of the packages under
Target Packages > Interpreter languages and scripting > external python
modules in the menuconfig since the majority of the packages are named
python-<pkg_name> but pygame and pyparsing don't fall under this
category.

Menuconfig
 -> python-nfc
 -> python-protobuf
 -> pygame
 -> pyparsing
 -> python-pyro
 -> python-pyzmq

The make rules for the pygame and pyparsing packages are python-pygame
python-pyparsing.

Location of the packages in buildroot is package/python-pygame and
package/python-pyparsing.

Question I have for the packages I added is the following:

Should I follow what is currently done for pygame and pyparsing
or should I keep them how I have things done and change the name of
pygame and pyparsing in seperate patches? Whatever is chosen, I would
just like to have consistency with naming.

My vote is to change pygame and pyparsing names. But my mind can
easily be changed.

Ryan Barnett (5):
  python-pyasn: new package
  python-pycrypto: new package
  python-pysnmp: new package
  python-pysnmp-apps: new package
  python-pysnmp-mibs: new package

 package/Config.in                                |    7 ++++
 package/python-pyasn/Config.in                   |   13 +++++++
 package/python-pyasn/python-pyasn.mk             |   38 ++++++++++++++++++++++
 package/python-pycrypto/Config.in                |    8 ++++
 package/python-pycrypto/python-pycrypto.mk       |   25 ++++++++++++++
 package/python-pysnmp-apps/Config.in             |    7 ++++
 package/python-pysnmp-apps/python-pysnmp-apps.mk |   23 +++++++++++++
 package/python-pysnmp-mibs/Config.in             |    8 ++++
 package/python-pysnmp-mibs/python-pysnmp-mibs.mk |   23 +++++++++++++
 package/python-pysnmp/Config.in                  |   10 ++++++
 package/python-pysnmp/python-pysnmp.mk           |   23 +++++++++++++
 11 files changed, 185 insertions(+), 0 deletions(-)
 create mode 100644 package/python-pyasn/Config.in
 create mode 100644 package/python-pyasn/python-pyasn.mk
 create mode 100644 package/python-pycrypto/Config.in
 create mode 100644 package/python-pycrypto/python-pycrypto.mk
 create mode 100644 package/python-pysnmp-apps/Config.in
 create mode 100644 package/python-pysnmp-apps/python-pysnmp-apps.mk
 create mode 100644 package/python-pysnmp-mibs/Config.in
 create mode 100644 package/python-pysnmp-mibs/python-pysnmp-mibs.mk
 create mode 100644 package/python-pysnmp/Config.in
 create mode 100644 package/python-pysnmp/python-pysnmp.mk

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

* [Buildroot] [PATCH 1/5] python-pyasn: new package
  2013-10-04  1:12 [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
@ 2013-10-04  1:12 ` Ryan Barnett
  2013-10-04  2:27   ` Danomi Manchego
  2013-10-04  1:12 ` [Buildroot] [PATCH 2/5] python-pycrypto: " Ryan Barnett
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Ryan Barnett @ 2013-10-04  1:12 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Ryan Barnett <rjbarnet@rockwellcollins.com>

---

The definition of CFLAGS/LDFLAGS/LDSHARED is necessary since the
compilation of won't work correctly using either TARGET_CONFIGURE_OPTS
because it won't link against the correct python library. Also using
python-distutilcross doesn't work as the setup.py doesn't understand
the -x option.

---

v1 -> v2
 * Added comment explain why the -I and -L options are needed
   which is the same comment as PyCrypto package.
 * Added PYTHONPATH definition to the install target command
 * Added host-version of PyAsn since PySNMP-apps will not be able to
   find the installed version of PyASN and try to install it.
---
 package/Config.in                    |    1 +
 package/python-pyasn/Config.in       |   13 ++++++
 package/python-pyasn/python-pyasn.mk |   73 ++++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 0 deletions(-)
 create mode 100644 package/python-pyasn/Config.in
 create mode 100644 package/python-pyasn/python-pyasn.mk

diff --git a/package/Config.in b/package/Config.in
index b7fdb89..3592cb7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -396,6 +396,7 @@ source "package/python-meld3/Config.in"
 source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
 source "package/python-protobuf/Config.in"
+source "package/python-pyasn/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
diff --git a/package/python-pyasn/Config.in b/package/python-pyasn/Config.in
new file mode 100644
index 0000000..a352fe4
--- /dev/null
+++ b/package/python-pyasn/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYASN
+	bool "python-pyasn"
+	depends on BR2_PACKAGE_PYTHON
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  PyASN is a Python extension module that enables you to
+	  perform very fast IP address to Autonomous System Number
+	  lookups.
+
+	  https://code.google.com/p/pyasn/
+
+comment "python-pyasn requires C++ support in toolchain"
+        depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/python-pyasn/python-pyasn.mk b/package/python-pyasn/python-pyasn.mk
new file mode 100644
index 0000000..bfad659
--- /dev/null
+++ b/package/python-pyasn/python-pyasn.mk
@@ -0,0 +1,73 @@
+################################################################################
+#
+# python-pyasn
+#
+################################################################################
+
+PYTHON_PYASN_VERSION = 1.2
+PYTHON_PYASN_SOURCE  = PyASN-$(PYTHON_PYASN_VERSION).zip
+PYTHON_PYASN_SITE    = https://pyasn.googlecode.com/files
+PYTHON_PYASN_LICENSE = LGPL
+
+PYTHON_PYASN_DEPENDENCIES = python
+HOST_PYTHON_PYASN_DEPENDENCIES = host-python
+
+#############
+# Target
+#############
+define PYTHON_PYASN_EXTRACT_CMDS
+	unzip -d $(@D) $(DL_DIR)/$(PYTHON_PYASN_SOURCE)
+	mv $(@D)/PyASN-$(PYTHON_PYASN_VERSION)/* $(@D)
+	$(RM) -r $(@D)/PyASN-$(PYTHON_PYASN_VERSION)
+endef
+
+# The additional -I and -L are needed to ensure that the $(STAGING_DIR)
+# header and library files are pulled. Otherwise the distutils package before
+# the ones that the distutils package will find the headers/libraries that are
+# located at $(HOST_DIR)/usr.
+define PYTHON_PYASN_BUILD_CMDS
+	(cd $(@D); \
+		CC="$(TARGET_CC)" \
+		CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
+		CXX="$(TARGET_CXX)" \
+		CXXFLAGS="$(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include" \
+		LDSHARED="$(TARGET_CC) -shared" \
+		LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
+	$(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
+
+# PYTHONPATH definition is need for install since an error could
+# be thrown about installing to location that isn't in PYTHONPATH
+define PYTHON_PYASN_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+		PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+#############
+# Host
+#############
+define HOST_PYTHON_PYASN_EXTRACT_CMDS
+	unzip -d $(@D) $(DL_DIR)/$(PYTHON_PYASN_SOURCE)
+	mv $(@D)/PyASN-$(PYTHON_PYASN_VERSION)/* $(@D)
+	$(RM) -r $(@D)/PyASN-$(PYTHON_PYASN_VERSION)
+endef
+
+define HOST_PYTHON_PYASN_BUILD_CMDS
+	(cd $(@D); \
+	$(HOST_DIR)/usr/bin/python setup.py build_ext \
+	)
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
+endef
+
+define HOST_PYTHON_PYASN_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.7.1

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

* [Buildroot] [PATCH 2/5] python-pycrypto: new package
  2013-10-04  1:12 [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
  2013-10-04  1:12 ` [Buildroot] [PATCH 1/5] python-pyasn: new package Ryan Barnett
@ 2013-10-04  1:12 ` Ryan Barnett
  2013-10-04  1:12 ` [Buildroot] [PATCH 3/5] python-pysnmp: " Ryan Barnett
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan Barnett @ 2013-10-04  1:12 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Ryan Barnett <rjbarnet@rockwellcollins.com>

---

v1 -> v2
 * Fixed issue with not actually cross compiling the C shared libraries
   for the traget.
 * Some not so pretty things was were done to accomplish the cross
   compiling but I'd rather do this than having to patch the package
   to fix the cross compiling issues.
 * Added dependancy on GMP since it is needed for all the crypto
   libraries to work and the pacakge to compile correctly.
 * Added PYTHONPATH definition to the install target command
 * Added host so install of PySNMP-apps would work
---
 package/Config.in                          |    1 +
 package/python-pycrypto/Config.in          |    9 +++
 package/python-pycrypto/python-pycrypto.mk |   79 ++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100644 package/python-pycrypto/Config.in
 create mode 100644 package/python-pycrypto/python-pycrypto.mk

diff --git a/package/Config.in b/package/Config.in
index 3592cb7..a1f7901 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -397,6 +397,7 @@ source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
 source "package/python-protobuf/Config.in"
 source "package/python-pyasn/Config.in"
+source "package/python-pycrypto/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
diff --git a/package/python-pycrypto/Config.in b/package/python-pycrypto/Config.in
new file mode 100644
index 0000000..0f076da
--- /dev/null
+++ b/package/python-pycrypto/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PYCRYPTO
+	bool "python-pycrypto"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_GMP
+	help
+	  PyCrypto is a collection of cryptographic algorithms and 
+	  protocols, implemented for use from Python.
+
+	  http://www.pycrypto.org/
diff --git a/package/python-pycrypto/python-pycrypto.mk b/package/python-pycrypto/python-pycrypto.mk
new file mode 100644
index 0000000..f68a487
--- /dev/null
+++ b/package/python-pycrypto/python-pycrypto.mk
@@ -0,0 +1,79 @@
+################################################################################
+#
+# python-pycrypto
+#
+################################################################################
+
+PYTHON_PYCRYPTO_VERSION = 2.6
+PYTHON_PYCRYPTO_SOURCE  = pycrypto-$(PYTHON_PYCRYPTO_VERSION).tar.gz
+PYTHON_PYCRYPTO_SITE    = http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto
+PYTHON_PYCRYPTO_LICENSE = Public Domain, Python 2.2 License (HMAC.py, setup.py)
+
+PYTHON_PYCRYPTO_LICENSE_FILES = COPYRIGHT LEGAL/copy/LICENSE.libtom \
+		LEGAL/copy/LICENSE.orig LEGAL/copy/LICENSE.python-2.2
+
+PYTHON_PYCRYPTO_DEPENDENCIES = python gmp
+HOST_PYTHON_PYCRYPTO_DEPENDENCIES = host-python host-gmp
+
+#############
+# Target
+#############
+
+# The configure step needs to be run outside of the setup.py since it isn't
+# run correctly for cross-compiling
+define PYTHON_PYCRYPTO_CONFIGURE_CMDS
+	(cd $(@D) && \
+	$(TARGET_CONFIGURE_OPTS) \
+	$(TARGET_CONFIGURE_ARGS) \
+	./configure \
+		--target=$(GNU_TARGET_NAME) \
+		--host=$(GNU_TARGET_NAME) \
+		--build=$(GNU_HOST_NAME) \
+		--prefix=/usr \
+		--exec-prefix=/usr \
+		--sysconfdir=/etc \
+		--program-prefix="" \
+	)
+endef
+
+# The additional -I and -L are needed to ensure that the $(STAGING_DIR)
+# header and library files are pulled. Otherwise the distutils package before
+# the ones that the distutils package will find the headers/libraries that are
+# located at $(HOST_DIR)/usr.
+define PYTHON_PYCRYPTO_BUILD_CMDS
+	(cd $(@D); \
+		CC="$(TARGET_CC)" \
+		CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
+		LDSHARED="$(TARGET_CC) -shared" \
+		LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
+	$(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
+
+# PYTHONPATH definition is need for install since an error could
+# be thrown about installing to location that isn't in PYTHONPATH
+define PYTHON_PYCRYPTO_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+		PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+#############
+# Host
+#############
+define HOST_PYTHON_PYCRYPTO_BUILD_CMDS
+	(cd $(@D); \
+	$(HOST_DIR)/usr/bin/python setup.py build_ext \
+	)
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
+endef
+
+define HOST_PYTHON_PYCRYPTO_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.7.1

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

* [Buildroot] [PATCH 3/5] python-pysnmp: new package
  2013-10-04  1:12 [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
  2013-10-04  1:12 ` [Buildroot] [PATCH 1/5] python-pyasn: new package Ryan Barnett
  2013-10-04  1:12 ` [Buildroot] [PATCH 2/5] python-pycrypto: " Ryan Barnett
@ 2013-10-04  1:12 ` Ryan Barnett
  2013-10-04  1:12 ` [Buildroot] [PATCH 4/5] python-pysnmp-apps: " Ryan Barnett
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan Barnett @ 2013-10-04  1:12 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Ryan Barnett <rjbarnet@rockwellcollins.com>

---

Even though the documentation for PySNMP says PyCrypto is an optional
dependancy, it is required for any system besides Windows.
(see Setup.py)

---

v1 -> v2
 * Added PYTHONPATH definition to the install target command
 * Added host version of the package to support the installation
   of PySNMP-apps so it can find the package.
---
 package/Config.in                      |    1 +
 package/python-pysnmp/Config.in        |   10 ++++++
 package/python-pysnmp/python-pysnmp.mk |   48 ++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 package/python-pysnmp/Config.in
 create mode 100644 package/python-pysnmp/python-pysnmp.mk

diff --git a/package/Config.in b/package/Config.in
index a1f7901..68262f9 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -401,6 +401,7 @@ source "package/python-pycrypto/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
+source "package/python-pysnmp/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
diff --git a/package/python-pysnmp/Config.in b/package/python-pysnmp/Config.in
new file mode 100644
index 0000000..88f6f6f
--- /dev/null
+++ b/package/python-pysnmp/Config.in
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_PYTHON_PYSNMP
+	bool "python-pysnmp"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_PYASN
+	select BR2_PACKAGE_PYTHON_PYCRYPTO
+	help
+	  PySNMP is a cross-platform, pure-Python SNMP engine
+	  implementation.
+
+	  http://pysnmp.sf.net
diff --git a/package/python-pysnmp/python-pysnmp.mk b/package/python-pysnmp/python-pysnmp.mk
new file mode 100644
index 0000000..e70da15
--- /dev/null
+++ b/package/python-pysnmp/python-pysnmp.mk
@@ -0,0 +1,48 @@
+################################################################################
+#
+# python-pysnmp
+#
+################################################################################
+
+PYTHON_PYSNMP_VERSION = 4.2.4
+PYTHON_PYSNMP_SOURCE  = pysnmp-$(PYTHON_PYSNMP_VERSION).tar.gz
+PYTHON_PYSNMP_SITE    = https://pypi.python.org/packages/source/p/pysnmp
+PYTHON_PYSNMP_LICENSE = BSD-3c
+PYTHON_PYSNMP_LICENSE_FILES = LICENSE
+
+PYTHON_PYSNMP_DEPENDENCIES = python \
+	python-pyasn \
+	python-pycrypto
+HOST_PYTHON_PYSNMP_DEPENDENCIES = host-python \
+	host-python-pyasn \
+	host-python-pycrypto
+
+#############
+# Target
+#############
+define PYTHON_PYSNMP_BUILD_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build --executable=/usr/bin/python)
+endef
+
+# PYTHONPATH definition is need for install since an error could
+# be thrown about installing to location that isn't in PYTHONPATH
+define PYTHON_PYSNMP_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+		PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+#############
+# Host
+#############
+define HOST_PYTHON_PYSNMP_BUILD_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build --executable=/usr/bin/python)
+endef
+
+define HOST_PYTHON_PYSNMP_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.7.1

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

* [Buildroot] [PATCH 4/5] python-pysnmp-apps: new package
  2013-10-04  1:12 [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
                   ` (2 preceding siblings ...)
  2013-10-04  1:12 ` [Buildroot] [PATCH 3/5] python-pysnmp: " Ryan Barnett
@ 2013-10-04  1:12 ` Ryan Barnett
  2013-10-04  1:12 ` [Buildroot] [PATCH 5/5] python-pysnmp-mibs: " Ryan Barnett
  2013-10-04 14:25 ` [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan Barnett @ 2013-10-04  1:12 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Ryan Barnett <rjbarnet@rockwellcollins.com>

---

v1 -> v2
 * Added PYTHONPATH definition to the install target command
 * Added the dependancy on host-python-pysnmp since the setuptools
   python module will be unable to find the installation version
   of pyasn/pycrypto/pysnmp in the hostdir.
---
 package/Config.in                                |    3 ++
 package/python-pysnmp-apps/Config.in             |    7 +++++
 package/python-pysnmp-apps/python-pysnmp-apps.mk |   29 ++++++++++++++++++++++
 3 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 package/python-pysnmp-apps/Config.in
 create mode 100644 package/python-pysnmp-apps/python-pysnmp-apps.mk

diff --git a/package/Config.in b/package/Config.in
index 68262f9..970f5ce 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,9 @@ source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
 source "package/python-pysnmp/Config.in"
+if BR2_PACKAGE_PYTHON_PYSNMP
+source "package/python-pysnmp-apps/Config.in"
+endif
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
diff --git a/package/python-pysnmp-apps/Config.in b/package/python-pysnmp-apps/Config.in
new file mode 100644
index 0000000..89a2610
--- /dev/null
+++ b/package/python-pysnmp-apps/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_PYSNMP_APPS
+	bool "python-pysnmp-apps"
+	help
+	  PySNMP MIBs is a set of IETF & IANA MIBs pre-compiled and 
+	  packaged to simplify their use with the PySNMP library.
+
+	  http://pysnmp.sf.net
diff --git a/package/python-pysnmp-apps/python-pysnmp-apps.mk b/package/python-pysnmp-apps/python-pysnmp-apps.mk
new file mode 100644
index 0000000..359ac97
--- /dev/null
+++ b/package/python-pysnmp-apps/python-pysnmp-apps.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# python-pysnmp-apps
+#
+################################################################################
+
+PYTHON_PYSNMP_APPS_VERSION = 0.3.3
+PYTHON_PYSNMP_APPS_SOURCE  = pysnmp-apps-$(PYTHON_PYSNMP_APPS_VERSION).tar.gz
+PYTHON_PYSNMP_APPS_SITE    = https://pypi.python.org/packages/source/p/pysnmp-apps
+PYTHON_PYSNMP_APPS_LICENSE = BSD-3c
+PYTHON_PYSNMP_APPS_LICENSE_FILES = LICENSE
+
+PYTHON_PYSNMP_APPS_DEPENDENCIES = python \
+	python-pysnmp \
+	host-python-pysnmp
+
+define PYTHON_PYSNMP_APPS_BUILD_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build --executable=/usr/bin/python)
+endef
+
+# PYTHONPATH definition is need for install since an error could
+# be thrown about installing to location that isn't in PYTHONPATH
+define PYTHON_PYSNMP_APPS_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+		PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))
-- 
1.7.1

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

* [Buildroot] [PATCH 5/5] python-pysnmp-mibs: new package
  2013-10-04  1:12 [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
                   ` (3 preceding siblings ...)
  2013-10-04  1:12 ` [Buildroot] [PATCH 4/5] python-pysnmp-apps: " Ryan Barnett
@ 2013-10-04  1:12 ` Ryan Barnett
  2013-10-04 14:25 ` [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan Barnett @ 2013-10-04  1:12 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Ryan Barnett <rjbarnet@rockwellcollins.com>

---

v1 -> v2
 * Added PYTHONPATH definition to the install target command
 * Added the dependancy on host-python-pysnmp since the setuptools
   python module will be unable to find the installation version
   of pyasn/pycrypto/pysnmp in the hostdir.
---
 package/Config.in                                |    1 +
 package/python-pysnmp-mibs/Config.in             |    8 ++++++
 package/python-pysnmp-mibs/python-pysnmp-mibs.mk |   29 ++++++++++++++++++++++
 3 files changed, 38 insertions(+), 0 deletions(-)
 create mode 100644 package/python-pysnmp-mibs/Config.in
 create mode 100644 package/python-pysnmp-mibs/python-pysnmp-mibs.mk

diff --git a/package/Config.in b/package/Config.in
index 970f5ce..71a4357 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -404,6 +404,7 @@ source "package/python-pyro/Config.in"
 source "package/python-pysnmp/Config.in"
 if BR2_PACKAGE_PYTHON_PYSNMP
 source "package/python-pysnmp-apps/Config.in"
+source "package/python-pysnmp-mibs/Config.in"
 endif
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
diff --git a/package/python-pysnmp-mibs/Config.in b/package/python-pysnmp-mibs/Config.in
new file mode 100644
index 0000000..2835678
--- /dev/null
+++ b/package/python-pysnmp-mibs/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_PYSNMP_MIBS
+	bool "python-pysnmp-mibs"
+	depends on BR2_PACKAGE_PYTHON && BR2_PACKAGE_PYTHON_PYSNMP
+	help
+	  PySNMP MIBs is a set of IETF & IANA MIBs pre-compiled and 
+	  packaged to simplify their use with the PySNMP library.
+
+	  http://pysnmp.sf.net
diff --git a/package/python-pysnmp-mibs/python-pysnmp-mibs.mk b/package/python-pysnmp-mibs/python-pysnmp-mibs.mk
new file mode 100644
index 0000000..204582d
--- /dev/null
+++ b/package/python-pysnmp-mibs/python-pysnmp-mibs.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# python-pysnmp-mibs
+#
+################################################################################
+
+PYTHON_PYSNMP_MIBS_VERSION = 0.1.4
+PYTHON_PYSNMP_MIBS_SOURCE  = pysnmp-mibs-$(PYTHON_PYSNMP_MIBS_VERSION).tar.gz
+PYTHON_PYSNMP_MIBS_SITE    = https://pypi.python.org/packages/source/p/pysnmp-mibs
+PYTHON_PYSNMP_MIBS_LICENSE = BSD-3c
+PYTHON_PYSNMP_MIBS_LICENSE_FILES = LICENSE
+
+PYTHON_PYSNMP_MIBS_DEPENDENCIES = python \
+	python-pysnmp \
+	host-python-pysnmp
+
+define PYTHON_PYSNMP_MIBS_BUILD_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build --executable=/usr/bin/python)
+endef
+
+# PYTHONPATH definition is need for install since an error could
+# be thrown about installing to location that isn't in PYTHONPATH
+define PYTHON_PYSNMP_MIBS_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+		PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))
-- 
1.7.1

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

* [Buildroot] [PATCH 1/5] python-pyasn: new package
  2013-10-04  1:12 ` [Buildroot] [PATCH 1/5] python-pyasn: new package Ryan Barnett
@ 2013-10-04  2:27   ` Danomi Manchego
  2013-10-04 14:09     ` Ryan Barnett
  0 siblings, 1 reply; 12+ messages in thread
From: Danomi Manchego @ 2013-10-04  2:27 UTC (permalink / raw)
  To: buildroot

Ryan,

On Thu, Oct 3, 2013 at 9:12 PM, Ryan Barnett
<rjbarnet@rockwellcollins.com> wrote:
> +               CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
> +               CXX="$(TARGET_CXX)" \
> +               CXXFLAGS="$(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include" \
> +               LDSHARED="$(TARGET_CC) -shared" \
> +               LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
> +       $(HOST_DIR)/usr/bin/python setup.py build_ext \
> +       --include-dirs=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
> +       )

I'm curious as to why the mix of -I and --include-dirs.  I.e., why not
three -I's, or one --include-dirs=path1:path2:path3?  Is there a
difference?

I'm also wondering if all of these packages should have
CROSS_COMPILING=yes ... several of the python patches go through pains
to introduce CROSS_COMPILING, presumably there is a reason why.

No objections, just wondering ...

Danomi -

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

* [Buildroot] [PATCH 1/5] python-pyasn: new package
  2013-10-04  2:27   ` Danomi Manchego
@ 2013-10-04 14:09     ` Ryan Barnett
  0 siblings, 0 replies; 12+ messages in thread
From: Ryan Barnett @ 2013-10-04 14:09 UTC (permalink / raw)
  To: buildroot

Danomi,

Danomi Manchego <danomimanchego123@gmail.com> wrote on 
10/03/2013 09:27:56 PM:

> Ryan,
> 
> On Thu, Oct 3, 2013 at 9:12 PM, Ryan Barnett
> <rjbarnet@rockwellcollins.com> wrote:
> > +               CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" 
\
> > +               CXX="$(TARGET_CXX)" \
> > +               CXXFLAGS="$(TARGET_CXXFLAGS) 
-I$(STAGING_DIR)/usr/include" \
> > +               LDSHARED="$(TARGET_CC) -shared" \
> > +               LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/lib -L$
> (STAGING_DIR)/usr/lib" \
> > +       $(HOST_DIR)/usr/bin/python setup.py build_ext \
> > +       --include-dirs=$(STAGING_DIR)/usr/include/python$
> (PYTHON_VERSION_MAJOR) \
> > +       )
> 
> I'm curious as to why the mix of -I and --include-dirs.  I.e., why not
> three -I's, or one --include-dirs=path1:path2:path3?  Is there a
> difference?

The --include-dirs part is left over from copy and paste from 
python-serial.mk
which I used for my base. I like using --include-dirs to point all my 
include
paths so I will move the include path from CFLAGS= down to --include-dirs=
 
> I'm also wondering if all of these packages should have
> CROSS_COMPILING=yes ... several of the python patches go through pains
> to introduce CROSS_COMPILING, presumably there is a reason why.

I thought introducing CROSS_COMPILING in the python patches is meant for 
cross compiling python itself since it is modifying the setup.py in python 

itself.

These are the first python packages that I'm trying to get to cross 
compile.
I've tried using the CROSS_COMPILING flag and it doesn't appear to do
anything so I'm not exactly sure how setting that in the environment will
help in these packages?

If you or somebody else has more familiarity with python cross compiling
modules can explain how this will help, I'm open to changing how these
packages are built.

Finally, I've tried the suggestions that Arnout that gave for the 
python-ipy but those suggestions didn't work.

> No objections, just wondering ...
> 
> Danomi -

Thanks,
-Ryan

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

* [Buildroot] [PATCH 0/5] Introduce New Package PySnmp
  2013-10-04  1:12 [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
                   ` (4 preceding siblings ...)
  2013-10-04  1:12 ` [Buildroot] [PATCH 5/5] python-pysnmp-mibs: " Ryan Barnett
@ 2013-10-04 14:25 ` Ryan Barnett
  5 siblings, 0 replies; 12+ messages in thread
From: Ryan Barnett @ 2013-10-04 14:25 UTC (permalink / raw)
  To: buildroot

All,

I accidentally forgot to put a "PATCH v2" in the title of these 
patches so the following patches in patchworks can be marked as
superseded.

http://patchwork.ozlabs.org/patch/280410/
http://patchwork.ozlabs.org/patch/280409/
http://patchwork.ozlabs.org/patch/280408/
http://patchwork.ozlabs.org/patch/280406/
http://patchwork.ozlabs.org/patch/280407/

I apologies for the inconvience.

Ryan Barnett <rjbarnet@rockwellcollins.com> wrote on 10/03/2013 08:12:04 
PM:

[...]

Thanks,
-Ryan

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

* [Buildroot] [PATCH 1/5] python-pyasn: new package
  2013-10-03 21:17   ` Thomas Petazzoni
@ 2013-10-03 22:39     ` Ryan Barnett
  0 siblings, 0 replies; 12+ messages in thread
From: Ryan Barnett @ 2013-10-03 22:39 UTC (permalink / raw)
  To: buildroot

Thomas,

Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote on
10/03/2013 04:17:55 PM:

> Dear Ryan Barnett,
> 
> On Thu, 3 Oct 2013 15:01:01 -0500, Ryan Barnett wrote:
> 
> > +      CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
> > +      CXX="$(TARGET_CXX)" \
> > +      CXXFLAGS="$(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include" \
> > +      LDSHARED="$(TARGET_CC) -shared" \
> > +      LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/lib -L$
> (STAGING_DIR)/usr/lib" \
> 
> These additional -I and -L are rather weird because they simply pass
> what are already the default search paths for headers and libraries.

The additional -I and -L are needed to ensure that the $(STAGING_DIR)
header and library files are pulled. Otherwise the distutils package 
before the ones that the distutils package will find the 
headers/libraries that are located at $(HOST_DIR)/usr.

I've added this comment to both pyasn and pycrypto. I'm not a fan
of it but I don't really want to rewrite the setup.py in order to 
support cross compiling.

> Thomas
> -- 
> Thomas Petazzoni, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

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

* [Buildroot] [PATCH 1/5] python-pyasn: new package
  2013-10-03 20:01 ` [Buildroot] [PATCH 1/5] python-pyasn: new package Ryan Barnett
@ 2013-10-03 21:17   ` Thomas Petazzoni
  2013-10-03 22:39     ` Ryan Barnett
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2013-10-03 21:17 UTC (permalink / raw)
  To: buildroot

Dear Ryan Barnett,

On Thu, 3 Oct 2013 15:01:01 -0500, Ryan Barnett wrote:

> +		CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
> +		CXX="$(TARGET_CXX)" \
> +		CXXFLAGS="$(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include" \
> +		LDSHARED="$(TARGET_CC) -shared" \
> +		LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \

These additional -I and -L are rather weird because they simply pass
what are already the default search paths for headers and libraries.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/5] python-pyasn: new package
  2013-10-03 20:01 Ryan Barnett
@ 2013-10-03 20:01 ` Ryan Barnett
  2013-10-03 21:17   ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Ryan Barnett @ 2013-10-03 20:01 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Ryan Barnett <rjbarnet@rockwellcollins.com>

---

The definition of CFLAGS/LDFLAGS/LDSHARED is necessary since the
compilation of won't work correctly using either TARGET_CONFIGURE_OPTS
because it won't link against the correct python library. Also using
python-distutilcross doesn't work as the setup.py doesn't understand
the -x option.

---
 package/Config.in                    |    1 +
 package/python-pyasn/Config.in       |   13 +++++++++++
 package/python-pyasn/python-pyasn.mk |   38 ++++++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100644 package/python-pyasn/Config.in
 create mode 100644 package/python-pyasn/python-pyasn.mk

diff --git a/package/Config.in b/package/Config.in
index b7fdb89..3592cb7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -396,6 +396,7 @@ source "package/python-meld3/Config.in"
 source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
 source "package/python-protobuf/Config.in"
+source "package/python-pyasn/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
diff --git a/package/python-pyasn/Config.in b/package/python-pyasn/Config.in
new file mode 100644
index 0000000..a352fe4
--- /dev/null
+++ b/package/python-pyasn/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYASN
+	bool "python-pyasn"
+	depends on BR2_PACKAGE_PYTHON
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  PyASN is a Python extension module that enables you to
+	  perform very fast IP address to Autonomous System Number
+	  lookups.
+
+	  https://code.google.com/p/pyasn/
+
+comment "python-pyasn requires C++ support in toolchain"
+        depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/python-pyasn/python-pyasn.mk b/package/python-pyasn/python-pyasn.mk
new file mode 100644
index 0000000..4579f38
--- /dev/null
+++ b/package/python-pyasn/python-pyasn.mk
@@ -0,0 +1,38 @@
+################################################################################
+#
+# python-pyasn
+#
+################################################################################
+
+PYTHON_PYASN_VERSION = 1.2
+PYTHON_PYASN_SOURCE  = PyASN-$(PYTHON_PYASN_VERSION).zip
+PYTHON_PYASN_SITE    = https://pyasn.googlecode.com/files
+PYTHON_PYASN_LICENSE = LGPL
+
+PYTHON_PYASN_DEPENDENCIES = python
+
+define PYTHON_PYASN_EXTRACT_CMDS
+	unzip -d $(@D) $(DL_DIR)/$(PYTHON_PYASN_SOURCE)
+	mv $(@D)/PyASN-$(PYTHON_PYASN_VERSION)/* $(@D)
+	$(RM) -r $(@D)/PyASN-$(PYTHON_PYASN_VERSION)
+endef
+
+define PYTHON_PYASN_BUILD_CMDS
+	(cd $(@D); \
+		CC="$(TARGET_CC)" \
+		CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
+		CXX="$(TARGET_CXX)" \
+		CXXFLAGS="$(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include" \
+		LDSHARED="$(TARGET_CC) -shared" \
+		LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
+		$(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_PYASN_INSTALL_TARGET_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))
-- 
1.7.1

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

end of thread, other threads:[~2013-10-04 14:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-04  1:12 [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
2013-10-04  1:12 ` [Buildroot] [PATCH 1/5] python-pyasn: new package Ryan Barnett
2013-10-04  2:27   ` Danomi Manchego
2013-10-04 14:09     ` Ryan Barnett
2013-10-04  1:12 ` [Buildroot] [PATCH 2/5] python-pycrypto: " Ryan Barnett
2013-10-04  1:12 ` [Buildroot] [PATCH 3/5] python-pysnmp: " Ryan Barnett
2013-10-04  1:12 ` [Buildroot] [PATCH 4/5] python-pysnmp-apps: " Ryan Barnett
2013-10-04  1:12 ` [Buildroot] [PATCH 5/5] python-pysnmp-mibs: " Ryan Barnett
2013-10-04 14:25 ` [Buildroot] [PATCH 0/5] Introduce New Package PySnmp Ryan Barnett
  -- strict thread matches above, loose matches on Subject: below --
2013-10-03 20:01 Ryan Barnett
2013-10-03 20:01 ` [Buildroot] [PATCH 1/5] python-pyasn: new package Ryan Barnett
2013-10-03 21:17   ` Thomas Petazzoni
2013-10-03 22:39     ` Ryan Barnett

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.