From e1b0b8669f2c86f954e34974caedc1bc538d3cad Mon Sep 17 00:00:00 2001 From: Tim Yardley Date: Thu, 7 Jun 2007 17:47:42 +0000 Subject: [PATCH] twisted 2.5.0 package SVN-Revision: 7524 --- libs/twisted/Makefile | 211 ++++++++++++++++++ .../patches/000-select_submodules.patch | 25 +++ libs/twisted/patches/001-dont_use_zope.patch | 162 ++++++++++++++ 3 files changed, 398 insertions(+) create mode 100644 libs/twisted/Makefile create mode 100644 libs/twisted/patches/000-select_submodules.patch create mode 100644 libs/twisted/patches/001-dont_use_zope.patch diff --git a/libs/twisted/Makefile b/libs/twisted/Makefile new file mode 100644 index 0000000000..2207aea0b8 --- /dev/null +++ b/libs/twisted/Makefile @@ -0,0 +1,211 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=twisted +PKG_VERSION:=2.5.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://tmrc.mit.edu/mirror/twisted/Twisted/2.5 +PKG_MD5SUM:=56df2ae66db57932515a491c03bf514f +PKG_CAT:=bzcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +TWISTED_SUPPROJECTS:=core + +ZOPE_IF_VER=3.3.0 + +define Package/twisted/default + SECTION:=libs + CATEGORY:=Libraries + URL:=http://twistedmatrix.com + TITLE:=A networking engine written in Python + 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 Package/twisted + $(call Package/twisted/default) + DEPENDS:=+python zope-interface + TITLE:=A networking engine written in Python + 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. + URL:=http://twistedmatrix.com + MENU:=1 +endef + +define Package/zope-interface + $(call Package/twisted/default) + TITLE:=zope-interface + DESCRIPTION:=zope-interface +endef + +define Package/twisted-conch + $(call Package/twisted/default) + DEPENDS:=twisted + TITLE:=TwistedConch +endef + +define Package/twisted-lore + $(call Package/twisted/default) + DEPENDS:=twisted + TITLE:=TwistedLore +endef + +define Package/twisted-mail + $(call Package/twisted/default) + DEPENDS:=twisted + TITLE:=TwistedMail +endef + +define Package/twisted-names + $(call Package/twisted/default) + DEPENDS:=twisted + TITLE:=TwistedNames +endef + +define Package/twisted-news + $(call Package/twisted/default) + DEPENDS:=twisted + TITLE:=TwistedNews +endef + +define Package/twisted-runner + $(call Package/twisted/default) + DEPENDS:=twisted + TITLE:=TwistedRunner +endef + +define Package/twisted-web + $(call Package/twisted/default) + DEPENDS:=twisted + TITLE:=TwistedWeb +endef + +define Package/twisted-words + $(call Package/twisted/default) + DEPENDS:=twisted + TITLE:=TwistedWords +endef + +ifneq ($(CONFIG_PACKAGE_twisted-words),) + TWISTED_SUBPROJECTS+=words +endif +ifneq ($(CONFIG_PACKAGE_twisted-conch),) + TWISTED_SUBPROJECTS+=conch +endif +ifneq ($(CONFIG_PACKAGE_twisted-lore),) + TWISTED_SUBPROJECTS+=lore +endif +ifneq ($(CONFIG_PACKAGE_twisted-mail),) + TWISTED_SUBPROJECTS+=mail +endif +ifneq ($(CONFIG_PACKAGE_twisted-names),) + TWISTED_SUBPROJECTS+=names +endif +ifneq ($(CONFIG_PACKAGE_twisted-news),) + TWISTED_SUBPROJECTS+=news +endif +ifneq ($(CONFIG_PACKAGE_twisted-runner),) + TWISTED_SUBPROJECTS+=runner +endif +ifneq ($(CONFIG_PACKAGE_twisted-web),) + TWISTED_SUBPROJECTS+=web +endif + + +define Build/Configure +endef + + +define Build/Compile + cd $(PKG_BUILD_DIR)/zope.interface-$(ZOPE_IF_VER); \ + $(STAGING_DIR)/usr/bin/hostpython ./setup.py \ + install --prefix=$(PKG_INSTALL_DIR)/usr --no-compile; + + cd $(PKG_BUILD_DIR)/; \ + TWISTED_SUBPROJECTS="$(TWISTED_SUBPROJECTS)" \ + PYTHONPATH="$(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages" \ + $(STAGING_DIR)/usr/bin/hostpython \ + ./setup.py install --prefix=$(PKG_INSTALL_DIR)/usr --no-compile; +endef + +define Package/zope-interface/install + $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages + $(CP) -a $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/zope \ + $(1)/usr/lib/python2.5/site-packages/ +endef + +TWISTED_DIR=/usr/lib/python2.5/site-packages/twisted +define Package/twisted/install + $(INSTALL_DIR) $(1)/usr/bin + $(SED) 's@#!$(STAGING_DIR)/usr/bin/hostpython@#!/usr/bin/python@' $(PKG_INSTALL_DIR)/usr/bin/mktap + $(SED) 's@#!$(STAGING_DIR)/usr/bin/hostpython@#!/usr/bin/python@' $(PKG_INSTALL_DIR)/usr/bin/twistd + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/mktap \ + $(PKG_INSTALL_DIR)/usr/bin/twistd \ + $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages/twisted/plugins + cd $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/twisted; \ + $(CP) -a application copyright.py cred enterprise im.py __init__.py \ + internet manhole persisted plugin.py protocols \ + python scripts spread tap test trial _version.py \ + $(1)/usr/lib/python2.5/site-packages/twisted + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/dropin.cache \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/__init__.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/notestplugin.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/testplugin.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_ftp.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_inet.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_manhole.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_portforward.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_reactors.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_socks.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_telnet.py \ + $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_trial.py \ + $(1)/$(TWISTED_DIR)/plugins/ +endef + +define BuildSubmodule + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/python2.5/site-packages/twisted/plugins + $(CP) -a \ + $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/twisted/$(2) \ + $$(1)/usr/lib/python2.5/site-packages/twisted/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/twisted/plugins/twisted_$(2).py $$(1)/usr/lib/python2.5/site-packages/twisted/plugins/ + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +define Package/twisted-runner/install + $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages/twisted + $(CP) -a \ + $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/twisted/runner $(1)/usr/lib/python2.5/site-packages/twisted/ +endef + +$(eval $(call BuildPackage,zope-interface)) +$(eval $(call BuildPackage,twisted)) +$(eval $(call BuildSubmodule,twisted-words,words)) +$(eval $(call BuildSubmodule,twisted-conch,conch)) +$(eval $(call BuildSubmodule,twisted-lore,lore)) +$(eval $(call BuildSubmodule,twisted-mail,mail)) +$(eval $(call BuildSubmodule,twisted-names,names)) +$(eval $(call BuildSubmodule,twisted-news,news)) +$(eval $(call BuildPackage,twisted-runner)) +$(eval $(call BuildSubmodule,twisted-web,web)) diff --git a/libs/twisted/patches/000-select_submodules.patch b/libs/twisted/patches/000-select_submodules.patch new file mode 100644 index 0000000000..d36e737abd --- /dev/null +++ b/libs/twisted/patches/000-select_submodules.patch @@ -0,0 +1,25 @@ +diff -ruN Twisted-2.5.0/setup.py Twisted-2.5.0.new/setup.py +--- Twisted-2.5.0/setup.py 2007-01-08 16:30:05.000000000 -0600 ++++ Twisted-2.5.0.new/setup.py 2007-05-10 13:42:28.361934000 -0500 +@@ -16,9 +16,19 @@ + """ + + import sys, os, glob ++# sumoSubprojects = ['core', 'conch', 'lore', 'mail', 'names', ++# 'runner', 'web', 'words', 'news'] ++ ++sp = os.getenv("TWISTED_SUBPROJECTS", None) ++if sp == None: ++ sumoSubprojects = ['core'] ++else: ++ sumoSubprojects = sp.split() ++ ++## make sure core is in sumoSubprojects ++if 'core' not in sumoSubprojects: ++ sumoSubprojects.insert(0, 'core') + +-sumoSubprojects = ['core', 'conch', 'lore', 'mail', 'names', +- 'runner', 'web', 'words', 'news'] + + specialPaths = {'core': 'twisted/topfiles/setup.py'} + diff --git a/libs/twisted/patches/001-dont_use_zope.patch b/libs/twisted/patches/001-dont_use_zope.patch new file mode 100644 index 0000000000..5f42bd096b --- /dev/null +++ b/libs/twisted/patches/001-dont_use_zope.patch @@ -0,0 +1,162 @@ +--- Twisted-2.5.0/TwistedCore-2.5.0/setup.py 2006-12-22 23:02:47.000000000 -0600 ++++ Twisted-2.5.0.new/TwistedCore-2.5.0/setup.py 2007-05-14 16:13:36.095282000 -0500 +@@ -16,9 +16,8 @@ + from distutils.core import Extension + + if os.path.exists('twisted'): +- sys.path.insert(0, '.') # eek! need this to import twisted. sorry. +-from twisted import copyright +-from twisted.python import dist, util ++ sys.path.insert(0, 'twisted/python') # eek! need this to import twisted. sorry. ++import dist + + def detectExtensions(builder): + """ +@@ -72,7 +71,7 @@ + setup_args = dict( + # metadata + name="Twisted", +- version=copyright.version, ++ version="2.5.0", + description="An asynchronous networking framework written in Python", + author="Twisted Matrix Laboratories", + author_email="twisted-python@twistedmatrix.com", +--- Twisted-2.5.0/TwistedWords-0.5.0/setup.py 2006-05-13 14:26:09.000000000 -0500 ++++ Twisted-2.5.0.new/TwistedWords-0.5.0/setup.py 2007-05-14 16:24:39.860764750 -0500 +@@ -1,7 +1,8 @@ + import sys ++sys.path.append('../TwistedCore-2.5.0/twisted/python') + + try: +- from twisted.python import dist ++ import dist + except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " +--- Twisted-2.5.0/TwistedCore-2.5.0/twisted/python/dist.py 2006-10-01 14:16:04.000000000 -0500 ++++ Twisted-2.5.0.new//TwistedCore-2.5.0/twisted/python/dist.py 2007-05-14 16:50:07.952264500 -0500 +@@ -85,12 +85,25 @@ + "2.0.0". + """ + if proj == 'core': +- vfile = os.path.join(base, '_version.py') ++ return '2.5.0' ++ elif proj == 'words': ++ return '0.7.0' ++ elif proj == 'conch': ++ return '0.8.0' ++ elif proj == 'lore': ++ return '0.3.0' ++ elif proj == 'mail': ++ return '0.4.0' ++ elif proj == 'names': ++ return '0.4.0' ++ elif proj == 'news': ++ return '0.3.0' ++ elif proj == 'runner': ++ return '0.2.0' ++ elif proj == 'web': ++ return '0.7.0' + else: +- vfile = os.path.join(base, proj, '_version.py') +- ns = {'__name__': 'Nothing to see here'} +- execfile(vfile, ns) +- return ns['version'].base() ++ return False + + + # Names that are exluded from globbing results: +--- Twisted-2.5.0/TwistedConch-0.8.0/setup.py 2006-05-13 14:26:09.000000000 -0500 ++++ Twisted-2.5.0.new//TwistedConch-0.8.0/setup.py 2007-05-14 17:00:05.501609000 -0500 +@@ -1,7 +1,8 @@ + import sys ++sys.path.append('../TwistedCore-2.5.0/twisted/python') + + try: +- from twisted.python import dist ++ import dist + except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " +--- Twisted-2.5.0/TwistedLore-0.3.0/setup.py 2006-05-13 14:26:09.000000000 -0500 ++++ Twisted-2.5.0.new/TwistedLore-0.3.0/setup.py 2007-05-14 17:17:25.374597000 -0500 +@@ -1,7 +1,8 @@ + import sys ++sys.path.append('../TwistedCore-2.5.0/twisted/python') + + try: +- from twisted.python import dist ++ import dist + except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " +--- Twisted-2.5.0/TwistedMail-0.4.0/setup.py 2006-05-13 14:26:09.000000000 -0500 ++++ Twisted-2.5.0.new/TwistedMail-0.4.0/setup.py 2007-05-14 17:18:02.544920000 -0500 +@@ -1,7 +1,10 @@ + import sys ++sys.path.append('../TwistedCore-2.5.0/twisted/python') ++ + + try: +- from twisted.python import dist ++ import dist ++ + except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " +--- Twisted-2.5.0/TwistedNames-0.4.0/setup.py 2006-05-13 14:26:09.000000000 -0500 ++++ Twisted-2.5.0.new/TwistedNames-0.4.0/setup.py 2007-05-14 17:18:37.707117500 -0500 +@@ -1,7 +1,10 @@ + import sys ++sys.path.append('../TwistedCore-2.5.0/twisted/python') ++ + + try: +- from twisted.python import dist ++ import dist ++ + except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " +--- Twisted-2.5.0/TwistedNews-0.3.0/setup.py 2006-05-13 14:26:09.000000000 -0500 ++++ Twisted-2.5.0.new/TwistedNews-0.3.0/setup.py 2007-05-14 17:19:16.769558750 -0500 +@@ -1,6 +1,9 @@ ++import sys ++sys.path.append('../TwistedCore-2.5.0/twisted/python') + + try: +- from twisted.python import dist ++ import dist ++ + except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " +--- Twisted-2.5.0/TwistedRunner-0.2.0/setup.py 2006-05-13 14:26:09.000000000 -0500 ++++ Twisted-2.5.0.new/TwistedRunner-0.2.0/setup.py 2007-05-14 17:20:54.367658250 -0500 +@@ -1,8 +1,11 @@ ++import sys ++sys.path.append('../TwistedCore-2.5.0/twisted/python') + + from distutils.core import Extension + + try: +- from twisted.python import dist ++ import dist ++ + except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " +--- Twisted-2.5.0/TwistedWeb-0.7.0/setup.py 2006-05-13 14:26:09.000000000 -0500 ++++ Twisted-2.5.0.new/TwistedWeb-0.7.0/setup.py 2007-05-14 17:21:21.065326750 -0500 +@@ -1,7 +1,10 @@ + import sys ++sys.path.append('../TwistedCore-2.5.0/twisted/python') ++ + + try: +- from twisted.python import dist ++ import dist ++ + except ImportError: + raise SystemExit("twisted.python.dist module not found. Make sure you " + "have installed the Twisted core package before " -- 2.30.2