aboutsummaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authorAlexandru Ardelean <ardeleanalex@gmail.com>2017-05-17 16:45:48 +0300
committerAlexandru Ardelean <ardeleanalex@gmail.com>2017-05-17 16:51:14 +0300
commit68312f49c0b4456e665ed438a86a44738caa765a (patch)
tree6280a9fb0de5782ca8ca4ca39b014062e1b8d387 /lang/python
parent1bf7af4ca53db6f58655857f6eb49a9893c854d9 (diff)
python packages: move all things python under lang/python
I admit this may be be a bit aggressive, but the lang folder is getting cluttered/filled up with Python, PHP, Perl, Ruby, etc. packages. Makes sense to try to group them into per-lang folders. I took the Pythons. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/chardet/Makefile53
-rw-r--r--lang/python/django-appconf/Makefile48
-rw-r--r--lang/python/django-compressor/Makefile49
-rw-r--r--lang/python/django-constance/Makefile48
-rw-r--r--lang/python/django-jsonfield/Makefile48
-rw-r--r--lang/python/django-picklefield/Makefile48
-rw-r--r--lang/python/django-postoffice/Makefile49
-rw-r--r--lang/python/django-restframework/Makefile49
-rw-r--r--lang/python/django-statici18n/Makefile48
-rw-r--r--lang/python/django/Makefile65
-rw-r--r--lang/python/et_xmlfile/Makefile48
-rw-r--r--lang/python/flup/Makefile48
-rw-r--r--lang/python/gunicorn/Makefile53
-rw-r--r--lang/python/jdcal/Makefile48
-rw-r--r--lang/python/micropython-lib/Makefile54
-rw-r--r--lang/python/micropython/Makefile57
-rw-r--r--lang/python/micropython/patches/000-Makefile-no-errors13
-rw-r--r--lang/python/openpyxl/Makefile48
-rw-r--r--lang/python/pillow/Makefile53
-rw-r--r--lang/python/pillow/patches/010-fix-paths.patch182
-rw-r--r--lang/python/python-attrs/Makefile47
-rw-r--r--lang/python/python-cffi/Makefile96
-rw-r--r--lang/python/python-crcmod/Makefile50
-rw-r--r--lang/python/python-crypto/Makefile54
-rw-r--r--lang/python/python-crypto/patches/001-no-host-paths.patch11
-rw-r--r--lang/python/python-crypto/patches/002-fix-endianness-detect.patch13
-rw-r--r--lang/python/python-cryptography/Makefile53
-rw-r--r--lang/python/python-cryptography/patches/001-disable-setup-requirements.patch12
-rw-r--r--lang/python/python-dateutil/Makefile48
-rw-r--r--lang/python/python-dns/Makefile44
-rw-r--r--lang/python/python-egenix-mx-base/Makefile55
-rw-r--r--lang/python/python-enum34/Makefile51
-rw-r--r--lang/python/python-enum34/patches/001-omit-docs.patch19
-rw-r--r--lang/python/python-gmpy2/Makefile49
-rw-r--r--lang/python/python-idna/Makefile48
-rw-r--r--lang/python/python-ipaddress/Makefile44
-rw-r--r--lang/python/python-ldap/Makefile59
-rw-r--r--lang/python/python-ldap/patches/010-setup_cfg.patch16
-rw-r--r--lang/python/python-mysql/Makefile50
-rw-r--r--lang/python/python-mysql/patches/010-threadsafe.patch11
-rw-r--r--lang/python/python-packages/Makefile130
-rw-r--r--lang/python/python-packages/README.md72
-rw-r--r--lang/python/python-parsley/Makefile43
-rw-r--r--lang/python/python-parsley/patches/001-omit-tests.patch12
-rw-r--r--lang/python/python-pcapy/Makefile47
-rw-r--r--lang/python/python-ply/Makefile96
-rw-r--r--lang/python/python-psycopg2/Makefile55
-rw-r--r--lang/python/python-pyasn1-modules/Makefile46
-rw-r--r--lang/python/python-pyasn1/Makefile48
-rw-r--r--lang/python/python-pycparser/Makefile97
-rw-r--r--lang/python/python-pycparser/patches/001-use-external-ply.patch41
-rw-r--r--lang/python/python-pyopenssl/Makefile45
-rw-r--r--lang/python/python-pyptlib/Makefile46
-rw-r--r--lang/python/python-pyserial/Makefile50
-rw-r--r--lang/python/python-service-identity/Makefile46
-rw-r--r--lang/python/python-six/Makefile48
-rw-r--r--lang/python/python-txsocksx/Makefile49
-rw-r--r--lang/python/python-txsocksx/patches/001-omit-tests.patch11
-rw-r--r--lang/python/python-txsocksx/patches/002-do-not-use-vcversioner.patch29
-rw-r--r--lang/python/python-urllib3/Makefile49
-rw-r--r--lang/python/python-yaml/Makefile43
-rw-r--r--lang/python/python/Makefile (renamed from lang/python/Makefile)0
-rw-r--r--lang/python/python/files/config.site (renamed from lang/python/files/config.site)0
-rw-r--r--lang/python/python/files/pip.conf (renamed from lang/python/files/pip.conf)0
-rw-r--r--lang/python/python/files/python-host.mk (renamed from lang/python/files/python-host.mk)0
-rw-r--r--lang/python/python/files/python-package-codecs.mk (renamed from lang/python/files/python-package-codecs.mk)0
-rw-r--r--lang/python/python/files/python-package-compiler.mk (renamed from lang/python/files/python-package-compiler.mk)0
-rw-r--r--lang/python/python/files/python-package-ctypes.mk (renamed from lang/python/files/python-package-ctypes.mk)0
-rw-r--r--lang/python/python/files/python-package-db.mk (renamed from lang/python/files/python-package-db.mk)0
-rw-r--r--lang/python/python/files/python-package-decimal.mk (renamed from lang/python/files/python-package-decimal.mk)0
-rw-r--r--lang/python/python/files/python-package-dev.mk (renamed from lang/python/files/python-package-dev.mk)0
-rw-r--r--lang/python/python/files/python-package-distutils.mk (renamed from lang/python/files/python-package-distutils.mk)0
-rw-r--r--lang/python/python/files/python-package-email.mk (renamed from lang/python/files/python-package-email.mk)0
-rw-r--r--lang/python/python/files/python-package-gdbm.mk (renamed from lang/python/files/python-package-gdbm.mk)0
-rw-r--r--lang/python/python/files/python-package-install.sh (renamed from lang/python/files/python-package-install.sh)0
-rw-r--r--lang/python/python/files/python-package-lib2to3.mk (renamed from lang/python/files/python-package-lib2to3.mk)0
-rw-r--r--lang/python/python/files/python-package-logging.mk (renamed from lang/python/files/python-package-logging.mk)0
-rw-r--r--lang/python/python/files/python-package-multiprocessing.mk (renamed from lang/python/files/python-package-multiprocessing.mk)0
-rw-r--r--lang/python/python/files/python-package-ncurses.mk (renamed from lang/python/files/python-package-ncurses.mk)0
-rw-r--r--lang/python/python/files/python-package-openssl.mk (renamed from lang/python/files/python-package-openssl.mk)0
-rw-r--r--lang/python/python/files/python-package-pip.mk (renamed from lang/python/files/python-package-pip.mk)0
-rw-r--r--lang/python/python/files/python-package-pydoc.mk (renamed from lang/python/files/python-package-pydoc.mk)0
-rw-r--r--lang/python/python/files/python-package-setuptools.mk (renamed from lang/python/files/python-package-setuptools.mk)0
-rw-r--r--lang/python/python/files/python-package-sqlite3.mk (renamed from lang/python/files/python-package-sqlite3.mk)0
-rw-r--r--lang/python/python/files/python-package-unittest.mk (renamed from lang/python/files/python-package-unittest.mk)0
-rw-r--r--lang/python/python/files/python-package-xml.mk (renamed from lang/python/files/python-package-xml.mk)0
-rw-r--r--lang/python/python/files/python-package.mk (renamed from lang/python/files/python-package.mk)0
-rw-r--r--lang/python/python/files/python-version.mk (renamed from lang/python/files/python-version.mk)0
-rw-r--r--lang/python/python/patches/001-enable-zlib.patch (renamed from lang/python/patches/001-enable-zlib.patch)0
-rw-r--r--lang/python/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch (renamed from lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch)0
-rw-r--r--lang/python/python/patches/003-do-not-compile-tests-at-build.patch (renamed from lang/python/patches/003-do-not-compile-tests-at-build.patch)0
-rw-r--r--lang/python/python/patches/004-do-not-write-bytes-codes.patch (renamed from lang/python/patches/004-do-not-write-bytes-codes.patch)0
-rw-r--r--lang/python/python/patches/006-remove-debian-multiarch-support.patch (renamed from lang/python/patches/006-remove-debian-multiarch-support.patch)0
-rw-r--r--lang/python/python/patches/007-distutils-do-not-adjust-path.patch (renamed from lang/python/patches/007-distutils-do-not-adjust-path.patch)0
-rw-r--r--lang/python/python/patches/008-distutils-use-python-sysroot.patch (renamed from lang/python/patches/008-distutils-use-python-sysroot.patch)0
-rw-r--r--lang/python/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch (renamed from lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch)0
-rw-r--r--lang/python/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch (renamed from lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch)0
-rw-r--r--lang/python/python/patches/011-remove-setupterm-definition.patch (renamed from lang/python/patches/011-remove-setupterm-definition.patch)0
-rw-r--r--lang/python/python3-bottle/Makefile52
-rw-r--r--lang/python/python3/Makefile305
-rw-r--r--lang/python/python3/files/config.site12
-rw-r--r--lang/python/python3/files/python3-host.mk81
-rw-r--r--lang/python/python3/files/python3-package-asyncio.mk16
-rw-r--r--lang/python/python3/files/python3-package-codecs.mk22
-rw-r--r--lang/python/python3/files/python3-package-ctypes.mk18
-rw-r--r--lang/python/python3/files/python3-package-dbm.mk17
-rw-r--r--lang/python/python3/files/python3-package-decimal.mk17
-rw-r--r--lang/python/python3/files/python3-package-dev.mk27
-rw-r--r--lang/python/python3/files/python3-package-distutils.mk16
-rw-r--r--lang/python/python3/files/python3-package-email.mk16
-rw-r--r--lang/python/python3/files/python3-package-gdbm.mk16
-rw-r--r--lang/python/python3/files/python3-package-install.sh69
-rw-r--r--lang/python/python3/files/python3-package-lib2to3.mk18
-rw-r--r--lang/python/python3/files/python3-package-logging.mk16
-rw-r--r--lang/python/python3/files/python3-package-lzma.mk17
-rw-r--r--lang/python/python3/files/python3-package-multiprocessing.mk17
-rw-r--r--lang/python/python3/files/python3-package-ncurses.mk18
-rw-r--r--lang/python/python3/files/python3-package-openssl.mk17
-rw-r--r--lang/python/python3/files/python3-package-pip.mk28
-rw-r--r--lang/python/python3/files/python3-package-pydoc.mk18
-rw-r--r--lang/python/python3/files/python3-package-setuptools.mk31
-rw-r--r--lang/python/python3/files/python3-package-sqlite3.mk17
-rw-r--r--lang/python/python3/files/python3-package-unittest.mk16
-rw-r--r--lang/python/python3/files/python3-package-xml.mk19
-rw-r--r--lang/python/python3/files/python3-package.mk137
-rw-r--r--lang/python/python3/files/python3-version.mk17
-rw-r--r--lang/python/python3/patches/001-enable-zlib.patch25
-rw-r--r--lang/python/python3/patches/003-do-not-run-distutils-tests.patch46
-rw-r--r--lang/python/python3/patches/004-do-not-write-bytes-codes.patch22
-rw-r--r--lang/python/python3/patches/006-remove-debian-multiarch-support.patch12
-rw-r--r--lang/python/python3/patches/007-distutils-do-not-adjust-path.patch10
-rw-r--r--lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch15
-rw-r--r--lang/python/python3/patches/011-fix-ncursesw-definition-colisions.patch12
-rw-r--r--lang/python/python3/patches/012-disable-wcsftime-detection.patch13
-rw-r--r--lang/python/python3/patches/014-remove-platform-so-suffix.patch26
-rw-r--r--lang/python/python3/patches/015-abort-on-failed-modules.patch12
-rw-r--r--lang/python/python3/patches/016-adjust-config-paths.patch72
-rw-r--r--lang/python/pytz/Makefile48
-rw-r--r--lang/python/rcssmin/Makefile57
-rw-r--r--lang/python/simplejson/Makefile48
-rw-r--r--lang/python/twisted/Makefile58
-rw-r--r--lang/python/twisted/patches/001-fix-zsh-completion.patch10
-rw-r--r--lang/python/twisted/patches/002-omit-tests.patch41
-rw-r--r--lang/python/zope-interface/Makefile56
144 files changed, 4695 insertions, 0 deletions
diff --git a/lang/python/chardet/Makefile b/lang/python/chardet/Makefile
new file mode 100644
index 000000000..6343b4e73
--- /dev/null
+++ b/lang/python/chardet/Makefile
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=chardet
+PKG_VERSION:=2.3.0
+PKG_RELEASE:=1
+PKG_LICENSE:=LGPL-2.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/c/chardet/
+PKG_MD5SUM:=25274d664ccb5130adae08047416e1a8
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/chardet
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Universal encoding detector for Python 2 and 3
+ URL:=https://github.com/chardet/chardet
+ DEPENDS:=+python
+endef
+
+define Package/chardet/description
+ Universal encoding detector for Python 2 and 3
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/chardet/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chardetect \
+ $(1)/usr/bin
+ # fix python exec path in scripts
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/chardetect
+endef
+
+$(eval $(call BuildPackage,chardet))
diff --git a/lang/python/django-appconf/Makefile b/lang/python/django-appconf/Makefile
new file mode 100644
index 000000000..c06fa6a97
--- /dev/null
+++ b/lang/python/django-appconf/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-appconf
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/34/b9/d07195652ab494b026f7cb0341dd6e5f2e6e39be177abe05e2cec8bd46e4/
+PKG_MD5SUM:=cc11511a47088bc56531df67cd5d6261
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-appconf
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=A helper class for handling configuration defaults of packaged apps gracefully.
+ URL:=http://django-appconf.readthedocs.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-appconf/description
+ A helper class for handling configuration defaults of packaged apps gracefully.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-appconf/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-appconf))
diff --git a/lang/python/django-compressor/Makefile b/lang/python/django-compressor/Makefile
new file mode 100644
index 000000000..9cbceaf6a
--- /dev/null
+++ b/lang/python/django-compressor/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2007-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-compressor
+PKG_VERSION:=2.1.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=django_compressor-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/38/58/03098a826062b856956c7169a8f778ec2b8e2767ddc63da0629062df5621/
+PKG_BUILD_DIR:=$(BUILD_DIR)/django_compressor-$(PKG_VERSION)/
+PKG_MD5SUM:=5e74141076b70272149ed07e6ce0ea56
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-compressor
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Compresses linked and inline JavaScript or CSS into single cached files.
+ URL:=http://django-compressor.readthedocs.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-compressor/description
+ Compresses linked and inline JavaScript or CSS into single cached files.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-compressor/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-compressor))
diff --git a/lang/python/django-constance/Makefile b/lang/python/django-constance/Makefile
new file mode 100644
index 000000000..623cd4cf6
--- /dev/null
+++ b/lang/python/django-constance/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-constance
+PKG_VERSION:=1.3.4
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/0c/19/74c6bbf29a7882bab377db7a4ca30b43e09173dc1e6cabe163dc8d6a3931/
+PKG_MD5SUM:=2e197701ed93082e5fa41df0f4742294
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-constance
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Django live settings with pluggable backends, including Redis.
+ URL:=https://github.com/jazzband/django-constance
+ DEPENDS:=+python +django
+endef
+
+define Package/django-constance/description
+ Django live settings with pluggable backends, including Redis.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-constance/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-constance))
diff --git a/lang/python/django-jsonfield/Makefile b/lang/python/django-jsonfield/Makefile
new file mode 100644
index 000000000..40a9ff7cf
--- /dev/null
+++ b/lang/python/django-jsonfield/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-jsonfield
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/e4/b2/a079f0a2218e0eb7892edbf404e0bbfbb281a6bbf06966b775f5142ed159/
+PKG_MD5SUM:=2e5e737a3f93f3b5d7ae6026b1340167
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-jsonfield
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=JSONField for django models
+ URL:=https://github.com/bradjasper/django-jsonfield
+ DEPENDS:=+python +django
+endef
+
+define Package/django-jsonfield/description
+ JSONField for django models
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-jsonfield/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-jsonfield))
diff --git a/lang/python/django-picklefield/Makefile b/lang/python/django-picklefield/Makefile
new file mode 100644
index 000000000..0747796ea
--- /dev/null
+++ b/lang/python/django-picklefield/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-picklefield
+PKG_VERSION:=0.3.2
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/d/django-picklefield/
+PKG_MD5SUM:=b2c17ca9e03704ce33890e6aefc7b2e5
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-picklefield
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Pickled object field for Django
+ URL:=http://github.com/gintas/django-picklefield/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-picklefield/description
+ Pickled object field for Django
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-picklefield/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-picklefield))
diff --git a/lang/python/django-postoffice/Makefile b/lang/python/django-postoffice/Makefile
new file mode 100644
index 000000000..18dce3632
--- /dev/null
+++ b/lang/python/django-postoffice/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-postoffice
+PKG_VERSION:=2.0.8
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=django-post_office-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/52/25/cc0cfe923f183d7c19b162cac3bf8430ddaed7bad28202b8f93a97d248a4/
+PKG_BUILD_DIR:=$(BUILD_DIR)/django-post_office-$(PKG_VERSION)/
+PKG_MD5SUM:=437bf62cef06381d346ae2bc087c0e3c
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-postoffice
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=A Django app to monitor and send mail asynchronously, complete with template support.
+ URL:=https://github.com/ui/django-postoffice
+ DEPENDS:=+python +django +django-jsonfield
+endef
+
+define Package/django-postoffice/description
+ A Django app to monitor and send mail asynchronously, complete with template support.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-postoffice/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-postoffice))
diff --git a/lang/python/django-restframework/Makefile b/lang/python/django-restframework/Makefile
new file mode 100644
index 000000000..bdf2ebe2c
--- /dev/null
+++ b/lang/python/django-restframework/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2007-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-restframework
+PKG_VERSION:=3.5.4
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=djangorestframework-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/e9/24/86dfe19fb82a40a3d7a4c50371a8bd85b9277d3506698bf332a6d41d08f6/
+PKG_BUILD_DIR:=$(BUILD_DIR)/djangorestframework-$(PKG_VERSION)
+PKG_MD5SUM:=979808c387dad8d0ebb6025c39dc7b94
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-restframework
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Web APIs for Django, made easy.
+ URL:=http://www.django-rest-framework.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-restframework/description
+ Web APIs for Django, made easy.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-restframework/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-restframework))
diff --git a/lang/python/django-statici18n/Makefile b/lang/python/django-statici18n/Makefile
new file mode 100644
index 000000000..da519be7a
--- /dev/null
+++ b/lang/python/django-statici18n/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-statici18n
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/86/6b/2c2e86a7e144ba7b064119eaafb2c8c67665c2a0e722f0819daa9657e551/
+PKG_MD5SUM:=61e22a6f2399f9f829308e4d91b36ee0
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-statici18n
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=A Django app that provides helper for generating JavaScript catalog to static files.
+ URL:=http://django-statici18n.readthedocs.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-statici18n/description
+ A Django app that provides helper for generating JavaScript catalog to static files.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-statici18n/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-statici18n))
diff --git a/lang/python/django/Makefile b/lang/python/django/Makefile
new file mode 100644
index 000000000..d208e18ae
--- /dev/null
+++ b/lang/python/django/Makefile
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2007-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django
+PKG_VERSION:=1.8.17
+PKG_RELEASE=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/django/django.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=d3d12fc11da56e4ea8af37a22a9a0aa6579ab2d5
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=The web framework for perfectionists with deadlines.
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ URL:=https://www.djangoproject.com/
+ DEPENDS:=+python
+endef
+
+define Package/django/description
+ The web framework for perfectionists with deadlines.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
+ $(1)/usr/bin
+endef
+
+define Package/django/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
+ $(1)/usr/bin
+ # fix python exec path
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/django-admin.py
+endef
+
+$(eval $(call BuildPackage,django))
diff --git a/lang/python/et_xmlfile/Makefile b/lang/python/et_xmlfile/Makefile
new file mode 100644
index 000000000..f0c013970
--- /dev/null
+++ b/lang/python/et_xmlfile/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=et_xmlfile
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/e/et_xmlfile/
+PKG_MD5SUM:=f47940fd9d556375420b2e276476cfaf
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/et_xmlfile
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=An implementation of lxml.xmlfile for the standard library
+ URL:=https://bitbucket.org/openpyxl/et_xmlfile
+ DEPENDS:=+python
+endef
+
+define Package/et_xmlfile/description
+ An implementation of lxml.xmlfile for the standard library
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/et_xmlfile/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,et_xmlfile))
diff --git a/lang/python/flup/Makefile b/lang/python/flup/Makefile
new file mode 100644
index 000000000..b0514f4fb
--- /dev/null
+++ b/lang/python/flup/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=flup
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/f/flup/
+PKG_MD5SUM:=24dad7edc5ada31dddd49456ee8d5254
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/flup
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Random assortment of WSGI servers
+ URL:=http://www.saddi.com/software/flup/
+ DEPENDS:=+python
+endef
+
+define Package/flup/description
+ Random assortment of WSGI servers
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/flup/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,flup))
diff --git a/lang/python/gunicorn/Makefile b/lang/python/gunicorn/Makefile
new file mode 100644
index 000000000..efdf9f4ad
--- /dev/null
+++ b/lang/python/gunicorn/Makefile
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gunicorn
+PKG_VERSION:=19.6.0
+PKG_RELEASE=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/84/ce/7ea5396efad1cef682bbc4068e72a0276341d9d9d0f501da609fab9fcb80/
+PKG_MD5SUM:=338e5e8a83ea0f0625f768dba4597530
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/gunicorn
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=WSGI HTTP Server for UNIX
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ URL:=http://gunicorn.org/
+ DEPENDS:=+python +python-setuptools
+endef
+
+define Package/gunicorn/description
+ WSGI HTTP Server for UNIX
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/gunicorn/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gunicorn* \
+ $(1)/usr/bin
+ # fix python exec path in scripts
+ $(SED) 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/gunicorn*
+endef
+
+$(eval $(call BuildPackage,gunicorn))
diff --git a/lang/python/jdcal/Makefile b/lang/python/jdcal/Makefile
new file mode 100644
index 000000000..34d3970fc
--- /dev/null
+++ b/lang/python/jdcal/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=jdcal
+PKG_VERSION:=1.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/j/jdcal/
+PKG_MD5SUM:=ab8d5ba300fd1eb01514f363d19b1eb9
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/jdcal
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Julian dates from proleptic Gregorian and Julian calendars.
+ URL:=http://github.com/phn/jdcal
+ DEPENDS:=+python
+endef
+
+define Package/jdcal/description
+ Julian dates from proleptic Gregorian and Julian calendars.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/jdcal/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,jdcal))
diff --git a/lang/python/micropython-lib/Makefile b/lang/python/micropython-lib/Makefile
new file mode 100644
index 000000000..989506ae9
--- /dev/null
+++ b/lang/python/micropython-lib/Makefile
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=micropython-lib
+PKG_VERSION=1.8.6-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=MIT, PSFL
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
+PKG_SOURCE_VERSION:=f81e979c56dddb771ad36ec381b7f2c6cd12111f
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/micropython-lib
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=micropython-lib
+ URL:=https://github.com/micropython/micropython-lib
+ DEPENDS:=+micropython
+endef
+
+define Package/micropython-lib/description
+ This package contains micropython-lib, a project to develop a non-monolothic
+ standard library for Micro Python. Note that this is a work in progress and
+ several libraries may be missing, incomplete or buggy.
+endef
+
+MAKE_FLAGS:=\
+ PREFIX=$(PKG_BUILD_DIR)/_install_tmp/dist \
+ install
+
+define Package/micropython-lib/install
+ $(INSTALL_DIR) $(1)/usr/lib/micropython
+ $(CP) $(PKG_BUILD_DIR)/_install_tmp/dist/* $(1)/usr/lib/micropython
+endef
+
+$(eval $(call BuildPackage,micropython-lib))
+
diff --git a/lang/python/micropython/Makefile b/lang/python/micropython/Makefile
new file mode 100644
index 000000000..7ee58827d
--- /dev/null
+++ b/lang/python/micropython/Makefile
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=micropython
+PKG_VERSION=1.8.6-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/micropython/micropython.git
+PKG_SOURCE_VERSION:=5a1d63fc14dae788f705403a43c2d8639b7dd9cd
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/micropython
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Micro Python
+ URL:=http://micropython.org
+ DEPENDS:=+libffi
+endef
+
+define Package/micropython/description
+ This package contains Micro Python, a lean and fast implementation of the Python 3.4 programming language
+ that is optimised to run on a microcontroller (and low power computers).
+endef
+
+
+MAKE_FLAGS += -C $(PKG_BUILD_DIR)/unix
+
+define Build/Compile
+ $(call Build/Compile/Default,axtls)
+ $(call Build/Compile/Default)
+
+endef
+
+define Package/micropython/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/unix/micropython $(1)/usr/bin/micropython
+endef
+
+$(eval $(call BuildPackage,micropython))
diff --git a/lang/python/micropython/patches/000-Makefile-no-errors b/lang/python/micropython/patches/000-Makefile-no-errors
new file mode 100644
index 000000000..765f3e701
--- /dev/null
+++ b/lang/python/micropython/patches/000-Makefile-no-errors
@@ -0,0 +1,13 @@
+Index: micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755/unix/Makefile
+===================================================================
+--- micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755.orig/unix/Makefile 2016-11-17 02:43:13.000000000 +0100
++++ micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755/unix/Makefile 2016-11-17 16:49:02.937809018 +0100
+@@ -21,7 +21,7 @@
+ INC += -I$(BUILD)
+
+ # compiler settings
+-CWARN = -Wall -Werror
++CWARN = -Wall
+ CWARN += -Wpointer-arith -Wuninitialized
+ CFLAGS = $(INC) $(CWARN) -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) $(CFLAGS_EXTRA)
+
diff --git a/lang/python/openpyxl/Makefile b/lang/python/openpyxl/Makefile
new file mode 100644
index 000000000..ccfcae507
--- /dev/null
+++ b/lang/python/openpyxl/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=openpyxl
+PKG_VERSION:=2.4.2
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/56/c6/a2a7c36196e4732acceca093ce5961db907f5a855b557d6a727a7f59b8b4/
+PKG_MD5SUM:=28b6b5f74f01e6249e8c7f526c57a2e7
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/openpyxl
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=A Python library to read/write Excel 2010 xlsx/xlsm files
+ URL:=https://openpyxl.readthedocs.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/openpyxl/description
+ A Python library to read/write Excel 2010 xlsx/xlsm files
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/openpyxl/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,openpyxl))
diff --git a/lang/python/pillow/Makefile b/lang/python/pillow/Makefile
new file mode 100644
index 000000000..ee40d6c16
--- /dev/null
+++ b/lang/python/pillow/Makefile
@@ -0,0 +1,53 @@
+#
+# Copyright © 1997-2011 by Secret Labs AB
+# Copyright © 1995-2011 by Fredrik Lundh
+# Copyright © 2016 by Alex Clark and contributors
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pillow
+PKG_VERSION:=3.3.1
+PKG_RELEASE=1
+PKG_LICENSE:=CUSTOM
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/python-pillow/Pillow.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=aab33141f381d5577cdef9033b7fdff79122a10c
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/pillow
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=The friendly PIL fork
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ URL:=https://python-pillow.org/
+ DEPENDS:=+python +libfreetype +libjpeg +zlib +libtiff
+endef
+
+define Package/pillow/description
+ The friendly PIL fork
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/pillow/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)/
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/LICENSE $(1)$(PYTHON_PKG_DIR)/PIL/
+endef
+
+$(eval $(call BuildPackage,pillow))
diff --git a/lang/python/pillow/patches/010-fix-paths.patch b/lang/python/pillow/patches/010-fix-paths.patch
new file mode 100644
index 000000000..a6b86bfe6
--- /dev/null
+++ b/lang/python/pillow/patches/010-fix-paths.patch
@@ -0,0 +1,182 @@
+diff -rupN pillow-3.3.1.orig/setup.py pillow-3.3.1/setup.py
+--- pillow-3.3.1.orig/setup.py 2016-08-22 17:45:05.000000000 +0200
++++ pillow-3.3.1/setup.py 2016-08-22 18:09:51.947745155 +0200
+@@ -111,12 +111,12 @@ except (ImportError, OSError):
+
+ NAME = 'Pillow'
+ PILLOW_VERSION = '3.3.1'
+-JPEG_ROOT = None
++JPEG_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+ JPEG2K_ROOT = None
+-ZLIB_ROOT = None
++ZLIB_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+ IMAGEQUANT_ROOT = None
+-TIFF_ROOT = None
+-FREETYPE_ROOT = None
++TIFF_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
++FREETYPE_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+ LCMS_ROOT = None
+
+
+@@ -221,161 +221,6 @@ class pil_build_ext(build_ext):
+ _add_directory(include_dirs, os.path.join(prefix, "include"))
+
+ #
+- # add platform directories
+-
+- if self.disable_platform_guessing:
+- pass
+-
+- elif sys.platform == "cygwin":
+- # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory
+- _add_directory(library_dirs,
+- os.path.join("/usr/lib", "python%s" %
+- sys.version[:3], "config"))
+-
+- elif sys.platform == "darwin":
+- # attempt to make sure we pick freetype2 over other versions
+- _add_directory(include_dirs, "/sw/include/freetype2")
+- _add_directory(include_dirs, "/sw/lib/freetype2/include")
+- # fink installation directories
+- _add_directory(library_dirs, "/sw/lib")
+- _add_directory(include_dirs, "/sw/include")
+- # darwin ports installation directories
+- _add_directory(library_dirs, "/opt/local/lib")
+- _add_directory(include_dirs, "/opt/local/include")
+-
+- # if Homebrew is installed, use its lib and include directories
+- try:
+- prefix = subprocess.check_output(['brew', '--prefix']).strip(
+- ).decode('latin1')
+- except:
+- # Homebrew not installed
+- prefix = None
+-
+- ft_prefix = None
+-
+- if prefix:
+- # add Homebrew's include and lib directories
+- _add_directory(library_dirs, os.path.join(prefix, 'lib'))
+- _add_directory(include_dirs, os.path.join(prefix, 'include'))
+- ft_prefix = os.path.join(prefix, 'opt', 'freetype')
+-
+- if ft_prefix and os.path.isdir(ft_prefix):
+- # freetype might not be linked into Homebrew's prefix
+- _add_directory(library_dirs, os.path.join(ft_prefix, 'lib'))
+- _add_directory(include_dirs,
+- os.path.join(ft_prefix, 'include'))
+- else:
+- # fall back to freetype from XQuartz if
+- # Homebrew's freetype is missing
+- _add_directory(library_dirs, "/usr/X11/lib")
+- _add_directory(include_dirs, "/usr/X11/include")
+-
+- elif sys.platform.startswith("linux"):
+- arch_tp = (plat.processor(), plat.architecture()[0])
+- if arch_tp == ("x86_64", "32bit"):
+- # 32-bit build on 64-bit machine.
+- _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
+- else:
+- for platform_ in arch_tp:
+-
+- if not platform_:
+- continue
+-
+- if platform_ in ["x86_64", "64bit"]:
+- _add_directory(library_dirs, "/lib64")
+- _add_directory(library_dirs, "/usr/lib64")
+- _add_directory(library_dirs,
+- "/usr/lib/x86_64-linux-gnu")
+- break
+- elif platform_ in ["i386", "i686", "32bit"]:
+- _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
+- break
+- elif platform_ in ["aarch64"]:
+- _add_directory(library_dirs, "/usr/lib64")
+- _add_directory(library_dirs,
+- "/usr/lib/aarch64-linux-gnu")
+- break
+- elif platform_ in ["arm", "armv7l"]:
+- _add_directory(library_dirs,
+- "/usr/lib/arm-linux-gnueabi")
+- break
+- elif platform_ in ["ppc64"]:
+- _add_directory(library_dirs, "/usr/lib64")
+- _add_directory(library_dirs,
+- "/usr/lib/ppc64-linux-gnu")
+- _add_directory(library_dirs,
+- "/usr/lib/powerpc64-linux-gnu")
+- break
+- elif platform_ in ["ppc"]:
+- _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
+- _add_directory(library_dirs,
+- "/usr/lib/powerpc-linux-gnu")
+- break
+- elif platform_ in ["s390x"]:
+- _add_directory(library_dirs, "/usr/lib64")
+- _add_directory(library_dirs,
+- "/usr/lib/s390x-linux-gnu")
+- break
+- elif platform_ in ["s390"]:
+- _add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
+- break
+- else:
+- raise ValueError(
+- "Unable to identify Linux platform: `%s`" % platform_)
+-
+- # XXX Kludge. Above /\ we brute force support multiarch. Here we
+- # try Barry's more general approach. Afterward, something should
+- # work ;-)
+- self.add_multiarch_paths()
+-
+- elif sys.platform.startswith("gnu"):
+- self.add_multiarch_paths()
+-
+- elif sys.platform.startswith("freebsd"):
+- _add_directory(library_dirs, "/usr/local/lib")
+- _add_directory(include_dirs, "/usr/local/include")
+-
+- elif sys.platform.startswith("netbsd"):
+- _add_directory(library_dirs, "/usr/pkg/lib")
+- _add_directory(include_dirs, "/usr/pkg/include")
+-
+- elif sys.platform.startswith("sunos5"):
+- _add_directory(library_dirs, "/opt/local/lib")
+- _add_directory(include_dirs, "/opt/local/include")
+-
+- # FIXME: check /opt/stuff directories here?
+-
+- # standard locations
+- if not self.disable_platform_guessing:
+- _add_directory(library_dirs, "/usr/local/lib")
+- _add_directory(include_dirs, "/usr/local/include")
+-
+- _add_directory(library_dirs, "/usr/lib")
+- _add_directory(include_dirs, "/usr/include")
+- # alpine, at least
+- _add_directory(library_dirs, "/lib")
+-
+- # on Windows, look for the OpenJPEG libraries in the location that
+- # the official installer puts them
+- if sys.platform == "win32":
+- program_files = os.environ.get('ProgramFiles', '')
+- best_version = (0, 0)
+- best_path = None
+- for name in os.listdir(program_files):
+- if name.startswith('OpenJPEG '):
+- version = tuple([int(x) for x in name[9:].strip().split(
+- '.')])
+- if version > best_version:
+- best_version = version
+- best_path = os.path.join(program_files, name)
+-
+- if best_path:
+- _dbg('Adding %s to search list', best_path)
+- _add_directory(library_dirs, os.path.join(best_path, 'lib'))
+- _add_directory(include_dirs,
+- os.path.join(best_path, 'include'))
+-
+- #
+ # insert new dirs *before* default libs, to avoid conflicts
+ # between Python PYD stub libs and real libraries
+
diff --git a/lang/python/python-attrs/Makefile b/lang/python/python-attrs/Makefile
new file mode 100644
index 000000000..87201581c
--- /dev/null
+++ b/lang/python/python-attrs/Makefile
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=attrs
+PKG_VERSION:=16.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/6b/71/1682316894ed80b362b9102e7a10997136d8dc1213c36a9f0515c451373a
+PKG_MD5SUM:=442b73d049af046ced010671b7bfd0e9
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-attrs
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-attrs
+ URL:=https://attrs.readthedocs.org/
+ DEPENDS:=+python-light
+endef
+
+define Package/python-attrs/description
+attrs is an MIT-licensed Python package with class decorators that ease
+the chores of implementing the most common attribute-related object
+protocols.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+$(eval $(call PyPackage,python-attrs))
+$(eval $(call BuildPackage,python-attrs))
diff --git a/lang/python/python-cffi/Makefile b/lang/python/python-cffi/Makefile
new file mode 100644
index 000000000..aa16f500c
--- /dev/null
+++ b/lang/python/python-cffi/Makefile
@@ -0,0 +1,96 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cffi
+PKG_VERSION:=1.8.3
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/0a/f3/686af8873b70028fccf67b15c78fd4e4667a3da995007afc71e786d61b0a
+PKG_HASH:=c321bd46faa7847261b89c0469569530cad5a41976bb6dba8202c0159f476568
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+HOST_BUILD_DEPENDS:=libffi/host python-pycparser/host
+ifdef CONFIG_PACKAGE_python-cffi
+HOST_BUILD_DEPENDS+=python/host
+endif
+ifdef CONFIG_PACKAGE_python3-cffi
+HOST_BUILD_DEPENDS+=python3/host
+endif
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+define Package/python-cffi/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=http://cffi.readthedocs.org/
+ DEPENDS:=+libffi
+endef
+
+define Package/python-cffi
+$(call Package/python-cffi/Default)
+ TITLE:=python-cffi
+ DEPENDS+=+python-light +python-pycparser
+ VARIANT:=python
+endef
+
+define Package/python3-cffi
+$(call Package/python-cffi/Default)
+ TITLE:=python3-cffi
+ DEPENDS+=+python3-light +python3-pycparser
+ VARIANT:=python3
+endef
+
+define Package/python-cffi/description
+Foreign Function Interface for Python calling C code.
+endef
+
+define Package/python3-cffi/description
+$(call Package/python-cffi/description)
+.
+(Variant for Python3)
+endef
+
+ifdef CONFIG_PACKAGE_python-cffi
+define Host/Compile/python-cffi
+ $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
+endef
+endif
+
+ifdef CONFIG_PACKAGE_python3-cffi
+define Host/Compile/python3-cffi
+ $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
+endef
+endif
+
+define Host/Compile
+$(call Host/Compile/python-cffi)
+$(call Host/Compile/python3-cffi)
+endef
+
+define Host/Install
+endef
+
+$(eval $(call HostBuild))
+
+$(eval $(call PyPackage,python-cffi))
+$(eval $(call BuildPackage,python-cffi))
+
+$(eval $(call Py3Package,python3-cffi))
+$(eval $(call BuildPackage,python3-cffi))
diff --git a/lang/python/python-crcmod/Makefile b/lang/python/python-crcmod/Makefile
new file mode 100644
index 000000000..03b9d6af6
--- /dev/null
+++ b/lang/python/python-crcmod/Makefile
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-crcmod
+PKG_VERSION:=1.7
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Micke Prag <micke.prag@telldus.se>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=crcmod-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/c/crcmod/
+PKG_MD5SUM:=2d5b92117d958dcead94f9e17f54cd32
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/crcmod-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-crcmod
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=python-crcmod
+ URL:=http://crcmod.sourceforge.net/
+ DEPENDS:=+python-light
+endef
+
+define Package/python-crcmod/description
+ The software in this package is a Python module for generating objects that compute the Cyclic Redundancy Check (CRC). There is no attempt in this package to explain how the CRC works. There are a number of resources on the web that give a good explanation of the algorithms. Just do a Google search for "crc calculation" and browse till you find what you need. Another resource can be found in chapter 20 of the book "Numerical Recipes in C" by Press et. al.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr")
+endef
+
+define Package/python-crcmod/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-crcmod))
diff --git a/lang/python/python-crypto/Makefile b/lang/python/python-crypto/Makefile
new file mode 100644
index 000000000..e0a3b7bf3
--- /dev/null
+++ b/lang/python/python-crypto/Makefile
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2009-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pycrypto
+PKG_VERSION:=2.6.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/
+PKG_MD5SUM:=55a61a054aa66812daf5161a0d5d7eda
+
+PKG_LICENSE:=Public Domain
+PKG_LICENSE_FILES:=COPYRIGHT
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-crypto
+ SECTION:=lang-python
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-crypto
+ URL:=http://www.pycrypto.org/
+ DEPENDS:=+python +libgmp
+endef
+
+define Package/python-crypto/description
+A collection of both secure hash functions (such as MD5 and SHA),
+and various encryption algorithms (AES, DES, IDEA, RSA, ElGamal, etc.).
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,\
+ install --prefix=/usr --root=$(PKG_INSTALL_DIR),\
+ CONFIG_BIG_ENDIAN="$(CONFIG_BIG_ENDIAN)" \
+ )
+endef
+
+define Package/python-crypto/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)/
+endef
+
+$(eval $(call PyPackage,python-crypto))
+$(eval $(call BuildPackage,python-crypto))
diff --git a/lang/python/python-crypto/patches/001-no-host-paths.patch b/lang/python/python-crypto/patches/001-no-host-paths.patch
new file mode 100644
index 000000000..d481627a2
--- /dev/null
+++ b/lang/python/python-crypto/patches/001-no-host-paths.patch
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -370,7 +370,7 @@ kw = {'name':"pycrypto",
+ 'ext_modules': plat_ext + [
+ # _fastmath (uses GNU mp library)
+ Extension("Crypto.PublicKey._fastmath",
+- include_dirs=['src/','/usr/include/'],
++ include_dirs=['src/'],
+ libraries=['gmp'],
+ sources=["src/_fastmath.c"]),
+
diff --git a/lang/python/python-crypto/patches/002-fix-endianness-detect.patch b/lang/python/python-crypto/patches/002-fix-endianness-detect.patch
new file mode 100644
index 000000000..baed012bf
--- /dev/null
+++ b/lang/python/python-crypto/patches/002-fix-endianness-detect.patch
@@ -0,0 +1,13 @@
+--- a/setup.py
++++ b/setup.py
+@@ -100,6 +100,10 @@
+ w(kwd.get("end", "\n"))
+
+ def endianness_macro():
++ if os.environ["CONFIG_BIG_ENDIAN"] == "y":
++ return ('PCT_BIG_ENDIAN', 1)
++ else:
++ return ('PCT_LITTLE_ENDIAN', 1)
+ s = struct.pack("@I", 0x33221100)
+ if s == "\x00\x11\x22\x33".encode(): # little endian
+ return ('PCT_LITTLE_ENDIAN', 1)
diff --git a/lang/python/python-cryptography/Makefile b/lang/python/python-cryptography/Makefile
new file mode 100644
index 000000000..9ac237d01
--- /dev/null
+++ b/lang/python/python-cryptography/Makefile
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cryptography
+PKG_VERSION:=1.5.1
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/21/e1/37fc14f9d77924e84ba0dcb88eb8352db914583af229287c6c965d66ba0d
+PKG_MD5SUM:=66a3e01f5f436d2413ef47b7e6bb7729
+
+PKG_BUILD_DEPENDS:=python-cffi/host
+
+PKG_LICENSE:=Apache-2.0 BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE.APACHE LICENSE.BSD
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-cryptography
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-cryptography
+ URL:=https://github.com/pyca/cryptography
+ DEPENDS:=+libopenssl +python +python-cffi +python-enum34 +python-idna +python-ipaddress +python-pyasn1 +python-six +python-setuptools
+endef
+
+define Package/python-cryptography/description
+cryptography is a package which provides cryptographic recipes and
+primitives to Python developers. Our goal is for it to be your "cryptographic
+standard library". It supports Python 2.6-2.7, Python 3.3+, and PyPy 2.6+.
+endef
+
+define PyPackage/python-cryptography/filespec
++|$(PYTHON_PKG_DIR)
+-|$(PYTHON_PKG_DIR)/cryptography/hazmat/backends/commoncrypto
+-|$(PYTHON_PKG_DIR)/cryptography/hazmat/bindings/commoncrypto
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+$(eval $(call PyPackage,python-cryptography))
+$(eval $(call BuildPackage,python-cryptography))
diff --git a/lang/python/python-cryptography/patches/001-disable-setup-requirements.patch b/lang/python/python-cryptography/patches/001-disable-setup-requirements.patch
new file mode 100644
index 000000000..07ae483c2
--- /dev/null
+++ b/lang/python/python-cryptography/patches/001-disable-setup-requirements.patch
@@ -0,0 +1,12 @@
+diff --git a/setup.py b/setup.py
+index b5c05df..a777dd7 100644
+--- a/setup.py
++++ b/setup.py
+@@ -266,6 +266,7 @@ class DummyPyTest(test):
+ with open(os.path.join(base_dir, "README.rst")) as f:
+ long_description = f.read()
+
++setup_requirements=[]
+
+ setup(
+ name=about["__title__"],
diff --git a/lang/python/python-dateutil/Makefile b/lang/python/python-dateutil/Makefile
new file mode 100644
index 000000000..2e859914a
--- /dev/null
+++ b/lang/python/python-dateutil/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-dateutil
+PKG_VERSION:=2.6.0
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/51/fc/39a3fbde6864942e8bb24c93663734b74e281b984d1b8c4f95d64b0c21f6/
+PKG_MD5SUM:=6e38f91e8c94c15a79ce22768dfeca87
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-dateutil
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Extensions to the standard Python datetime module
+ URL:=https://dateutil.readthedocs.org/
+ DEPENDS:=+python +python-six
+endef
+
+define Package/python-dateutil/description
+ Extensions to the standard Python datetime module
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-dateutil/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-dateutil))
diff --git a/lang/python/python-dns/Makefile b/lang/python/python-dns/Makefile
new file mode 100644
index 000000000..682c9401a
--- /dev/null
+++ b/lang/python/python-dns/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-dns
+PKG_RELEASE:=2
+PKG_VERSION:=1.15.0
+PKG_SOURCE_URL:=http://www.dnspython.org/kits/$(PKG_VERSION)
+PKG_MD5SUM:=63a679089822fb86127867c315286dc5
+PKG_SOURCE:=dnspython-$(PKG_VERSION).tar.gz
+PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=LICENSE
+PKG_BUILD_DIR:=$(BUILD_DIR)/dnspython-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-dns
+ SECTION:=language-python
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=dnspython
+ URL:=http://www.dnspython.org/
+ DEPENDS:=+python
+endef
+
+define Package/python-dns/description
+ dnspython is a DNS toolkit for Python. It supports almost all record types. It can be used for queries, zone transfers, and dynamic updates. It supports TSIG authenticated messages and EDNS0.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,\
+ install --prefix=/usr --root="$(PKG_INSTALL_DIR)" \
+ )
+endef
+
+$(eval $(call PyPackage,python-dns))
+$(eval $(call BuildPackage,python-dns))
diff --git a/lang/python/python-egenix-mx-base/Makefile b/lang/python/python-egenix-mx-base/Makefile
new file mode 100644
index 000000000..7fd7c82ed
--- /dev/null
+++ b/lang/python/python-egenix-mx-base/Makefile
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-egenix-mx-base
+PKG_VERSION:=3.2.8
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
+PKG_LICENSE:=eGenix.com Public License 1.1.0
+PKG_LICENSE_FILES:=LICENSE COPYRIGHT
+
+PKG_SOURCE:=egenix-mx-base-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://downloads.egenix.com/python/
+PKG_MD5SUM:=9d9d3a25f9dc051a15e97f452413423b
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/egenix-mx-base-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-egenix-mx-base
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ DEPENDS:=+USE_EGLIBC:librt +USE_UCLIBC:librt +python
+ TITLE:=Egenix mxBase
+ URL:=http://www.egenix.com/products/python/mxBase/
+endef
+
+define Package/python-egenix-mx-base/description
+ The eGenix.com mx Base Distribution for Python is a collection
+ of professional quality software tools which enhance Python's
+ usability in many important areas such as fast text searching,
+ date/time processing and high speed data types.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr")
+endef
+
+define PyPackage/python-egenix-mx-base/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call PyPackage,python-egenix-mx-base))
+$(eval $(call BuildPackage,python-egenix-mx-base))
diff --git a/lang/python/python-enum34/Makefile b/lang/python/python-enum34/Makefile
new file mode 100644
index 000000000..4191f2ac3
--- /dev/null
+++ b/lang/python/python-enum34/Makefile
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=enum34
+PKG_VERSION:=1.1.6
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876
+PKG_MD5SUM:=5f13a0841a61f7fc295c514490d120d0
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=enum/LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-enum34
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-enum34
+ URL:=https://pypi.python.org/pypi/enum34/
+ DEPENDS:=+python-light
+endef
+
+define Package/python-enum34/description
+enum34 is the new Python stdlib enum module available in Python 3.4
+backported for previous versions of Python from 2.4 to 3.3.
+endef
+
+define PyPackage/python-enum34/filespec
++|$(PYTHON_PKG_DIR)
+-|$(PYTHON_PKG_DIR)/enum/test.py
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+$(eval $(call PyPackage,python-enum34))
+$(eval $(call BuildPackage,python-enum34))
diff --git a/lang/python/python-enum34/patches/001-omit-docs.patch b/lang/python/python-enum34/patches/001-omit-docs.patch
new file mode 100644
index 000000000..cff6c5228
--- /dev/null
+++ b/lang/python/python-enum34/patches/001-omit-docs.patch
@@ -0,0 +1,19 @@
+diff -r f24487b45cd0 setup.py
+--- a/setup.py Sun May 15 20:28:23 2016 -0700
++++ b/setup.py Wed Jul 27 22:49:13 2016 +0800
+@@ -63,15 +63,6 @@
+ version='1.1.6',
+ url='https://bitbucket.org/stoneleaf/enum34',
+ packages=['enum'],
+- package_data={
+- 'enum' : [
+- 'LICENSE',
+- 'README',
+- 'doc/enum.rst',
+- 'doc/enum.pdf',
+- 'test.py',
+- ]
+- },
+ license='BSD License',
+ description='Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4',
+ long_description=long_desc,
diff --git a/lang/python/python-gmpy2/Makefile b/lang/python/python-gmpy2/Makefile
new file mode 100644
index 000000000..8337825e4
--- /dev/null
+++ b/lang/python/python-gmpy2/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gmpy2
+PKG_VERSION:=2.0.8
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
+PKG_SOURCE_URL:=https://pypi.python.org/packages/90/f4/9a2e384b325b69bc5827b9a6510a8fb4a51698c915c06a3f25a86458892a
+PKG_MD5SUM:=56d40bddcf8f22be0a36d60f764f3241
+
+PKG_LICENSE:=LGPL-3.0+
+PKG_LICENSE_FILES:=COPYING.LESSER
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-gmpy2
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-gmpy2
+ URL:=http://code.google.com/p/gmpy/
+ DEPENDS:=+libgmp +python-light
+endef
+
+define Package/python-gmpy2/description
+gmpy2 is a C-coded Python extension module that supports multiple-precision
+arithmetic. gmpy2 is the successor to the original gmpy module. The gmpy module
+only supported the GMP multiple-precision library. gmpy2 adds support for the
+MPFR (correctly rounded real floating-point arithmetic) and MPC (correctly
+rounded complex floating-point arithmetic) libraries. gmpy2 also updates the
+API and naming conventions to be more consistent and support the additional
+functionality.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" --nompfr)
+endef
+
+$(eval $(call PyPackage,python-gmpy2))
+$(eval $(call BuildPackage,python-gmpy2))
diff --git a/lang/python/python-idna/Makefile b/lang/python/python-idna/Makefile
new file mode 100644
index 000000000..d95409668
--- /dev/null
+++ b/lang/python/python-idna/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=idna
+PKG_VERSION:=2.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/i/idna
+PKG_MD5SUM:=f6473caa9c5e0cc1ad3fd5d04c3c114b
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE.rst
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-idna
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-idna
+ URL:=https://github.com/kjd/idna
+ DEPENDS:=+python-light
+endef
+
+define Package/python-idna/description
+A library to support the Internationalised Domain Names in Applications
+(IDNA) protocol as specified in RFC 5891. This version of the protocol
+is often referred to as "IDNA2008" and can produce different results
+from the earlier standard from 2003.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+$(eval $(call PyPackage,python-idna))
+$(eval $(call BuildPackage,python-idna))
diff --git a/lang/python/python-ipaddress/Makefile b/lang/python/python-ipaddress/Makefile
new file mode 100644
index 000000000..ccc1280ac
--- /dev/null
+++ b/lang/python/python-ipaddress/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ipaddress
+PKG_VERSION:=1.0.17
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/bb/26/3b64955ff73f9e3155079b9ed31812afdfa5333b5c76387454d651ef593a
+PKG_MD5SUM:=8bbf0326719fafb1f453921ef96729fe
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=Python-2.0
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-ipaddress
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-ipaddress
+ URL:=https://github.com/phihag/ipaddress
+ DEPENDS:=+python-light
+endef
+
+define Package/python-ipaddress/description
+Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+$(eval $(call PyPackage,python-ipaddress))
+$(eval $(call BuildPackage,python-ipaddress))
diff --git a/lang/python/python-ldap/Makefile b/lang/python/python-ldap/Makefile
new file mode 100644
index 000000000..dae531632
--- /dev/null
+++ b/lang/python/python-ldap/Makefile
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2016-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-ldap
+PKG_VERSION:=2.4.32
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
+PKG_LICENSE:=Python-style
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/67/d9/fa0ea70d1792875745116ad62ac8d4bcb07550b15cded591bb57df6a6d9a
+PKG_MD5SUM:=7c46c8a04acc227a778c7900c87cdfc7
+
+PKG_BUILD_DEPENDS:=python libopenldap
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-ldap
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ DEPENDS:=+libopenldap +python
+ TITLE:=Python modules for implementing LDAP clients
+ URL:=http://python-ldap.org/
+endef
+
+define Package/python-ldap/description
+ python-ldap provides an object-oriented API to access LDAP directory
+ servers from Python programs. Mainly it wraps the OpenLDAP 2.x libs
+ for that purpose. Additionally the package contains modules for
+ other LDAP-related stuff (e.g. processing LDIF, LDAPURLs, LDAPv3
+ schema, LDAPv3 extended operations and controls, etc.).
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,build_ext \
+ --include-dirs="$(STAGING_DIR)/usr/include:$(STAGING_DIR)/usr/include/sasl" \
+ --library-dirs="$(STAGING_DIR)/usr/lib:$(STAGING_DIR)/usr/lib/sasl2" \
+ build_py \
+ install --prefix="$(PKG_INSTALL_DIR)/usr")
+endef
+
+define PyPackage/python-ldap/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call PyPackage,python-ldap))
+$(eval $(call BuildPackage,python-ldap))
diff --git a/lang/python/python-ldap/patches/010-setup_cfg.patch b/lang/python/python-ldap/patches/010-setup_cfg.patch
new file mode 100644
index 000000000..372e9d230
--- /dev/null
+++ b/lang/python/python-ldap/patches/010-setup_cfg.patch
@@ -0,0 +1,16 @@
+From: Dmitrij Trefilov <the-alien@live.ru>
+
+Subject: [PATCH] lang: removed hardcoded include and library directories from setup.cfg
+Signed-off-by: Dmitrij Trefilov <the-alien@live.ru>
+---
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -1,6 +1,6 @@
+ [_ldap]
+-library_dirs = /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
+-include_dirs = /usr/include /usr/include/sasl /usr/local/include /usr/local/include/sasl
++library_dirs =
++include_dirs =
+ defines = HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
+ extra_compile_args =
+ extra_objects =
diff --git a/lang/python/python-mysql/Makefile b/lang/python/python-mysql/Makefile
new file mode 100644
index 000000000..04ebe5beb
--- /dev/null
+++ b/lang/python/python-mysql/Makefile
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=MySQL-python
+PKG_VERSION:=1.2.5
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/M/MySQL-python/
+PKG_MD5SUM:=654f75b302db6ed8dc5a898c625e030c
+
+PKG_BUILD_DEPENDS:=python python-setuptools libmysqlclient
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-mysql
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=MySQL database adapter for Python
+ URL:=https://pypi.python.org/pypi/MySQL-python
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ DEPENDS:=+python +libmysqlclient
+endef
+
+define Package/python-mysql/description
+ MySQLdb is an thread-compatible interface to the popular MySQL database
+ server that provides the Python database API.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-mysql/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-mysql))
diff --git a/lang/python/python-mysql/patches/010-threadsafe.patch b/lang/python/python-mysql/patches/010-threadsafe.patch
new file mode 100644
index 000000000..bcd9af8d6
--- /dev/null
+++ b/lang/python/python-mysql/patches/010-threadsafe.patch
@@ -0,0 +1,11 @@
+--- MySQL-python-1.2.2/site_orig.cfg 2007-08-15 12:58:40.000000000 +0200
++++ MySQL-python-1.2.2/site.cfg 2007-08-15 12:58:49.000000000 +0200
+@@ -4,7 +4,7 @@
+ # static: link against a static library (probably required for embedded)
+
+ embedded = False
+-threadsafe = True
++threadsafe = False
+ static = False
+
+ # The path to mysql_config.
diff --git a/lang/python/python-packages/Makefile b/lang/python/python-packages/Makefile
new file mode 100644
index 000000000..7686e3834
--- /dev/null
+++ b/lang/python/python-packages/Makefile
@@ -0,0 +1,130 @@
+#
+# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-packages
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+#
+# NOTE: move the host module installation to Host/Compile when
+# HOST_CONFIG_DEPENDS is supported
+#
+# NOTE: PKG_CONFIG_DEPENDS cannot correctly track changes of string type config
+# options, so you may want to do manual cleanup on config change.
+#
+PKG_CONFIG_DEPENDS:= \
+ CONFIG_PACKAGE_python-packages-list-host \
+ CONFIG_PACKAGE_python-packages-list \
+ CONFIG_PACKAGE_python-packages-list-cleanup \
+ CONFIG_PACKAGE_python-packages-envs \
+ CONFIG_PACKAGE_python-packages-extra-deps \
+ CONFIG_PACKAGE_python-packages-index-url \
+ CONFIG_PACKAGE_python-packages-pip-opts \
+
+PKG_BUILD_DEPENDS:=python python/host
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-packages
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=A dummy package for packaging python modules with pip
+ DEPENDS:=@DEVEL +python
+endef
+
+define Package/python-packages/config
+if PACKAGE_python-packages
+config PACKAGE_python-packages-list-host
+ string "List of python packages to install on host"
+config PACKAGE_python-packages-list
+ string "List of python packages to install on target"
+config PACKAGE_python-packages-list-cleanup
+ string "List of python packages to cleanup to avoid clash with existing packages"
+config PACKAGE_python-packages-envs
+ string "Extra environment variables to pass on to pip and its children on target build"
+config PACKAGE_python-packages-extra-deps
+ string "List of deps fulfilled but not tracked by the build system"
+config PACKAGE_python-packages-index-url
+ string "Index URL passed to pip with --index-url"
+config PACKAGE_python-packages-pip-opts
+ string "Additional arguments to pip command line"
+endif
+endef
+
+CONFIG_PACKAGE_python-packages-list-host:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list-host))
+CONFIG_PACKAGE_python-packages-list:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list))
+CONFIG_PACKAGE_python-packages-list-cleanup:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list-cleanup))
+CONFIG_PACKAGE_python-packages-envs:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-envs))
+CONFIG_PACKAGE_python-packages-extra-deps:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-extra-deps))
+CONFIG_PACKAGE_python-packages-pip-opts:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-pip-opts))
+
+HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
+
+decr=$(word $(1),0 1 2 3 4 5 6 7 8 9 10)
+recur=$(if $(subst 0,,$(2)),$(call recur,$(1),$(call decr,$(2)),$(call $(1)$(2),$(3))),$(3))
+_req2dir1=$(subst >,gt,$(1))
+_req2dir2=$(subst <,lt,$(1))
+_req2dir3=$(subst >=,geq,$(1))
+_req2dir4=$(subst <=,leq,$(1))
+_req2dir5=$(subst ://,:::,$(1))
+_req2dir6=$(subst *,_,$(1))
+_req2dir7=$(subst ?,_,$(1))
+req2dir=$(call recur,_req2dir,7,$(1))
+
+# --ignore-installed, it may happen that host pip will ignore target install if
+# it was already installed as host module, e.g. cffi deps of cryptograph
+HOST_PYTHON_PIP_INSTALL=$(HOST_PYTHON_PIP) install \
+ --root=$(1) \
+ --prefix=$(2) \
+ --ignore-installed \
+ --no-compile \
+ $(if $(CONFIG_PACKAGE_python-packages-index-url), --index-url $(CONFIG_PACKAGE_python-packages-index-url)) \
+ $(if $(CONFIG_PACKAGE_python-packages-pip-opts), $(CONFIG_PACKAGE_python-packages-pip-opts)) \
+
+HOST_PYTHON_PIP_INSTALL_HOST:=$(call HOST_PYTHON_PIP_INSTALL,$(STAGING_DIR_HOSTPKG),"")
+HOST_PYTHON_PIP_INSTALL_TARGET=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg)),/usr)
+HOST_PYTHON_PIP_INSTALL_CLEANUP:=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/_cleanup,/usr)
+
+define Build/Compile
+ $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list-host),
+ $(call Build/Compile/HostPyRunHost,,$(HOST_PYTHON_PIP_INSTALL_HOST) $(pkg))
+ )
+ $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list),
+ $(call Build/Compile/HostPyRunTarget,,$(call HOST_PYTHON_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python-packages-envs))
+ )
+ $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list-cleanup),
+ $(call Build/Compile/HostPyRunTarget,,$(HOST_PYTHON_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python-packages-envs))
+ )
+endef
+
+define Package/python-packages/install
+ $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list),
+ $(CP) "$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg))"/* $(1)
+ )
+
+ find "$(PKG_INSTALL_DIR)/_cleanup" -mindepth 1 -depth | while read sf; do \
+ tf="$$$${sf#$(PKG_INSTALL_DIR)/_cleanup/}"; \
+ tf="$(1)/$$$$tf"; \
+ if [ -f "$$$$tf" -o -L "$$$$tf" ]; then \
+ rm -vf "$$$$tf"; \
+ elif [ -d "$$$$tf" ]; then \
+ rmdir -v -p "$$$$tf" || true; \
+ fi \
+ done
+endef
+
+define Package/python-packages/extra_provides
+ echo $(CONFIG_PACKAGE_python-packages-extra-deps) | tr ' ' '\n'
+endef
+
+$(eval $(call BuildPackage,python-packages))
diff --git a/lang/python/python-packages/README.md b/lang/python/python-packages/README.md
new file mode 100644
index 000000000..3c09d8eb6
--- /dev/null
+++ b/lang/python/python-packages/README.md
@@ -0,0 +1,72 @@
+This package allows users to package python modules without creating package
+Makefiles for each individual module and their dependencies. It provides a
+way making packaging python packages faster and may also facilitate the process
+of developing Makefiles for new python packages
+
+This is a raw DEVEL only package. Using it may entail a lot of implementation
+details and you may need to resolve target dependencies and package details on
+your own
+
+- Third party python packages may depend on features not included in e.g.
+ python-light
+- Some python modules may require host install of another module to progress,
+ e.g. target cryptography requires host cffi
+- Some python modules have external C library dependencies, e.g. pyOpenSSL
+ requires openssl libs
+- Some packages may have an autoconf configure script whose arguments we
+ cannot control with pip and has to be passed on (hacked) by overriding some
+ environment variables
+
+## How it works
+
+1. Install host modules required for building target modules
+2. Install each target module to separate directories
+3. Install another copy of modules for cleanup purposes to make list of
+ installed files to be removed from target modules installed in step 2
+
+Why should it be so
+
+1. Installing target cryptography requires host installation of cffi module
+2. cryptography requires setuptools and pip will install its own copy with
+ --ignore-installed. When PACKAGE_python-setuptools is also selected, opkg
+ will complain of data file clashes if it was not removed here.
+
+Pip will handle dependency requirements of python modules, but external
+dependencies like c libraries has to be prepared by the build system. The
+issue is that there is currently no way to express such dependencies, thus may
+cause build failure, e.g. pycrypto requires the presence of libgmp to build
+successfully.
+
+## Tips
+
+If something goes wrong, we can add additional arguments to pip command
+line to check the detailed build process. Some useful arguments may be
+
+- -v, for verbose output. Repeat this option if the current level of
+ verbosity is not enough
+- --no-clean, for preserving pip build dir on build failure
+
+## Examples
+
+tornado (python-only module)
+
+ CONFIG_PACKAGE_python-packages=y
+ CONFIG_PACKAGE_python-packages-list="tornado==4.4.2"
+
+cryptography (requires installation of host modules and cleanup on target modules)
+
+ CONFIG_PACKAGE_python-packages=y
+ CONFIG_PACKAGE_python-packages-list-host="cffi"
+ CONFIG_PACKAGE_python-packages-list="cryptography"
+ CONFIG_PACKAGE_python-packages-list-cleanup="setuptools"
+
+pycrypto 2.7a1 (python module with autoconf configure script; depends on
+libgmp; broken wmmintrin.h). 2.6.1 does not work because of a flaw in
+the setup.py hardcoding host include directory
+
+ CONFIG_PACKAGE_libgmp=y
+ CONFIG_PACKAGE_python-packages=y
+ CONFIG_PACKAGE_python-packages-list="https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz"
+ CONFIG_PACKAGE_python-packages-envs="ac_cv_header_wmmintrin_h=no build_alias=$(GNU_HOST_NAME) host_alias=$(GNU_TARGET_NAME) target_alias=$(GNU_TARGET_NAME)"
+ CONFIG_PACKAGE_python-packages-extra-deps="libgmp.so.10"
+
diff --git a/lang/python/python-parsley/Makefile b/lang/python/python-parsley/Makefile
new file mode 100644
index 000000000..75df427c7
--- /dev/null
+++ b/lang/python/python-parsley/Makefile
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=Parsley
+PKG_VERSION:=1.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/P/Parsley
+PKG_MD5SUM:=92bc256e5f73810a609dc7874637ad31
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-parsley
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-parsley
+ URL:=http://launchpad.net/parsley
+ DEPENDS:=+python-light
+endef
+
+define Package/python-parsley/description
+Parsing and pattern matching made easy.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+$(eval $(call PyPackage,python-parsley))
+$(eval $(call BuildPackage,python-parsley))
diff --git a/lang/python/python-parsley/patches/001-omit-tests.patch b/lang/python/python-parsley/patches/001-omit-tests.patch
new file mode 100644
index 000000000..71bd02175
--- /dev/null
+++ b/lang/python/python-parsley/patches/001-omit-tests.patch
@@ -0,0 +1,12 @@
+diff -Nur a/setup.py b/setup.py
+--- a/setup.py 2015-09-09 10:45:25.000000000 +0800
++++ b/setup.py 2015-12-01 17:31:03.143409843 +0800
+@@ -14,7 +14,6 @@
+ author_email="washort42@gmail.com",
+ license="MIT License",
+ long_description=open("README").read(),
+- packages=["ometa", "terml", "ometa._generated", "terml._generated",
+- "ometa.test", "terml.test"],
++ packages=["ometa", "terml", "ometa._generated", "terml._generated"],
+ py_modules=["parsley"]
+ )
diff --git a/lang/python/python-pcapy/Makefile b/lang/python/python-pcapy/Makefile
new file mode 100644
index 000000000..c89500df9
--- /dev/null
+++ b/lang/python/python-pcapy/Makefile
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-pcapy
+PKG_VERSION:=0.11.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Andrew McConachie <andrew@depht.com>
+PKG_LICENSE:=Apache-1.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/CoreSecurity/pcapy.git
+PKG_SOURCE_VERSION:=b91a418374d1636408c435f11799ef725ef70097
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-pcapy
+ SECTION:=language-python
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-pcapy
+ URL:=https://www.coresecurity.com/corelabs-research/open-source-tools/pcapy
+ DEPENDS:=+python +libpcap +libstdcpp
+endef
+
+define Package/python-pcapy/description
+ Pcapy is a Python extension module that interfaces with the libpcap packet capture library. Pcapy enables python scripts to capture packets on the network. Pcapy is highly effective when used in conjunction with a packet-handling package such as Impacket, which is a collection of Python classes for constructing and dissecting network packets.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,\
+ install --prefix=/usr --root="$(PKG_INSTALL_DIR)" \
+ )
+endef
+
+$(eval $(call PyPackage,python-pcapy))
+$(eval $(call BuildPackage,python-pcapy))
diff --git a/lang/python/python-ply/Makefile b/lang/python/python-ply/Makefile
new file mode 100644
index 000000000..61b34a312
--- /dev/null
+++ b/lang/python/python-ply/Makefile
@@ -0,0 +1,96 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ply
+PKG_VERSION:=3.9
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.dabeaz.com/ply
+PKG_HASH:=0d7e2940b9c57151392fceaa62b0865c45e06ce1e36687fd8d03f011a907f43e
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+HOST_BUILD_DEPENDS:=
+ifdef CONFIG_PACKAGE_python-ply
+HOST_BUILD_DEPENDS+=python/host
+endif
+ifdef CONFIG_PACKAGE_python3-ply
+HOST_BUILD_DEPENDS+=python3/host
+endif
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=README.md
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+define Package/python-ply/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=http://www.dabeaz.com/ply/
+endef
+
+define Package/python-ply
+$(call Package/python-ply/Default)
+ TITLE:=python-ply
+ DEPENDS:=+python-light
+ VARIANT:=python
+endef
+
+define Package/python3-ply
+$(call Package/python-ply/Default)
+ TITLE:=python3-ply
+ DEPENDS:=+python3-light
+ VARIANT:=python3
+endef
+
+define Package/python-ply/description
+PLY is a 100% Python implementation of the common parsing tools lex
+and yacc.
+endef
+
+define Package/python3-ply/description
+$(call Package/python-ply/description)
+.
+(Variant for Python3)
+endef
+
+ifdef CONFIG_PACKAGE_python-ply
+define Host/Compile/python-ply
+ $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
+endef
+endif
+
+ifdef CONFIG_PACKAGE_python3-ply
+define Host/Compile/python3-ply
+ $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
+endef
+endif
+
+define Host/Compile
+$(call Host/Compile/python-ply)
+$(call Host/Compile/python3-ply)
+endef
+
+define Host/Install
+endef
+
+$(eval $(call HostBuild))
+
+$(eval $(call PyPackage,python-ply))
+$(eval $(call BuildPackage,python-ply))
+
+$(eval $(call Py3Package,python3-ply))
+$(eval $(call BuildPackage,python3-ply))
diff --git a/lang/python/python-psycopg2/Makefile b/lang/python/python-psycopg2/Makefile
new file mode 100644
index 000000000..96817a4a3
--- /dev/null
+++ b/lang/python/python-psycopg2/Makefile
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-psycopg2
+PKG_VERSION:=2.6.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
+PKG_LICENSE:=LGPL-3.0+
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=psycopg2-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://initd.org/psycopg/tarballs/PSYCOPG-2-6/
+PKG_MD5SUM:=4a392949ba31a378a18ed3e775a4693f
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/psycopg2-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python libpq python/host
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-psycopg2
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=PostgreSQL database adapter for Python
+ URL:=http://www.initd.org/
+ DEPENDS:=+python +libpq +python-egenix-mx-base
+endef
+
+define Package/python-psycopg2/description
+ Psycopg is the most popular PostgreSQL adapter for the Python programming language
+endef
+
+define Build/Compile
+ # The PATH var is required so that psycopg2's setup.py script finds pg_config
+ $(call Build/Compile/PyMod,., \
+ install --prefix=/usr --root=$(PKG_INSTALL_DIR), \
+ PATH=$(STAGING_DIR)/usr/bin:$(PATH))
+endef
+
+define Package/python-psycopg2/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call PyPackage,python-psycopg2))
+$(eval $(call BuildPackage,python-psycopg2))
diff --git a/lang/python/python-pyasn1-modules/Makefile b/lang/python/python-pyasn1-modules/Makefile
new file mode 100644
index 000000000..bc4142b43
--- /dev/null
+++ b/lang/python/python-pyasn1-modules/Makefile
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pyasn1-modules
+PKG_VERSION:=0.0.8
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyasn1-modules
+PKG_MD5SUM:=178129bc7fbf07215c25230c5f053f81
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-pyasn1-modules
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-pyasn1-modules
+ URL:=http://sourceforge.net/projects/pyasn1/
+ DEPENDS:=+python-light +python-pyasn1
+endef
+
+define Package/python-pyasn1-modules/description
+This is a small but growing collection of ASN.1 data structures
+expressed in Python terms using pyasn1 data model.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+$(eval $(call PyPackage,python-pyasn1-modules))
+$(eval $(call BuildPackage,python-pyasn1-modules))
diff --git a/lang/python/python-pyasn1/Makefile b/lang/python/python-pyasn1/Makefile
new file mode 100644
index 000000000..07549db98
--- /dev/null
+++ b/lang/python/python-pyasn1/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pyasn1
+PKG_VERSION:=0.1.9
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyasn1
+PKG_MD5SUM:=f00a02a631d4016818659d1cc38d229a
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-pyasn1
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-pyasn1
+ URL:=http://pyasn1.sourceforge.net/
+ DEPENDS:=+python-light
+endef
+
+define Package/python-pyasn1/description
+This is an implementation of ASN.1 types and codecs in Python programming
+language. It has been first written to support particular protocol (SNMP)
+but then generalized to be suitable for a wide range of protocols
+based on ASN.1 specification.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+$(eval $(call PyPackage,python-pyasn1))
+$(eval $(call BuildPackage,python-pyasn1))
diff --git a/lang/python/python-pycparser/Makefile b/lang/python/python-pycparser/Makefile
new file mode 100644
index 000000000..d151eb1cc
--- /dev/null
+++ b/lang/python/python-pycparser/Makefile
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pycparser
+PKG_VERSION:=2.14
+PKG_RELEASE:=4
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pycparser
+PKG_HASH:=7959b4a74abdc27b312fed1c21e6caf9309ce0b29ea86b591fd2e99ecdf27f73
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+HOST_BUILD_DEPENDS:=python-ply/host
+ifdef CONFIG_PACKAGE_python-pycparser
+HOST_BUILD_DEPENDS+=python/host
+endif
+ifdef CONFIG_PACKAGE_python3-pycparser
+HOST_BUILD_DEPENDS+=python3/host
+endif
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+define Package/python-pycparser/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=https://github.com/eliben/pycparser
+endef
+
+define Package/python-pycparser
+$(call Package/python-pycparser/Default)
+ TITLE:=python-pycparser
+ DEPENDS:=+python-light +python-ply
+ VARIANT:=python
+endef
+
+define Package/python3-pycparser
+$(call Package/python-pycparser/Default)
+ TITLE:=python3-pycparser
+ DEPENDS:=+python3-light +python3-ply
+ VARIANT:=python3
+endef
+
+define Package/python-pycparser/description
+pycparser is a parser for the C language, written in pure Python. It is a
+module designed to be easily integrated into applications that need to parse
+C source code.
+endef
+
+define Package/python3-pycparser/description
+$(call Package/python-pycparser/description)
+.
+(Variant for Python3)
+endef
+
+ifdef CONFIG_PACKAGE_python-pycparser
+define Host/Compile/python-pycparser
+ $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
+endef
+endif
+
+ifdef CONFIG_PACKAGE_python3-pycparser
+define Host/Compile/python3-pycparser
+ $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
+endef
+endif
+
+define Host/Compile
+$(call Host/Compile/python-pycparser)
+$(call Host/Compile/python3-pycparser)
+endef
+
+define Host/Install
+endef
+
+$(eval $(call HostBuild))
+
+$(eval $(call PyPackage,python-pycparser))
+$(eval $(call BuildPackage,python-pycparser))
+
+$(eval $(call Py3Package,python3-pycparser))
+$(eval $(call BuildPackage,python3-pycparser))
diff --git a/lang/python/python-pycparser/patches/001-use-external-ply.patch b/lang/python/python-pycparser/patches/001-use-external-ply.patch
new file mode 100644
index 000000000..96b1d0343
--- /dev/null
+++ b/lang/python/python-pycparser/patches/001-use-external-ply.patch
@@ -0,0 +1,41 @@
+diff --git a/pycparser/c_lexer.py b/pycparser/c_lexer.py
+index cbb9d26..cbd7742 100644
+--- a/pycparser/c_lexer.py
++++ b/pycparser/c_lexer.py
+@@ -9,8 +9,8 @@
+ import re
+ import sys
+
+-from .ply import lex
+-from .ply.lex import TOKEN
++from ply import lex
++from ply.lex import TOKEN
+
+
+ class CLexer(object):
+diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py
+index f4f7453..5c0ca88 100644
+--- a/pycparser/c_parser.py
++++ b/pycparser/c_parser.py
+@@ -8,7 +8,7 @@
+ #------------------------------------------------------------------------------
+ import re
+
+-from .ply import yacc
++from ply import yacc
+
+ from . import c_ast
+ from .c_lexer import CLexer
+diff --git a/setup.py b/setup.py
+index fdccbb3..036a10b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -49,7 +49,7 @@ setup(
+ classifiers = [
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',],
+- packages=['pycparser', 'pycparser.ply'],
++ packages=['pycparser'],
+ package_data={'pycparser': ['*.cfg']},
+ cmdclass={'install': install, 'sdist': sdist},
+ )
diff --git a/lang/python/python-pyopenssl/Makefile b/lang/python/python-pyopenssl/Makefile
new file mode 100644
index 000000000..85500ad02
--- /dev/null
+++ b/lang/python/python-pyopenssl/Makefile
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pyOpenSSL
+PKG_VERSION:=16.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/15/1e/79c75db50e57350a7cefb70b110255757e9abd380a50ebdc0cfd853b7450
+PKG_MD5SUM:=d8100b0c333f0eeadaf05914da8792a6
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-pyopenssl
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-pyopenssl
+ URL:=https://github.com/pyca/pyopenssl
+ DEPENDS:=+python-light +python-cryptography +python-six
+endef
+
+define Package/python-pyopenssl/description
+Python wrapper module around the OpenSSL library
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+$(eval $(call PyPackage,python-pyopenssl))
+$(eval $(call BuildPackage,python-pyopenssl))
diff --git a/lang/python/python-pyptlib/Makefile b/lang/python/python-pyptlib/Makefile
new file mode 100644
index 000000000..8f3324605
--- /dev/null
+++ b/lang/python/python-pyptlib/Makefile
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pyptlib
+PKG_VERSION:=0.0.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyptlib
+PKG_MD5SUM:=2fc7b8803777451c1fad3d5e25f1b99c
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-pyptlib
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-pyptlib
+ URL:=https://pypi.python.org/pypi/pyptlib
+ DEPENDS:=+python-light
+endef
+
+define Package/python-pyptlib/description
+A python implementation of the Pluggable Transports for Circumvention
+specification for Tor
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+$(eval $(call PyPackage,python-pyptlib))
+$(eval $(call BuildPackage,python-pyptlib))
diff --git a/lang/python/python-pyserial/Makefile b/lang/python/python-pyserial/Makefile
new file mode 100644
index 000000000..03bb5333f
--- /dev/null
+++ b/lang/python/python-pyserial/Makefile
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-pyserial
+PKG_VERSION:=3.1.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Micke Prag <micke.prag@telldus.se>
+PKG_LICENSE:=Python-2.0
+
+PKG_SOURCE:=pyserial-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/3c/d8/a9fa247ca60b02b3bebbd61766b4f321393b57b13c53b18f6f62cf172c08/
+PKG_MD5SUM:=2f72100de3e410b36d575e12e82e9d27
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pyserial-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-pyserial
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=python-pyserial
+ URL:=http://pyserial.sourceforge.net
+ DEPENDS:=+python-light
+endef
+
+define Package/python-pyserial/description
+ serial port python bindings
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root="$(PKG_INSTALL_DIR)")
+endef
+
+define Package/python-pyserial/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-pyserial))
diff --git a/lang/python/python-service-identity/Makefile b/lang/python/python-service-identity/Makefile
new file mode 100644
index 000000000..b66927b1d
--- /dev/null
+++ b/lang/python/python-service-identity/Makefile
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=service_identity
+PKG_VERSION:=16.0.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/service_identity
+PKG_MD5SUM:=d52392597b9c44a740abf322bfdb21e6
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-service-identity
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-service-identity
+ URL:=https://github.com/pyca/service_identity
+ DEPENDS:=+python-light +python-attrs +python-pyasn1 +python-pyasn1-modules +python-pyopenssl
+endef
+
+define Package/python-service-identity/description
+service_identity aspires to give you all the tools you need for
+verifying whether a certificate is valid for the intended purposes.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+$(eval $(call PyPackage,python-service-identity))
+$(eval $(call BuildPackage,python-service-identity))
diff --git a/lang/python/python-six/Makefile b/lang/python/python-six/Makefile
new file mode 100644
index 000000000..9f0704954
--- /dev/null
+++ b/lang/python/python-six/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=six
+PKG_VERSION:=1.10.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/six
+PKG_MD5SUM:=34eed507548117b2ab523ab14b2f8b55
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-six
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-six
+ URL:=https://pypi.python.org/pypi/six
+ DEPENDS:=+python-light
+endef
+
+define Package/python-six/description
+Six is a Python 2 and 3 compatibility library. It provides utility functions
+for smoothing over the differences between the Python versions with the goal of
+writing Python code that is compatible on both Python versions. See the
+documentation for more information on what is provided.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+$(eval $(call PyPackage,python-six))
+$(eval $(call BuildPackage,python-six))
diff --git a/lang/python/python-txsocksx/Makefile b/lang/python/python-txsocksx/Makefile
new file mode 100644
index 000000000..d830e6f3a
--- /dev/null
+++ b/lang/python/python-txsocksx/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=txsocksx
+PKG_VERSION:=1.15.0.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/t/txsocksx
+PKG_MD5SUM:=0266b9ae7b58f7550a49683afebf65ba
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-txsocksx
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-txsocksx
+ URL:=https://github.com/habnabit/txsocksx
+ DEPENDS:=+python-light +python-parsley +twisted
+endef
+
+define Package/python-txsocksx/description
+txsocksx is SOCKS4/4a and SOCKS5 client endpoints for Twisted 10.1 or
+greater.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,, \
+ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
+ PKG_VERSION="$(PKG_VERSION)" \
+ )
+endef
+
+$(eval $(call PyPackage,python-txsocksx))
+$(eval $(call BuildPackage,python-txsocksx))
diff --git a/lang/python/python-txsocksx/patches/001-omit-tests.patch b/lang/python/python-txsocksx/patches/001-omit-tests.patch
new file mode 100644
index 000000000..dd4acd7c3
--- /dev/null
+++ b/lang/python/python-txsocksx/patches/001-omit-tests.patch
@@ -0,0 +1,11 @@
+diff --git a/setup.py b/setup.py
+index 7979f89..3873a1e 100644
+--- a/setup.py
++++ b/setup.py
+@@ -35,5 +35,5 @@ setup(
+ 'version_module_paths': ['txsocksx/_version.py'],
+ },
+ install_requires=install_requires,
+- packages=['txsocksx', 'txsocksx.test'],
++ packages=['txsocksx'],
+ )
diff --git a/lang/python/python-txsocksx/patches/002-do-not-use-vcversioner.patch b/lang/python/python-txsocksx/patches/002-do-not-use-vcversioner.patch
new file mode 100644
index 000000000..a904db1e4
--- /dev/null
+++ b/lang/python/python-txsocksx/patches/002-do-not-use-vcversioner.patch
@@ -0,0 +1,29 @@
+diff --git a/setup.py b/setup.py
+index 7979f89..5e1abb3 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,6 +1,8 @@
+ # Copyright (c) Aaron Gallagher <_@habnab.it>
+ # See COPYING for details.
+
++import os
++
+ from setuptools import setup
+
+
+@@ -30,10 +32,11 @@ setup(
+ ],
+ license='ISC',
+
+- setup_requires=['vcversioner>=1'],
+- vcversioner={
+- 'version_module_paths': ['txsocksx/_version.py'],
+- },
++ #setup_requires=['vcversioner>=1'],
++ #vcversioner={
++ # 'version_module_paths': ['txsocksx/_version.py'],
++ #},
++ version=os.environ.get('PKG_VERSION'),
+ install_requires=install_requires,
+ packages=['txsocksx', 'txsocksx.test'],
+ )
diff --git a/lang/python/python-urllib3/Makefile b/lang/python/python-urllib3/Makefile
new file mode 100644
index 000000000..e55c7ed3d
--- /dev/null
+++ b/lang/python/python-urllib3/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2007-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-urllib3
+PKG_VERSION:=1.20
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=urllib3-$(PKG_VERSION).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/urllib3-$(PKG_VERSION)/
+PKG_SOURCE_URL:=https://pypi.python.org/packages/20/56/a6aa403b0998f857b474a538343ee483f5c02491bd1aebf61d42a3f60f77/
+PKG_MD5SUM:=34691d4e7e20a8e9cdb452ea24fc38e7
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-urllib3
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=HTTP library with thread-safe connection pooling, file post, and more.
+ URL:=https://urllib3.readthedocs.io/
+ DEPENDS:=+python
+endef
+
+define Package/python-urllib3/description
+ HTTP library with thread-safe connection pooling, file post, and more.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-urllib3/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-urllib3))
diff --git a/lang/python/python-yaml/Makefile b/lang/python/python-yaml/Makefile
new file mode 100644
index 000000000..3af2f0eeb
--- /dev/null
+++ b/lang/python/python-yaml/Makefile
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=PyYAML
+PKG_VERSION:=3.11
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pyyaml.org/download/pyyaml/
+PKG_MD5SUM:=f50e08ef0fe55178479d3a618efe21db
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DEPENDS:=python
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-yaml
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=YAML parser and emitter for Python
+ URL:=http://pyyaml.org/wiki/PyYAML
+ DEPENDS:=+python +libyaml
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,\
+ --with-libyaml install --prefix="$(PKG_INSTALL_DIR)/usr" \
+ )
+endef
+
+$(eval $(call PyPackage,python-yaml))
+$(eval $(call BuildPackage,python-yaml))
diff --git a/lang/python/Makefile b/lang/python/python/Makefile
index 1e8406087..1e8406087 100644
--- a/lang/python/Makefile
+++ b/lang/python/python/Makefile
diff --git a/lang/python/files/config.site b/lang/python/python/files/config.site
index cfa56b89b..cfa56b89b 100644
--- a/lang/python/files/config.site
+++ b/lang/python/python/files/config.site
diff --git a/lang/python/files/pip.conf b/lang/python/python/files/pip.conf
index 89339e98a..89339e98a 100644
--- a/lang/python/files/pip.conf
+++ b/lang/python/python/files/pip.conf
diff --git a/lang/python/files/python-host.mk b/lang/python/python/files/python-host.mk
index 6953a09d9..6953a09d9 100644
--- a/lang/python/files/python-host.mk
+++ b/lang/python/python/files/python-host.mk
diff --git a/lang/python/files/python-package-codecs.mk b/lang/python/python/files/python-package-codecs.mk
index 7d3c615f3..7d3c615f3 100644
--- a/lang/python/files/python-package-codecs.mk
+++ b/lang/python/python/files/python-package-codecs.mk
diff --git a/lang/python/files/python-package-compiler.mk b/lang/python/python/files/python-package-compiler.mk
index c840ce103..c840ce103 100644
--- a/lang/python/files/python-package-compiler.mk
+++ b/lang/python/python/files/python-package-compiler.mk
diff --git a/lang/python/files/python-package-ctypes.mk b/lang/python/python/files/python-package-ctypes.mk
index 5c34b7a7c..5c34b7a7c 100644
--- a/lang/python/files/python-package-ctypes.mk
+++ b/lang/python/python/files/python-package-ctypes.mk
diff --git a/lang/python/files/python-package-db.mk b/lang/python/python/files/python-package-db.mk
index a257820a3..a257820a3 100644
--- a/lang/python/files/python-package-db.mk
+++ b/lang/python/python/files/python-package-db.mk
diff --git a/lang/python/files/python-package-decimal.mk b/lang/python/python/files/python-package-decimal.mk
index 578486d86..578486d86 100644
--- a/lang/python/files/python-package-decimal.mk
+++ b/lang/python/python/files/python-package-decimal.mk
diff --git a/lang/python/files/python-package-dev.mk b/lang/python/python/files/python-package-dev.mk
index 7c9e21980..7c9e21980 100644
--- a/lang/python/files/python-package-dev.mk
+++ b/lang/python/python/files/python-package-dev.mk
diff --git a/lang/python/files/python-package-distutils.mk b/lang/python/python/files/python-package-distutils.mk
index a139ddba0..a139ddba0 100644
--- a/lang/python/files/python-package-distutils.mk
+++ b/lang/python/python/files/python-package-distutils.mk
diff --git a/lang/python/files/python-package-email.mk b/lang/python/python/files/python-package-email.mk
index 8c15583dc..8c15583dc 100644
--- a/lang/python/files/python-package-email.mk
+++ b/lang/python/python/files/python-package-email.mk
diff --git a/lang/python/files/python-package-gdbm.mk b/lang/python/python/files/python-package-gdbm.mk
index 23c7a293c..23c7a293c 100644
--- a/lang/python/files/python-package-gdbm.mk
+++ b/lang/python/python/files/python-package-gdbm.mk
diff --git a/lang/python/files/python-package-install.sh b/lang/python/python/files/python-package-install.sh
index a08f8b415..a08f8b415 100644
--- a/lang/python/files/python-package-install.sh
+++ b/lang/python/python/files/python-package-install.sh
diff --git a/lang/python/files/python-package-lib2to3.mk b/lang/python/python/files/python-package-lib2to3.mk
index 925cfe204..925cfe204 100644
--- a/lang/python/files/python-package-lib2to3.mk
+++ b/lang/python/python/files/python-package-lib2to3.mk
diff --git a/lang/python/files/python-package-logging.mk b/lang/python/python/files/python-package-logging.mk
index efef5314a..efef5314a 100644
--- a/lang/python/files/python-package-logging.mk
+++ b/lang/python/python/files/python-package-logging.mk
diff --git a/lang/python/files/python-package-multiprocessing.mk b/lang/python/python/files/python-package-multiprocessing.mk
index ccb55f59b..ccb55f59b 100644
--- a/lang/python/files/python-package-multiprocessing.mk
+++ b/lang/python/python/files/python-package-multiprocessing.mk
diff --git a/lang/python/files/python-package-ncurses.mk b/lang/python/python/files/python-package-ncurses.mk
index d952b5034..d952b5034 100644
--- a/lang/python/files/python-package-ncurses.mk
+++ b/lang/python/python/files/python-package-ncurses.mk
diff --git a/lang/python/files/python-package-openssl.mk b/lang/python/python/files/python-package-openssl.mk
index dbf6fe180..dbf6fe180 100644
--- a/lang/python/files/python-package-openssl.mk
+++ b/lang/python/python/files/python-package-openssl.mk
diff --git a/lang/python/files/python-package-pip.mk b/lang/python/python/files/python-package-pip.mk
index 8dd0d6c79..8dd0d6c79 100644
--- a/lang/python/files/python-package-pip.mk
+++ b/lang/python/python/files/python-package-pip.mk
diff --git a/lang/python/files/python-package-pydoc.mk b/lang/python/python/files/python-package-pydoc.mk
index 1e3c38529..1e3c38529 100644
--- a/lang/python/files/python-package-pydoc.mk
+++ b/lang/python/python/files/python-package-pydoc.mk
diff --git a/lang/python/files/python-package-setuptools.mk b/lang/python/python/files/python-package-setuptools.mk
index 48823731e..48823731e 100644
--- a/lang/python/files/python-package-setuptools.mk
+++ b/lang/python/python/files/python-package-setuptools.mk
diff --git a/lang/python/files/python-package-sqlite3.mk b/lang/python/python/files/python-package-sqlite3.mk
index 22a6fbcd2..22a6fbcd2 100644
--- a/lang/python/files/python-package-sqlite3.mk
+++ b/lang/python/python/files/python-package-sqlite3.mk
diff --git a/lang/python/files/python-package-unittest.mk b/lang/python/python/files/python-package-unittest.mk
index 3c93f5136..3c93f5136 100644
--- a/lang/python/files/python-package-unittest.mk
+++ b/lang/python/python/files/python-package-unittest.mk
diff --git a/lang/python/files/python-package-xml.mk b/lang/python/python/files/python-package-xml.mk
index 28e734ea4..28e734ea4 100644
--- a/lang/python/files/python-package-xml.mk
+++ b/lang/python/python/files/python-package-xml.mk
diff --git a/lang/python/files/python-package.mk b/lang/python/python/files/python-package.mk
index e9ec85c6f..e9ec85c6f 100644
--- a/lang/python/files/python-package.mk
+++ b/lang/python/python/files/python-package.mk
diff --git a/lang/python/files/python-version.mk b/lang/python/python/files/python-version.mk
index b31a1d5a8..b31a1d5a8 100644
--- a/lang/python/files/python-version.mk
+++ b/lang/python/python/files/python-version.mk
diff --git a/lang/python/patches/001-enable-zlib.patch b/lang/python/python/patches/001-enable-zlib.patch
index 780831e86..780831e86 100644
--- a/lang/python/patches/001-enable-zlib.patch
+++ b/lang/python/python/patches/001-enable-zlib.patch
diff --git a/lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch b/lang/python/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch
index fb2fe8a77..fb2fe8a77 100644
--- a/lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch
+++ b/lang/python/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch
diff --git a/lang/python/patches/003-do-not-compile-tests-at-build.patch b/lang/python/python/patches/003-do-not-compile-tests-at-build.patch
index a6774e174..a6774e174 100644
--- a/lang/python/patches/003-do-not-compile-tests-at-build.patch
+++ b/lang/python/python/patches/003-do-not-compile-tests-at-build.patch
diff --git a/lang/python/patches/004-do-not-write-bytes-codes.patch b/lang/python/python/patches/004-do-not-write-bytes-codes.patch
index f67e7dcad..f67e7dcad 100644
--- a/lang/python/patches/004-do-not-write-bytes-codes.patch
+++ b/lang/python/python/patches/004-do-not-write-bytes-codes.patch
diff --git a/lang/python/patches/006-remove-debian-multiarch-support.patch b/lang/python/python/patches/006-remove-debian-multiarch-support.patch
index 01aa924ab..01aa924ab 100644
--- a/lang/python/patches/006-remove-debian-multiarch-support.patch
+++ b/lang/python/python/patches/006-remove-debian-multiarch-support.patch
diff --git a/lang/python/patches/007-distutils-do-not-adjust-path.patch b/lang/python/python/patches/007-distutils-do-not-adjust-path.patch
index 49fe92629..49fe92629 100644
--- a/lang/python/patches/007-distutils-do-not-adjust-path.patch
+++ b/lang/python/python/patches/007-distutils-do-not-adjust-path.patch
diff --git a/lang/python/patches/008-distutils-use-python-sysroot.patch b/lang/python/python/patches/008-distutils-use-python-sysroot.patch
index 7cd748761..7cd748761 100644
--- a/lang/python/patches/008-distutils-use-python-sysroot.patch
+++ b/lang/python/python/patches/008-distutils-use-python-sysroot.patch
diff --git a/lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch b/lang/python/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch
index b59809754..b59809754 100644
--- a/lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch
+++ b/lang/python/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch
diff --git a/lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch b/lang/python/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
index 5a106d4e8..5a106d4e8 100644
--- a/lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
+++ b/lang/python/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
diff --git a/lang/python/patches/011-remove-setupterm-definition.patch b/lang/python/python/patches/011-remove-setupterm-definition.patch
index e55d70818..e55d70818 100644
--- a/lang/python/patches/011-remove-setupterm-definition.patch
+++ b/lang/python/python/patches/011-remove-setupterm-definition.patch
diff --git a/lang/python/python3-bottle/Makefile b/lang/python/python3-bottle/Makefile
new file mode 100644
index 000000000..93e959e41
--- /dev/null
+++ b/lang/python/python3-bottle/Makefile
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python3-bottle
+PKG_VERSION:=0.12.12
+PKG_RELEASE:=1
+
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+
+PKG_SOURCE:=bottle-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/f7/dd/8ceaa148eeed5371a83fa1fb5a54b01dfc95000799c649924ece23f9f0e1/
+PKG_MD5SUM:=3d4b6b0e22f67b421c273105b30d9a21fd147eaf0c1576172378ee034fbf5313
+PKG_BUILD_DIR:=$(BUILD_DIR)/bottle-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python3-package.mk)
+
+define Package/python3-bottle
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=Bottle is a fast, simple and lightweight WSGI micro web-framework for Python
+ URL:=http://bottlepy.org
+ DEPENDS:=+python3
+endef
+
+define Package/python3-bottle/description
+ Bottle is a fast, simple and lightweight WSGI micro web-framework for Python.
+ It is distributed as a single file module and has no dependencies other than the
+ Python Standard Library.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/python3-bottle/install
+ $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
+ $(CP) $(PKG_BUILD_DIR)/bottle.py $(1)$(PYTHON3_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python3-bottle))
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
new file mode 100644
index 000000000..584dcbb5f
--- /dev/null
+++ b/lang/python/python3/Makefile
@@ -0,0 +1,305 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+# The file included below defines PYTHON_VERSION
+include ./files/python3-version.mk
+
+PYTHON_VERSION:=$(PYTHON3_VERSION)
+PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
+
+PKG_NAME:=python3
+PKG_RELEASE:=1
+PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
+
+PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
+PKG_MD5SUM:=692b4fc3a2ba0d54d1495d4ead5b0b5c
+PKG_HASH:=a01810ddfcec216bcdb357a84bfaafdfaa0ca42bbdaa4cb7ff74f5a9961e4041
+
+PKG_LICENSE:=PSF
+PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
+
+# This file provides the necsessary host build variables
+include ./files/python3-host.mk
+
+# For Py3Package
+include ./files/python3-package.mk
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+HOST_BUILD_PARALLEL:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=python3/host
+HOST_BUILD_DEPENDS:=bzip2/host expat/host libffi/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/python3/Default
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Python $(PYTHON_VERSION) programming language
+ URL:=https://www.python.org/
+ MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+endef
+
+define Package/python3/Default/description
+ Python is a dynamic object-oriented programming language that can be used
+ for many kinds of software development. It offers strong support for
+ integration with other languages and tools, comes with extensive standard
+ libraries, and can be learned in a few days. Many Python programmers
+ report substantial productivity gains and feel the language encourages
+ the development of higher quality, more maintainable code.
+endef
+
+define Package/python3-base
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON_VERSION) interpreter
+ DEPENDS:=+libpthread +zlib
+endef
+
+define Package/python3-base/description
+ This package contains only the interpreter and the bare minimum
+ for the interpreter to start.
+endef
+
+define Package/python3-light
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON_VERSION) light installation
+ DEPENDS:=+python3-base +libffi +libbz2
+endef
+
+define Package/python3-light/description
+ This package is essentially the python3-base package plus
+ a few of the rarely used (and big) libraries stripped out
+ into separate packages.
+endef
+
+PYTHON3_LIB_FILES_DEL:=
+PYTHON3_PACKAGES:=
+PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR).so
+PYTHON3_PACKAGES_DEPENDS:=
+define Py3BasePackage
+ PYTHON3_PACKAGES+=$(1)
+ ifeq ($(3),)
+ PYTHON3_PACKAGES_DEPENDS+=$(1)
+ endif
+ PYTHON3_LIB_FILES_DEL+=$(2)
+ define Py3Package/$(1)/filespec
+ ifneq ($(2),)
+ $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
+ -|/usr/lib/python$(PYTHON_VERSION)/*/test
+ -|/usr/lib/python$(PYTHON_VERSION)/*/tests
+ endif
+ endef
+endef
+
+include ./files/python3-package-*.mk
+
+define Package/python3
+$(call Package/python3/Default)
+ DEPENDS:=+python3-light $(foreach package,$(PYTHON3_PACKAGES_DEPENDS),+$(package))
+endef
+
+define Package/python3/description
+ This package contains the (almost) full Python install.
+ It's python3-light + all other packages.
+endef
+
+MAKE_FLAGS+=\
+ CROSS_COMPILE=yes \
+ LD="$(TARGET_CC)" \
+ PGEN=pgen3
+
+EXTRA_CFLAGS+= \
+ -DNDEBUG -fno-inline
+EXTRA_LDFLAGS+= \
+ -L$(PKG_BUILD_DIR)
+
+ENABLE_IPV6:=
+ifeq ($(CONFIG_IPV6),y)
+ ENABLE_IPV6 += --enable-ipv6
+endif
+
+PYTHON_FOR_BUILD:= \
+ _PYTHON_PROJECT_BASE=$(PKG_BUILD_DIR) \
+ _PYTHON_HOST_PLATFORM=linux2 \
+ PYTHONPATH="$(PKG_BUILD_DIR)/Lib:$(PKG_BUILD_DIR)/build/lib.linux2-$(PYTHON_VERSION)" \
+ _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata \
+ $(HOST_PYTHON3_BIN)
+
+CONFIGURE_ARGS+= \
+ --sysconfdir=/etc \
+ --enable-shared \
+ --without-cxx-main \
+ --with-threads \
+ --with-system-ffi \
+ --with-ensurepip=no \
+ --without-pymalloc \
+ PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)" \
+ $(ENABLE_IPV6) \
+ CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
+ OPT="$(TARGET_CFLAGS)"
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ $(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
+endef
+
+ifdef CONFIG_PACKAGE_python3-setuptools
+define Build/Compile/python3-setuptools
+ $(STAGING_DIR_HOSTPKG)/bin/pip3 install \
+ --ignore-installed \
+ --root=$(PKG_BUILD_DIR)/install-setuptools --prefix=. \
+ $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-*.whl
+endef
+endif # CONFIG_PACKAGE_python3-setuptools
+
+ifdef CONFIG_PACKAGE_python3-pip
+define Build/Compile/python3-pip
+ $(STAGING_DIR_HOSTPKG)/bin/pip3 install \
+ --ignore-installed \
+ --root=$(PKG_BUILD_DIR)/install-pip --prefix=. \
+ $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-*.whl
+endef
+endif # CONFIG_PACKAGE_python3-pip
+
+define Build/Compile
+ $(call Build/Compile/Default)
+ # Use host pip to install python-setuptools
+ $(call Build/Compile/python3-setuptools)
+ $(call Build/Compile/python3-pip)
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(STAGING_DIR)/mk/
+ $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
+ $(INSTALL_DATA) \
+ ./files/python3-package.mk \
+ ./files/python3-host.mk \
+ ./files/python3-version.mk \
+ ./files/python3-package-install.sh \
+ $(STAGING_DIR)/mk/
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
+ $(1)/usr/include/
+ $(CP) \
+ $(HOST_PYTHON3_LIB_DIR) \
+ $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
+ $(1)/usr/lib/
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
+ $(1)/usr/lib/python$(PYTHON_VERSION)/
+endef
+
+PYTHON3_BASE_LIB_FILES:= \
+ /usr/lib/python$(PYTHON_VERSION)/encodings \
+ /usr/lib/python$(PYTHON_VERSION)/_collections_abc.py \
+ /usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.py \
+ /usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py \
+ /usr/lib/python$(PYTHON_VERSION)/_weakrefset.py \
+ /usr/lib/python$(PYTHON_VERSION)/abc.py \
+ /usr/lib/python$(PYTHON_VERSION)/codecs.py \
+ /usr/lib/python$(PYTHON_VERSION)/genericpath.py \
+ /usr/lib/python$(PYTHON_VERSION)/io.py \
+ /usr/lib/python$(PYTHON_VERSION)/os.py \
+ /usr/lib/python$(PYTHON_VERSION)/posixpath.py \
+ /usr/lib/python$(PYTHON_VERSION)/site.py \
+ /usr/lib/python$(PYTHON_VERSION)/sysconfig.py \
+ /usr/lib/python$(PYTHON_VERSION)/stat.py
+
+PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES)
+
+define Py3Package/python3-base/filespec
++|/usr/bin/python$(PYTHON_VERSION)
+$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES),+|$(lib_file)))
+endef
+
+define Py3Package/python3-light/filespec
++|/usr/lib/python$(PYTHON_VERSION)
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
+-|/usr/lib/python$(PYTHON_VERSION)/ensurepip
+-|/usr/lib/python$(PYTHON_VERSION)/idlelib
+-|/usr/lib/python$(PYTHON_VERSION)/tkinter
+-|/usr/lib/python$(PYTHON_VERSION)/turtledemo
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_test*.so
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline*.so
+-|/usr/lib/python$(PYTHON_VERSION)/pdb.doc
+-|/usr/lib/python$(PYTHON_VERSION)/test
+-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
+-|/usr/lib/python$(PYTHON_VERSION)/*/test
+-|/usr/lib/python$(PYTHON_VERSION)/*/tests
+-|/usr/lib/python$(PYTHON_VERSION)/_osx_support.py
+$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_LIB_FILES_DEL),-|$(lib_file)))
+endef
+
+define Py3Package/python3-base/install
+ # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
+ $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
+endef
+
+define Py3Package/python3/filespec
+-|$(PYTHON3_PKG_DIR)
+endef
+
+HOST_LDFLAGS += \
+ $$$$(pkg-config --static --libs libcrypto libssl)
+
+HOST_CONFIGURE_ARGS+= \
+ --without-cxx-main \
+ --without-pymalloc \
+ --with-threads \
+ --prefix=$(HOST_PYTHON3_DIR) \
+ --exec-prefix=$(HOST_PYTHON3_DIR) \
+ --with-system-expat=$(STAGING_DIR_HOSTPKG) \
+ --with-system-ffi=no \
+ --with-ensurepip=install \
+ CONFIG_SITE=
+
+define Host/Compile
+ +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
+ +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods
+endef
+
+define Host/Install
+ $(MAKE) -C $(HOST_BUILD_DIR) install
+
+ $(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON3_DIR)/bin/pgen3
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(HOST_PYTHON3_DIR)/bin/_freeze_importlib
+endef
+
+$(eval $(call HostBuild))
+
+$(foreach package, $(PYTHON3_PACKAGES), \
+ $(eval $(call Py3Package,$(package))) \
+ $(eval $(call BuildPackage,$(package))) \
+ $(eval $(call BuildPackage,$(package)-src)) \
+)
+
+$(eval $(call Py3Package,python3-base))
+$(eval $(call Py3Package,python3-light))
+$(eval $(call Py3Package,python3))
+
+$(eval $(call BuildPackage,python3-base))
+$(eval $(call BuildPackage,python3-light))
+$(eval $(call BuildPackage,python3))
+
+$(eval $(call BuildPackage,python3-base-src))
+$(eval $(call BuildPackage,python3-light-src))
+$(eval $(call BuildPackage,python3-src))
diff --git a/lang/python/python3/files/config.site b/lang/python/python3/files/config.site
new file mode 100644
index 000000000..cfa56b89b
--- /dev/null
+++ b/lang/python/python3/files/config.site
@@ -0,0 +1,12 @@
+#! /bin/sh
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+ac_cv_file__dev_ptmx=yes
+ac_cv_file__dev_ptc=no
+ac_cv_buggy_getaddrinfo=no
+
diff --git a/lang/python/python3/files/python3-host.mk b/lang/python/python3/files/python3-host.mk
new file mode 100644
index 000000000..3abf6aa5f
--- /dev/null
+++ b/lang/python/python3/files/python3-host.mk
@@ -0,0 +1,81 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+ifneq ($(__python3_host_mk_inc),1)
+__python3_host_mk_inc=1
+
+# For PYTHON3_VERSION
+$(call include_mk, python3-version.mk)
+
+HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
+HOST_PYTHON3_INC_DIR:=$(HOST_PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
+HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
+
+HOST_PYTHON3_PKG_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)/site-packages
+
+HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION)
+
+HOST_PYTHON3PATH:=$(HOST_PYTHON3_LIB_DIR):$(HOST_PYTHON3_PKG_DIR)
+
+define HostPython3
+ if [ "$(strip $(3))" == "HOST" ]; then \
+ export PYTHONPATH="$(HOST_PYTHON3PATH)"; \
+ export PYTHONDONTWRITEBYTECODE=0; \
+ else \
+ export PYTHONPATH="$(PYTHON3PATH)"; \
+ export PYTHONDONTWRITEBYTECODE=1; \
+ export _python_sysroot="$(STAGING_DIR)"; \
+ export _python_prefix="/usr"; \
+ export _python_exec_prefix="/usr"; \
+ fi; \
+ export PYTHONOPTIMIZE=""; \
+ $(1) \
+ $(HOST_PYTHON3_BIN) $(2);
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPy3RunHost
+ $(call HostPython3, \
+ $(if $(1),$(1);) \
+ CC="$(HOSTCC)" \
+ CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
+ CXX="$(HOSTCXX)" \
+ LD="$(HOSTCC)" \
+ LDSHARED="$(HOSTCC) -shared" \
+ CFLAGS="$(HOST_CFLAGS)" \
+ CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
+ LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
+ _PYTHON_HOST_PLATFORM=linux2 \
+ $(3) \
+ , \
+ $(2) \
+ , \
+ HOST \
+ )
+endef
+
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/HostPy3Mod
+ $(call Build/Compile/HostPy3RunHost, \
+ cd $(HOST_BUILD_DIR)/$(strip $(1)), \
+ ./setup.py $(2), \
+ $(3))
+endef
+
+define HostPy3/Compile/Default
+ $(call Build/Compile/HostPy3Mod,,\
+ install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
+ --single-version-externally-managed \
+ )
+endef
+
+endif # __python3_host_mk_inc
diff --git a/lang/python/python3/files/python3-package-asyncio.mk b/lang/python/python3/files/python3-package-asyncio.mk
new file mode 100644
index 000000000..52eccae92
--- /dev/null
+++ b/lang/python/python3/files/python3-package-asyncio.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-asyncio
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) asyncio module
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-asyncio, \
+ /usr/lib/python$(PYTHON3_VERSION)/asyncio \
+))
diff --git a/lang/python/python3/files/python3-package-codecs.mk b/lang/python/python3/files/python3-package-codecs.mk
new file mode 100644
index 000000000..f768b02ea
--- /dev/null
+++ b/lang/python/python3/files/python3-package-codecs.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-codecs
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) codecs + unicode support
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-codecs, \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_cn.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_hk.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_iso2022.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_jp.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_kr.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_tw.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/unicodedata.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-ctypes.mk b/lang/python/python3/files/python3-package-ctypes.mk
new file mode 100644
index 000000000..f38e0118c
--- /dev/null
+++ b/lang/python/python3/files/python3-package-ctypes.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-ctypes
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) ctypes module
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-ctypes, \
+ /usr/lib/python$(PYTHON3_VERSION)/ctypes \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes_test.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-dbm.mk b/lang/python/python3/files/python3-package-dbm.mk
new file mode 100644
index 000000000..409940229
--- /dev/null
+++ b/lang/python/python3/files/python3-package-dbm.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-dbm
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) dbm module
+ DEPENDS:=+python3-light +libdb47
+endef
+
+$(eval $(call Py3BasePackage,python3-dbm, \
+ /usr/lib/python$(PYTHON3_VERSION)/dbm \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_dbm.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-decimal.mk b/lang/python/python3/files/python3-package-decimal.mk
new file mode 100644
index 000000000..391b6f659
--- /dev/null
+++ b/lang/python/python3/files/python3-package-decimal.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-decimal
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) decimal module
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-decimal, \
+ /usr/lib/python$(PYTHON3_VERSION)/decimal.py \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_decimal.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-dev.mk b/lang/python/python3/files/python3-package-dev.mk
new file mode 100644
index 000000000..642bb0b5f
--- /dev/null
+++ b/lang/python/python3/files/python3-package-dev.mk
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-dev
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) development files
+ DEPENDS:=+python3 +python3-lib2to3
+endef
+
+define Py3Package/python3-dev/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config $(1)/usr/bin
+ $(LN) python$(PYTHON3_VERSION)-config $(1)/usr/bin/python3-config
+ $(LN) python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)/libpython$(PYTHON3_VERSION).a $(1)/usr/lib/
+endef
+
+$(eval $(call Py3BasePackage,python3-dev, \
+ /usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
+ /usr/include/python$(PYTHON_VERSION) \
+ /usr/lib/pkgconfig \
+ , \
+ DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python3/files/python3-package-distutils.mk b/lang/python/python3/files/python3-package-distutils.mk
new file mode 100644
index 000000000..b1f1fb5c6
--- /dev/null
+++ b/lang/python/python3/files/python3-package-distutils.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-distutils
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) distutils module
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-distutils, \
+ /usr/lib/python$(PYTHON3_VERSION)/distutils \
+))
diff --git a/lang/python/python3/files/python3-package-email.mk b/lang/python/python3/files/python3-package-email.mk
new file mode 100644
index 000000000..6cf44071d
--- /dev/null
+++ b/lang/python/python3/files/python3-package-email.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-email
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) email module
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-email, \
+ /usr/lib/python$(PYTHON3_VERSION)/email \
+))
diff --git a/lang/python/python3/files/python3-package-gdbm.mk b/lang/python/python3/files/python3-package-gdbm.mk
new file mode 100644
index 000000000..7f98badf3
--- /dev/null
+++ b/lang/python/python3/files/python3-package-gdbm.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-gdbm
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) gdbm module
+ DEPENDS:=+python3-light +libgdbm
+endef
+
+$(eval $(call Py3BasePackage,python3-gdbm, \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_gdbm.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-install.sh b/lang/python/python3/files/python3-package-install.sh
new file mode 100644
index 000000000..cc1005189
--- /dev/null
+++ b/lang/python/python3/files/python3-package-install.sh
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+process_filespec() {
+ local src_dir="$1"
+ local dst_dir="$2"
+ local filespec="$3"
+ echo "$filespec" | (
+ IFS='|'
+ while read fop fspec fperm; do
+ local fop=`echo "$fop" | tr -d ' \t\n'`
+ if [ "$fop" = "+" ]; then
+ if [ ! -e "${src_dir}${fspec}" ]; then
+ echo "File not found '${src_dir}${fspec}'"
+ exit 1
+ fi
+ dpath=`dirname "$fspec"`
+ if [ -z "$fperm" ]; then
+ dperm=`stat -c "%a" ${src_dir}${dpath}`
+ fi
+ mkdir -p -m$dperm ${dst_dir}${dpath}
+ echo "copying: '$fspec'"
+ cp -fpR ${src_dir}${fspec} ${dst_dir}${dpath}/
+ if [ -n "$fperm" ]; then
+ chmod -R $fperm ${dst_dir}${fspec}
+ fi
+ elif [ "$fop" = "-" ]; then
+ echo "removing: '$fspec'"
+ rm -fR ${dst_dir}${fspec}
+ elif [ "$fop" = "=" ]; then
+ echo "setting permissions: '$fperm' on '$fspec'"
+ chmod -R $fperm ${dst_dir}${fspec}
+ fi
+ done
+ )
+}
+
+src_dir="$1"
+dst_dir="$2"
+python="$3"
+mode="$4"
+filespec="$5"
+
+process_filespec "$src_dir" "$dst_dir" "$filespec" || {
+ echo "process filespec error-ed"
+ exit 1
+}
+
+if [ "$mode" == "sources" ] ; then
+ # Copy only python source files
+ find $dst_dir -not -name "*\.py" | xargs rm -f
+ # Delete empty folders (if the case)
+ find $dst_dir/usr -type d | xargs rmdir &> /dev/null
+ rmdir $dst_dir/usr &> /dev/null
+ exit 0
+fi
+
+# XXX [So that you won't goof as I did]
+# Note: Yes, I tried to use the -O & -OO flags here.
+# However the generated byte-codes were not portable.
+# So, we just stuck to un-optimized byte-codes,
+# which is still way better/faster than running
+# Python sources all the time.
+$python -m compileall -b -d '/' $dst_dir || {
+ echo "python -m compileall err-ed"
+ exit 1
+}
+# Delete source files and pyc [ un-optimized bytecode files ]
+# We may want to make this optimization thing configurable later, but not sure atm
+find $dst_dir -name "*\.py" | xargs rm -f
diff --git a/lang/python/python3/files/python3-package-lib2to3.mk b/lang/python/python3/files/python3-package-lib2to3.mk
new file mode 100644
index 000000000..ed712b6fd
--- /dev/null
+++ b/lang/python/python3/files/python3-package-lib2to3.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-lib2to3
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) lib2to3 module
+ DEPENDS:=+python3
+endef
+
+$(eval $(call Py3BasePackage,python3-lib2to3, \
+ /usr/lib/python$(PYTHON3_VERSION)/lib2to3 \
+ , \
+ DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python3/files/python3-package-logging.mk b/lang/python/python3/files/python3-package-logging.mk
new file mode 100644
index 000000000..fa3ec0e17
--- /dev/null
+++ b/lang/python/python3/files/python3-package-logging.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-logging
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) logging module
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-logging, \
+ /usr/lib/python$(PYTHON3_VERSION)/logging \
+))
diff --git a/lang/python/python3/files/python3-package-lzma.mk b/lang/python/python3/files/python3-package-lzma.mk
new file mode 100644
index 000000000..57b38eced
--- /dev/null
+++ b/lang/python/python3/files/python3-package-lzma.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-lzma
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) lzma module
+ DEPENDS:=+python3-light +liblzma
+endef
+
+$(eval $(call Py3BasePackage,python3-lzma, \
+ /usr/lib/python$(PYTHON3_VERSION)/lzma.py \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_lzma.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-multiprocessing.mk b/lang/python/python3/files/python3-package-multiprocessing.mk
new file mode 100644
index 000000000..c7976016d
--- /dev/null
+++ b/lang/python/python3/files/python3-package-multiprocessing.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-multiprocessing
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) multiprocessing
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-multiprocessing, \
+ /usr/lib/python$(PYTHON3_VERSION)/multiprocessing \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_multiprocessing.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-ncurses.mk b/lang/python/python3/files/python3-package-ncurses.mk
new file mode 100644
index 000000000..45649ac75
--- /dev/null
+++ b/lang/python/python3/files/python3-package-ncurses.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-ncurses
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) ncurses module
+ DEPENDS:=+python3-light +libncurses
+endef
+
+$(eval $(call Py3BasePackage,python3-ncurses, \
+ /usr/lib/python$(PYTHON3_VERSION)/curses \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses_panel.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-openssl.mk b/lang/python/python3/files/python3-package-openssl.mk
new file mode 100644
index 000000000..6971993f7
--- /dev/null
+++ b/lang/python/python3/files/python3-package-openssl.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-openssl
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) SSL module
+ DEPENDS:=+python3-light +libopenssl
+endef
+
+$(eval $(call Py3BasePackage,python3-openssl, \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_hashlib.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ssl.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-pip.mk b/lang/python/python3/files/python3-package-pip.mk
new file mode 100644
index 000000000..0bd54aac8
--- /dev/null
+++ b/lang/python/python3/files/python3-package-pip.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-pip
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) pip module
+ VERSION:=$(PYTHON3_PIP_VERSION)
+ DEPENDS:=+python3 +python3-setuptools +python-pip-conf
+endef
+
+define Py3Package/python3-pip/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
+ # Adjust shebang to proper python location on target
+ sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON3_VERSION)/" -i $(PKG_BUILD_DIR)/install-pip/bin/*
+ $(CP) $(PKG_BUILD_DIR)/install-pip/bin/pip3* $(1)/usr/bin
+ $(CP) \
+ $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages/pip \
+ $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/
+endef
+
+$(eval $(call Py3BasePackage,python3-pip, \
+ , \
+ DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python3/files/python3-package-pydoc.mk b/lang/python/python3/files/python3-package-pydoc.mk
new file mode 100644
index 000000000..9ab1a5b8b
--- /dev/null
+++ b/lang/python/python3/files/python3-package-pydoc.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-pydoc
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) pydoc module
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-pydoc, \
+ /usr/lib/python$(PYTHON3_VERSION)/doctest.py \
+ /usr/lib/python$(PYTHON3_VERSION)/pydoc.py \
+ /usr/lib/python$(PYTHON3_VERSION)/pydoc_data \
+))
diff --git a/lang/python/python3/files/python3-package-setuptools.mk b/lang/python/python3/files/python3-package-setuptools.mk
new file mode 100644
index 000000000..52d56e9ed
--- /dev/null
+++ b/lang/python/python3/files/python3-package-setuptools.mk
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-setuptools
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) setuptools module
+ VERSION:=$(PYTHON3_SETUPTOOLS_VERSION)
+ DEPENDS:=+python3
+endef
+
+define Py3Package/python3-setuptools/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
+ # Adjust shebang to proper python location on target
+ sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON3_VERSION)/" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
+ $(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/easy_install-* $(1)/usr/bin
+ $(LN) easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/easy_install-3
+ $(CP) \
+ $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/pkg_resources \
+ $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/setuptools \
+ $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \
+ $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
+endef
+
+$(eval $(call Py3BasePackage,python3-setuptools, \
+ , \
+ DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python3/files/python3-package-sqlite3.mk b/lang/python/python3/files/python3-package-sqlite3.mk
new file mode 100644
index 000000000..665bff26a
--- /dev/null
+++ b/lang/python/python3/files/python3-package-sqlite3.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-sqlite3
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) sqlite3 module
+ DEPENDS:=+python3-light +libsqlite3
+endef
+
+$(eval $(call Py3BasePackage,python3-sqlite3, \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_sqlite3.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/sqlite3 \
+))
diff --git a/lang/python/python3/files/python3-package-unittest.mk b/lang/python/python3/files/python3-package-unittest.mk
new file mode 100644
index 000000000..d9df86f71
--- /dev/null
+++ b/lang/python/python3/files/python3-package-unittest.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-unittest
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) unittest module
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-unittest, \
+ /usr/lib/python$(PYTHON3_VERSION)/unittest \
+))
diff --git a/lang/python/python3/files/python3-package-xml.mk b/lang/python/python3/files/python3-package-xml.mk
new file mode 100644
index 000000000..4893fa93c
--- /dev/null
+++ b/lang/python/python3/files/python3-package-xml.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-xml
+$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON3_VERSION) xml libs
+ DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-xml, \
+ /usr/lib/python$(PYTHON3_VERSION)/xml \
+ /usr/lib/python$(PYTHON3_VERSION)/xmlrpc \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_elementtree.$(PYTHON3_SO_SUFFIX) \
+ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/pyexpat.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package.mk b/lang/python/python3/files/python3-package.mk
new file mode 100644
index 000000000..a28689aba
--- /dev/null
+++ b/lang/python/python3/files/python3-package.mk
@@ -0,0 +1,137 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+$(call include_mk, python3-version.mk)
+
+PYTHON3_DIR:=$(STAGING_DIR)/usr
+PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
+PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
+PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
+
+PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
+
+PYTHON3:=python$(PYTHON3_VERSION)
+
+PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
+
+# These configure args are needed in detection of path to Python header files
+# using autotools.
+CONFIGURE_ARGS += \
+ _python_sysroot="$(STAGING_DIR)" \
+ _python_prefix="/usr" \
+ _python_exec_prefix="/usr"
+
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+ TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
+define Py3Package
+
+ define Package/$(1)-src
+ $(call Package/$(1))
+ TITLE+= (sources)
+ DEPENDS:=$$$$(foreach dep,$$$$(filter +python3-%,$$$$(DEPENDS)),$$$$(dep)-src)
+ endef
+
+ define Package/$(1)-src/description
+ $(call Package/$(1)/description).
+ (Contains the Python3 sources for this package).
+ endef
+
+ # Add default PyPackage filespec none defined
+ ifndef Py3Package/$(1)/filespec
+ define Py3Package/$(1)/filespec
+ +|$(PYTHON3_PKG_DIR)
+ endef
+ endif
+
+ ifndef Py3Package/$(1)/install
+ define Py3Package/$(1)/install
+ if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
+ $(INSTALL_DIR) $$(1)/usr/bin ; \
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
+ fi
+ endef
+ endif
+
+ $(call shexport,Py3Package/$(1)/filespec)
+
+ define Package/$(1)/install
+ $(call Py3Package/$(1)/install,$$(1))
+ find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+ if [ -e files/python3-package-install.sh ] ; then \
+ $(SHELL) files/python3-package-install.sh \
+ "$(PKG_INSTALL_DIR)" "$$(1)" \
+ "$(HOST_PYTHON3_BIN)" "$$(2)" \
+ "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" ; \
+ elif [ -e $(STAGING_DIR)/mk/python3-package-install.sh ] ; then \
+ $(SHELL) $(STAGING_DIR)/mk/python3-package-install.sh \
+ "$(PKG_INSTALL_DIR)" "$$(1)" \
+ "$(HOST_PYTHON3_BIN)" "$$(2)" \
+ "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" ; \
+ else \
+ echo "No 'python3-package-install.sh' script found" ; \
+ exit 1 ; \
+ fi
+ endef
+
+ define Package/$(1)-src/install
+ $$(call Package/$(1)/install,$$(1),sources)
+ endef
+endef
+
+$(call include_mk, python3-host.mk)
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPy3RunTarget
+ $(call HostPython3, \
+ $(if $(1),$(1);) \
+ CC="$(TARGET_CC)" \
+ CCSHARED="$(TARGET_CC) $(FPIC)" \
+ CXX="$(TARGET_CXX)" \
+ LD="$(TARGET_CC)" \
+ LDSHARED="$(TARGET_CC) -shared" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
+ LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
+ _PYTHON_HOST_PLATFORM=linux2 \
+ __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
+ $(3) \
+ , \
+ $(2) \
+ )
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/Py3Mod
+ $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
+ $(call Build/Compile/HostPy3RunTarget, \
+ cd $(PKG_BUILD_DIR)/$(strip $(1)), \
+ ./setup.py $(2), \
+ $(3))
+ find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+endef
+
+define Py3Build/Compile/Default
+ $(call Build/Compile/Py3Mod,, \
+ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+ --single-version-externally-managed \
+ )
+endef
+
+ifeq ($(BUILD_VARIANT),python3)
+define Build/Compile
+ $(call Py3Build/Compile/Default)
+endef
+endif # python3
diff --git a/lang/python/python3/files/python3-version.mk b/lang/python/python3/files/python3-version.mk
new file mode 100644
index 000000000..efe953cdc
--- /dev/null
+++ b/lang/python/python3/files/python3-version.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: keep in sync with setuptools & pip
+PYTHON3_VERSION_MAJOR:=3
+PYTHON3_VERSION_MINOR:=6
+PYTHON3_VERSION_MICRO:=1
+
+PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
+
+PYTHON3_SETUPTOOLS_VERSION:=28.8.0
+PYTHON3_PIP_VERSION:=9.0.1
+
diff --git a/lang/python/python3/patches/001-enable-zlib.patch b/lang/python/python3/patches/001-enable-zlib.patch
new file mode 100644
index 000000000..780831e86
--- /dev/null
+++ b/lang/python/python3/patches/001-enable-zlib.patch
@@ -0,0 +1,25 @@
+From 6eeab87bc852481e599325549c854b701bf2e39f Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Thu, 25 Sep 2014 18:18:29 +0300
+Subject: [PATCH] enable zlib
+
+---
+ Modules/Setup.dist | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Modules/Setup.dist b/Modules/Setup.dist
+index 01fb85f..01ac492 100644
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -358,7 +358,7 @@ _symtable symtablemodule.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+
+ # Interface to the Expat XML parser
+ #
+--
+1.8.4.5
+
diff --git a/lang/python/python3/patches/003-do-not-run-distutils-tests.patch b/lang/python/python3/patches/003-do-not-run-distutils-tests.patch
new file mode 100644
index 000000000..77c089f5f
--- /dev/null
+++ b/lang/python/python3/patches/003-do-not-run-distutils-tests.patch
@@ -0,0 +1,46 @@
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index ce2c0aa..b0c8322 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1256,41 +1256,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+ done; \
+ done
+ $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+- if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+- $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+- $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+- fi
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST) -f \
+- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+- $(DESTDIR)$(LIBDEST)
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST) -f \
+- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+- $(DESTDIR)$(LIBDEST)
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST) -f \
+- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+- $(DESTDIR)$(LIBDEST)
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST)/site-packages -f \
+- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST)/site-packages -f \
+- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST)/site-packages -f \
+- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
diff --git a/lang/python/python3/patches/004-do-not-write-bytes-codes.patch b/lang/python/python3/patches/004-do-not-write-bytes-codes.patch
new file mode 100644
index 000000000..1da7b8be8
--- /dev/null
+++ b/lang/python/python3/patches/004-do-not-write-bytes-codes.patch
@@ -0,0 +1,22 @@
+diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
+index a17adf7..415b3f6 100644
+--- a/Python/pylifecycle.c
++++ b/Python/pylifecycle.c
+@@ -86,7 +86,7 @@ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
+ int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
+ int Py_FrozenFlag; /* Needed by getpath.c */
+ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+ int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
+ int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
+ int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
+@@ -309,7 +309,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
+ if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
+ Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
+ if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
+- Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
++ Py_DontWriteBytecodeFlag = atoi(p);
+ /* The variable is only tested for existence here; _PyRandom_Init will
+ check its value further. */
+ if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')
diff --git a/lang/python/python3/patches/006-remove-debian-multiarch-support.patch b/lang/python/python3/patches/006-remove-debian-multiarch-support.patch
new file mode 100644
index 000000000..52d52b94e
--- /dev/null
+++ b/lang/python/python3/patches/006-remove-debian-multiarch-support.patch
@@ -0,0 +1,12 @@
+diff --git a/setup.py b/setup.py
+index 7868b7b..9ae0ef2 100644
+--- a/setup.py
++++ b/setup.py
+@@ -444,7 +444,6 @@ class PyBuildExt(build_ext):
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if cross_compiling:
+ self.add_gcc_paths()
+- self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+ # CPPFLAGS for header and library files.
diff --git a/lang/python/python3/patches/007-distutils-do-not-adjust-path.patch b/lang/python/python3/patches/007-distutils-do-not-adjust-path.patch
new file mode 100644
index 000000000..49fe92629
--- /dev/null
+++ b/lang/python/python3/patches/007-distutils-do-not-adjust-path.patch
@@ -0,0 +1,10 @@
+--- a/Lib/distutils/command/build_scripts.py
++++ b/Lib/distutils/command/build_scripts.py
+@@ -89,6 +89,7 @@ class build_scripts (Command):
+ adjust = 1
+ post_interp = match.group(1) or ''
+
++ adjust = 0
+ if adjust:
+ log.info("copying and adjusting %s -> %s", script,
+ self.build_dir)
diff --git a/lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch b/lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
new file mode 100644
index 000000000..5a106d4e8
--- /dev/null
+++ b/lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
@@ -0,0 +1,15 @@
+diff --git a/setup.py b/setup.py
+index 7868b7b..544fa7e 100644
+--- a/setup.py
++++ b/setup.py
+@@ -452,8 +452,9 @@ class PyBuildExt(build_ext):
+ # directly since an inconsistently reproducible issue comes up where
+ # the environment variable is not set even though the value were passed
+ # into configure and stored in the Makefile (issue found on OS X 10.3).
++ rt_lib_dirs = [] if cross_compiling else self.compiler.runtime_library_dirs
+ for env_var, arg_name, dir_list in (
+- ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
++ ('LDFLAGS', '-R', rt_lib_dirs),
+ ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+ env_val = sysconfig.get_config_var(env_var)
diff --git a/lang/python/python3/patches/011-fix-ncursesw-definition-colisions.patch b/lang/python/python3/patches/011-fix-ncursesw-definition-colisions.patch
new file mode 100644
index 000000000..652932102
--- /dev/null
+++ b/lang/python/python3/patches/011-fix-ncursesw-definition-colisions.patch
@@ -0,0 +1,12 @@
+diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
+index 3bf2ca7..c156964 100644
+--- a/Modules/_cursesmodule.c
++++ b/Modules/_cursesmodule.c
+@@ -116,7 +116,6 @@ char *PyCursesVersion = "2.2";
+ #defines many common symbols (such as "lines") which breaks the
+ curses module in other ways. So the code will just specify
+ explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
+ #ifdef __sgi
+ #include <term.h>
+ #endif
diff --git a/lang/python/python3/patches/012-disable-wcsftime-detection.patch b/lang/python/python3/patches/012-disable-wcsftime-detection.patch
new file mode 100644
index 000000000..55a383c28
--- /dev/null
+++ b/lang/python/python3/patches/012-disable-wcsftime-detection.patch
@@ -0,0 +1,13 @@
+diff --git a/configure b/configure
+index 274af7e..85bbf0e 100755
+--- a/configure
++++ b/configure
+@@ -10555,7 +10555,7 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
+ sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
+ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
+ truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
+- wcscoll wcsftime wcsxfrm wmemcmp writev _getpty
++ wcscoll wcsxfrm wmemcmp writev _getpty
+ do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/lang/python/python3/patches/014-remove-platform-so-suffix.patch b/lang/python/python3/patches/014-remove-platform-so-suffix.patch
new file mode 100644
index 000000000..cbc32d57a
--- /dev/null
+++ b/lang/python/python3/patches/014-remove-platform-so-suffix.patch
@@ -0,0 +1,26 @@
+diff --git a/configure b/configure
+index e823a08..84c525f 100755
+--- a/configure
++++ b/configure
+@@ -14365,7 +14365,7 @@ $as_echo_n "checking ABIFLAGS... " >&6; }
+ $as_echo "$ABIFLAGS" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
+ $as_echo_n "checking SOABI... " >&6; }
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
++SOABI='cpython-'`echo $VERSION | tr -d .`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
+ $as_echo "$SOABI" >&6; }
+
+diff --git a/configure.ac b/configure.ac
+index 56a73df..1855af5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4314,7 +4314,7 @@ AC_SUBST(SOABI)
+ AC_MSG_CHECKING(ABIFLAGS)
+ AC_MSG_RESULT($ABIFLAGS)
+ AC_MSG_CHECKING(SOABI)
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
++SOABI='cpython-'`echo $VERSION | tr -d .`
+ AC_MSG_RESULT($SOABI)
+
+ AC_SUBST(EXT_SUFFIX)
diff --git a/lang/python/python3/patches/015-abort-on-failed-modules.patch b/lang/python/python3/patches/015-abort-on-failed-modules.patch
new file mode 100644
index 000000000..eec488f3d
--- /dev/null
+++ b/lang/python/python3/patches/015-abort-on-failed-modules.patch
@@ -0,0 +1,12 @@
+diff --git a/setup.py b/setup.py
+index da67731..928e0de 100644
+--- a/setup.py
++++ b/setup.py
+@@ -293,6 +293,7 @@ class PyBuildExt(build_ext):
+ print("Failed to build these modules:")
+ print_three_column(failed)
+ print()
++ if cross_compiling: sys.exit(1)
+
+ if self.failed_on_import:
+ failed = self.failed_on_import[:]
diff --git a/lang/python/python3/patches/016-adjust-config-paths.patch b/lang/python/python3/patches/016-adjust-config-paths.patch
new file mode 100644
index 000000000..fb709b7e4
--- /dev/null
+++ b/lang/python/python3/patches/016-adjust-config-paths.patch
@@ -0,0 +1,72 @@
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 8bf1a70..c2708c3 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -424,6 +424,7 @@ def _init_posix():
+ platform=sys.platform,
+ multiarch=getattr(sys.implementation, '_multiarch', ''),
+ ))
++ name = '_sysconfigdata'
+ _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+ build_time_vars = _temp.build_time_vars
+ global _config_vars
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index 9314e71..4861261 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -343,6 +343,7 @@ def get_makefile_filename():
+
+
+ def _get_sysconfigdata_name():
++ return '_sysconfigdata'
+ return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
+ '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
+ abi=sys.abiflags,
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index cd7d33d..ad6572f 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1301,7 +1301,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c
+ esac; \
+ done; \
+ done
+- $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
++ $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata*.py \
+ $(DESTDIR)$(LIBDEST); \
+ $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+ if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+@@ -1436,7 +1436,7 @@ sharedinstall: sharedmods
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+ --root=$(DESTDIR)/
+- -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
++ -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata*.py
+ -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
+
+ # Here are a couple of targets for MacOSX again, to install a full
+diff --git a/configure b/configure
+index cf95b27..8203fbb 100755
+--- a/configure
++++ b/configure
+@@ -14895,7 +14895,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
+ $as_echo "$LDVERSION" >&6; }
+
+
+-if test x$PLATFORM_TRIPLET = x; then
++if true ; then
+ LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+ else
+ LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+diff --git a/configure.ac b/configure.ac
+index 1d63813..25f25ed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4600,7 +4600,7 @@ AC_MSG_RESULT($LDVERSION)
+
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+-if test x$PLATFORM_TRIPLET = x; then
++if true ; then
+ LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+ else
+ LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
diff --git a/lang/python/pytz/Makefile b/lang/python/pytz/Makefile
new file mode 100644
index 000000000..205338d09
--- /dev/null
+++ b/lang/python/pytz/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pytz
+PKG_VERSION:=2016.6.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/5d/8e/6635d8f3f9f48c03bb925fab543383089858271f9cfd1216b83247e8df94/
+PKG_MD5SUM:=b6c28a3b968bc1d8badfb61b93874e03
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/pytz
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=World timezone definitions, modern and historical
+ URL:=https://sourceforge.net/projects/pytz/
+ DEPENDS:=+python
+endef
+
+define Package/pytz/description
+ World timezone definitions, modern and historical
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/pytz/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,pytz))
diff --git a/lang/python/rcssmin/Makefile b/lang/python/rcssmin/Makefile
new file mode 100644
index 000000000..572247428
--- /dev/null
+++ b/lang/python/rcssmin/Makefile
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rcssmin
+PKG_VERSION:=1.0.6
+PKG_RELEASE=1
+PKG_LICENSE:=Apache-2.0
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/ndparker/rcssmin.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=4764e3bc47ca8d44be3198892e73c51d8a0a9970
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/rcssmin
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Fast CSS minifier for Python
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ URL:=http://opensource.perlig.de/rcssmin/
+ DEPENDS:=+python
+endef
+
+define Package/rcssmin/description
+ Fast CSS minifier for Python
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+define Package/rcssmin/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,rcssmin))
diff --git a/lang/python/simplejson/Makefile b/lang/python/simplejson/Makefile
new file mode 100644
index 000000000..c6d9c2b3c
--- /dev/null
+++ b/lang/python/simplejson/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=simplejson
+PKG_VERSION:=3.10.0
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/40/ad/52c1f3a562df3b210e8f165e1aa243a178c454ead65476a39fa3ce1847b6/
+PKG_MD5SUM:=426a9631d22851a7a970b1a677368b15
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/simplejson
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Simple, fast, extensible JSON encoder/decoder for Python
+ URL:=http://simplejson.readthedocs.org/
+ DEPENDS:=+python
+endef
+
+define Package/simplejson/description
+ Simple, fast, extensible JSON encoder/decoder for Python
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/simplejson/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,simplejson))
diff --git a/lang/python/twisted/Makefile b/lang/python/twisted/Makefile
new file mode 100644
index 000000000..dc92e4d98
--- /dev/null
+++ b/lang/python/twisted/Makefile
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2006-2011, 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=twisted
+PKG_VERSION:=16.4.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://pypi.python.org/packages/6b/23/8dbe86fc83215015e221fbd861a545c6ec5c9e9cd7514af114d1f64084ab \
+ http://twistedmatrix.com/Releases/Twisted/16.4
+PKG_MD5SUM:=c6d09bdd681f538369659111f079c29d
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python python-setuptools USE_MUSL:librpc
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/twisted
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Python networking engine
+ URL:=http://twistedmatrix.com/
+ DEPENDS:=+python-light +zope-interface
+endef
+
+define Package/twisted/description
+ Twisted is a networking engine written in Python, supporting numerous
+ protocols. It contains a web server, numerous chat clients, chat servers,
+ mail servers, and more.
+endef
+
+define PyPackage/twisted/filespec
++|/usr/bin
+-|/usr/bin/tkconch
++|$(PYTHON_PKG_DIR)
+-|$(PYTHON_PKG_DIR)/twisted/conch/scripts/tkconch.py
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,, \
+ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" --no-compile, \
+ )
+endef
+
+$(eval $(call PyPackage,twisted))
+$(eval $(call BuildPackage,twisted))
diff --git a/lang/python/twisted/patches/001-fix-zsh-completion.patch b/lang/python/twisted/patches/001-fix-zsh-completion.patch
new file mode 100644
index 000000000..6cb85c609
--- /dev/null
+++ b/lang/python/twisted/patches/001-fix-zsh-completion.patch
@@ -0,0 +1,10 @@
+diff --git a/twisted/python/twisted-completion.zsh b/twisted/python/twisted-completion.zsh
+index 4d97aa5..9a8d4d8 100644
+--- a/twisted/python/twisted-completion.zsh
++++ b/twisted/python/twisted-completion.zsh
+@@ -1,4 +1,4 @@
+-#compdef twistd trial conch cftp ckeygen pyhtmlizer tkconch
++#compdef twistd trial conch cftp ckeygen pyhtmlizer
+ #
+ # This is the ZSH completion file for Twisted commands. It calls the current
+ # command-line with the special "--_shell-completion" option which is handled
diff --git a/lang/python/twisted/patches/002-omit-tests.patch b/lang/python/twisted/patches/002-omit-tests.patch
new file mode 100644
index 000000000..8d545bfd6
--- /dev/null
+++ b/lang/python/twisted/patches/002-omit-tests.patch
@@ -0,0 +1,41 @@
+diff --git a/setup.py b/setup.py
+index e21ef70..a4d9ee8 100755
+--- a/setup.py
++++ b/setup.py
+@@ -55,13 +55,14 @@ def main(args):
+ setup_args = STATIC_PACKAGE_METADATA.copy()
+
+ setup_args.update(dict(
+- packages=setuptools.find_packages(),
++ packages=setuptools.find_packages(exclude=["*.test", "*.test.*"]),
+ install_requires=requirements,
+ conditionalExtensions=getExtensions(),
+ entry_points={
+ 'console_scripts': getConsoleScripts()
+ },
+ include_package_data=True,
++ exclude_package_data={'':['test/*']},
+ zip_safe=False,
+ extras_require=_EXTRAS_REQUIRE,
+ ))
+diff --git a/twisted/python/dist.py b/twisted/python/dist.py
+index dfff9dc..a05b716 100644
+--- a/twisted/python/dist.py
++++ b/twisted/python/dist.py
+@@ -191,11 +191,11 @@ def getExtensions():
+ Get the C extensions used for Twisted.
+ """
+ extensions = [
+- ConditionalExtension(
+- "twisted.test.raiser",
+- ["twisted/test/raiser.c"],
+- condition=lambda _: _isCPython
+- ),
++ #ConditionalExtension(
++ # "twisted.test.raiser",
++ # ["twisted/test/raiser.c"],
++ # condition=lambda _: _isCPython
++ #),
+ ConditionalExtension(
+ "twisted.internet.iocpreactor.iocpsupport",
+ ["twisted/internet/iocpreactor/iocpsupport/iocpsupport.c",
diff --git a/lang/python/zope-interface/Makefile b/lang/python/zope-interface/Makefile
new file mode 100644
index 000000000..34b5e2b01
--- /dev/null
+++ b/lang/python/zope-interface/Makefile
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2006-2011, 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zope.interface
+PKG_VERSION:=4.3.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/38/1b/d55c39f2cf442bd9fb2c59760ed058c84b57d25c680819c25f3aff741e1f
+PKG_MD5SUM:=5f7e15a5bcdfa3c6c0e93ffe45caf87c
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+PKG_LICENSE:=ZPL-2.1
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/zope-interface
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=Zope interface
+ URL:=https://github.com/zopefoundation/zope.interface
+ DEPENDS:=+python-light
+endef
+
+define Package/zope-interface/description
+This package provides an implementation of "object interfaces" for
+Python. Interfaces are a mechanism for labeling objects as conforming to
+a given API or contract. So, this package can be considered as
+implementation of the Design By Contract methodology support in Python.
+endef
+
+define PyPackage/zope-interface/filespec
++|$(PYTHON_PKG_DIR)
+-|$(PYTHON_PKG_DIR)/zope/interface/common/tests
+-|$(PYTHON_PKG_DIR)/zope/interface/tests
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,, \
+ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" --no-compile, \
+ )
+endef
+
+$(eval $(call PyPackage,zope-interface))
+$(eval $(call BuildPackage,zope-interface))