--- /dev/null
+#
+# 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_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python/python-package.mk
+
+define PyPackage/twisted/default
+ URL:=http://twistedmatrix.com/
+endef
+
+define PyPackage/twisted/default/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
+$(call PyPackage/twisted/default)
+ TITLE:=Python networking engine
+ DEPENDS+= +zope-interface
+endef
+
+define PyPackage/twisted-conch
+$(call PyPackage/twisted/default)
+ TITLE:=Twisted - Conch
+ DEPENDS+= twisted
+endef
+
+define PyPackage/twisted-lore
+$(call PyPackage/twisted/default)
+ TITLE:=Twisted - Lore
+ DEPENDS+= twisted
+endef
+
+define PyPackage/twisted-mail
+$(call PyPackage/twisted/default)
+ TITLE:=Twisted - Mail
+ DEPENDS+= twisted
+endef
+
+define PyPackage/twisted-names
+$(call PyPackage/twisted/default)
+ TITLE:=Twisted - Names
+ DEPENDS+= twisted
+endef
+
+define PyPackage/twisted-news
+$(call PyPackage/twisted/default)
+ TITLE:=Twisted - News
+ DEPENDS+= twisted
+endef
+
+define PyPackage/twisted-runner
+$(call PyPackage/twisted/default)
+ TITLE:=Twisted - Runner
+ DEPENDS+= twisted
+endef
+
+define PyPackage/twisted-web
+$(call PyPackage/twisted/default)
+ TITLE:=Twisted - Web
+ DEPENDS+= twisted
+endef
+
+define PyPackage/twisted-words
+$(call PyPackage/twisted/default)
+ TITLE:=Twisted - Words
+ DEPENDS+= twisted
+endef
+
+define PyPackage/zope-interface
+$(call PyPackage/twisted/default)
+ TITLE:=Zope interface
+ DESCRIPTION:=zope-interface
+endef
+
+TWISTED_SUPPROJECTS:=core
+
+ZOPE_IF_VER=3.3.0
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-conch),)
+ TWISTED_SUBPROJECTS+=conch
+endif
+ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-lore),)
+ TWISTED_SUBPROJECTS+=lore
+endif
+ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-mail),)
+ TWISTED_SUBPROJECTS+=mail
+endif
+ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-names),)
+ TWISTED_SUBPROJECTS+=names
+endif
+ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-news),)
+ TWISTED_SUBPROJECTS+=news
+endif
+ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-runner),)
+ TWISTED_SUBPROJECTS+=runner
+endif
+ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-web),)
+ TWISTED_SUBPROJECTS+=web
+endif
+ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-words),)
+ TWISTED_SUBPROJECTS+=words
+endif
+
+
+define Build/Configure
+endef
+
+define PyPackage/twisted/filespec
++|/usr/bin/mktap
++|/usr/bin/twistd
++|$(PYTHON_PKG_DIR)/twisted/application
++|$(PYTHON_PKG_DIR)/twisted/copyright.py
++|$(PYTHON_PKG_DIR)/twisted/cred
++|$(PYTHON_PKG_DIR)/twisted/enterprise
++|$(PYTHON_PKG_DIR)/twisted/im.py
++|$(PYTHON_PKG_DIR)/twisted/__init__.py
++|$(PYTHON_PKG_DIR)/twisted/internet
++|$(PYTHON_PKG_DIR)/twisted/manhole
++|$(PYTHON_PKG_DIR)/twisted/persisted
++|$(PYTHON_PKG_DIR)/twisted/plugin.py
++|$(PYTHON_PKG_DIR)/twisted/protocols
++|$(PYTHON_PKG_DIR)/twisted/python
++|$(PYTHON_PKG_DIR)/twisted/scripts
++|$(PYTHON_PKG_DIR)/twisted/spread
++|$(PYTHON_PKG_DIR)/twisted/tap
++|$(PYTHON_PKG_DIR)/twisted/trial
+-|$(PYTHON_PKG_DIR)/twisted/trial/test
++|$(PYTHON_PKG_DIR)/twisted/_version.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/dropin.cache
++|$(PYTHON_PKG_DIR)/twisted/plugins/__init__.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/notestplugin.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/testplugin.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_ftp.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_inet.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_manhole.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_portforward.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_reactors.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_socks.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_telnet.py
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_trial.py
+endef
+
+define PyPackage/twisted-conch/filespec
++|$(PYTHON_PKG_DIR)/twisted/conch
+-|$(PYTHON_PKG_DIR)/twisted/conch/test
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_conch.py
+endef
+
+define PyPackage/twisted-lore/filespec
++|$(PYTHON_PKG_DIR)/twisted/lore
+-|$(PYTHON_PKG_DIR)/twisted/lore/test
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_lore.py
+endef
+
+define PyPackage/twisted-mail/filespec
++|$(PYTHON_PKG_DIR)/twisted/mail
+-|$(PYTHON_PKG_DIR)/twisted/mail/test
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_mail.py
+endef
+
+define PyPackage/twisted-names/filespec
++|$(PYTHON_PKG_DIR)/twisted/names
+-|$(PYTHON_PKG_DIR)/twisted/names/test
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_names.py
+endef
+
+define PyPackage/twisted-news/filespec
++|$(PYTHON_PKG_DIR)/twisted/news
+-|$(PYTHON_PKG_DIR)/twisted/news/test
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_news.py
+endef
+
+define PyPackage/twisted-runner/filespec
++|$(PYTHON_PKG_DIR)/twisted/runner
+endef
+
+define PyPackage/twisted-web/filespec
++|$(PYTHON_PKG_DIR)/twisted/web
+-|$(PYTHON_PKG_DIR)/twisted/web/test
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_web.py
+endef
+
+define PyPackage/twisted-words/filespec
++|$(PYTHON_PKG_DIR)/twisted/words
+-|$(PYTHON_PKG_DIR)/twisted/words/test
++|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_words.py
+endef
+
+define PyPackage/zope-interface/filespec
++|$(PYTHON_PKG_DIR)/zope
+-|$(PYTHON_PKG_DIR)/zope/interface/tests
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,., \
+ install --prefix="$(PKG_INSTALL_DIR)/usr" --no-compile, \
+ TWISTED_SUBPROJECTS="$(TWISTED_SUBPROJECTS)" \
+ )
+ $(call Build/Compile/PyMod,zope.interface-$(ZOPE_IF_VER), \
+ install --prefix="$(PKG_INSTALL_DIR)/usr" --no-compile, \
+ )
+ $(SED) 's,#!$(PYTHON),#!/usr/bin/python,' $(PKG_INSTALL_DIR)/usr/bin/*
+endef
+
+$(eval $(call PyPackage,twisted))
+$(eval $(call PyPackage,twisted-conch))
+$(eval $(call PyPackage,twisted-lore))
+$(eval $(call PyPackage,twisted-mail))
+$(eval $(call PyPackage,twisted-names))
+$(eval $(call PyPackage,twisted-news))
+$(eval $(call PyPackage,twisted-runner))
+$(eval $(call PyPackage,twisted-web))
+$(eval $(call PyPackage,twisted-words))
+$(eval $(call PyPackage,zope-interface))
--- /dev/null
+--- 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 "