[patchteam] twisted fix for installing zope
[openwrt/svn-archive/archive.git] / lang / twisted / Makefile
1 #
2 # Copyright (C) 2006-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=twisted
11 PKG_VERSION:=2.5.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://tmrc.mit.edu/mirror/twisted/Twisted/2.5
16 PKG_MD5SUM:=56df2ae66db57932515a491c03bf514f
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION)
19 PKG_BUILD_DEPENDS:=python
20
21 include $(INCLUDE_DIR)/package.mk
22 $(call include_mk, python-package.mk)
23
24 define Package/twisted/default
25 SUBMENU:=Python
26 SECTION:=lang
27 CATEGORY:=Languages
28 URL:=http://twistedmatrix.com/
29 DEPENDS:=+python-mini
30 endef
31
32 define Package/twisted/default/description
33 Twisted is a networking engine written in Python, supporting numerous
34 protocols. It contains a web server, numerous chat clients, chat servers,
35 mail servers, and more.
36 endef
37
38 define Package/twisted
39 $(call Package/twisted/default)
40 TITLE:=Python networking engine
41 DEPENDS+= +zope-interface
42 endef
43
44 define Package/twisted-conch
45 $(call Package/twisted/default)
46 TITLE:=Twisted - Conch
47 DEPENDS+= twisted
48 endef
49
50 define Package/twisted-lore
51 $(call Package/twisted/default)
52 TITLE:=Twisted - Lore
53 DEPENDS+= twisted
54 endef
55
56 define Package/twisted-mail
57 $(call Package/twisted/default)
58 TITLE:=Twisted - Mail
59 DEPENDS+= twisted
60 endef
61
62 define Package/twisted-names
63 $(call Package/twisted/default)
64 TITLE:=Twisted - Names
65 DEPENDS+= twisted
66 endef
67
68 define Package/twisted-news
69 $(call Package/twisted/default)
70 TITLE:=Twisted - News
71 DEPENDS+= twisted
72 endef
73
74 define Package/twisted-runner
75 $(call Package/twisted/default)
76 TITLE:=Twisted - Runner
77 DEPENDS+= twisted
78 endef
79
80 define Package/twisted-web
81 $(call Package/twisted/default)
82 TITLE:=Twisted - Web
83 DEPENDS+= twisted
84 endef
85
86 define Package/twisted-words
87 $(call Package/twisted/default)
88 TITLE:=Twisted - Words
89 DEPENDS+= twisted
90 endef
91
92 define Package/zope-interface
93 $(call Package/twisted/default)
94 TITLE:=Zope interface
95 endef
96
97 TWISTED_SUPPROJECTS:=core
98
99 ZOPE_IF_VER=3.3.0
100
101 ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-conch),)
102 TWISTED_SUBPROJECTS+=conch
103 endif
104 ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-lore),)
105 TWISTED_SUBPROJECTS+=lore
106 endif
107 ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-mail),)
108 TWISTED_SUBPROJECTS+=mail
109 endif
110 ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-names),)
111 TWISTED_SUBPROJECTS+=names
112 endif
113 ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-news),)
114 TWISTED_SUBPROJECTS+=news
115 endif
116 ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-runner),)
117 TWISTED_SUBPROJECTS+=runner
118 endif
119 ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-web),)
120 TWISTED_SUBPROJECTS+=web
121 endif
122 ifneq ($(SDK)$(CONFIG_PACKAGE_twisted-words),)
123 TWISTED_SUBPROJECTS+=words
124 endif
125
126
127 define Build/Configure
128 endef
129
130 define PyPackage/twisted/filespec
131 +|/usr/bin/mktap
132 +|/usr/bin/twistd
133 +|$(PYTHON_PKG_DIR)/twisted/application
134 +|$(PYTHON_PKG_DIR)/twisted/copyright.py
135 +|$(PYTHON_PKG_DIR)/twisted/cred
136 +|$(PYTHON_PKG_DIR)/twisted/enterprise
137 +|$(PYTHON_PKG_DIR)/twisted/im.py
138 +|$(PYTHON_PKG_DIR)/twisted/__init__.py
139 +|$(PYTHON_PKG_DIR)/twisted/internet
140 +|$(PYTHON_PKG_DIR)/twisted/manhole
141 +|$(PYTHON_PKG_DIR)/twisted/persisted
142 +|$(PYTHON_PKG_DIR)/twisted/plugin.py
143 +|$(PYTHON_PKG_DIR)/twisted/protocols
144 +|$(PYTHON_PKG_DIR)/twisted/python
145 +|$(PYTHON_PKG_DIR)/twisted/scripts
146 +|$(PYTHON_PKG_DIR)/twisted/spread
147 +|$(PYTHON_PKG_DIR)/twisted/tap
148 +|$(PYTHON_PKG_DIR)/twisted/trial
149 -|$(PYTHON_PKG_DIR)/twisted/trial/test
150 +|$(PYTHON_PKG_DIR)/twisted/_version.py
151 +|$(PYTHON_PKG_DIR)/twisted/plugins/dropin.cache
152 +|$(PYTHON_PKG_DIR)/twisted/plugins/__init__.py
153 +|$(PYTHON_PKG_DIR)/twisted/plugins/notestplugin.py
154 +|$(PYTHON_PKG_DIR)/twisted/plugins/testplugin.py
155 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_ftp.py
156 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_inet.py
157 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_manhole.py
158 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_portforward.py
159 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_reactors.py
160 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_socks.py
161 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_telnet.py
162 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_trial.py
163 endef
164
165 define PyPackage/twisted-conch/filespec
166 +|$(PYTHON_PKG_DIR)/twisted/conch
167 -|$(PYTHON_PKG_DIR)/twisted/conch/test
168 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_conch.py
169 endef
170
171 define PyPackage/twisted-lore/filespec
172 +|$(PYTHON_PKG_DIR)/twisted/lore
173 -|$(PYTHON_PKG_DIR)/twisted/lore/test
174 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_lore.py
175 endef
176
177 define PyPackage/twisted-mail/filespec
178 +|$(PYTHON_PKG_DIR)/twisted/mail
179 -|$(PYTHON_PKG_DIR)/twisted/mail/test
180 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_mail.py
181 endef
182
183 define PyPackage/twisted-names/filespec
184 +|$(PYTHON_PKG_DIR)/twisted/names
185 -|$(PYTHON_PKG_DIR)/twisted/names/test
186 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_names.py
187 endef
188
189 define PyPackage/twisted-news/filespec
190 +|$(PYTHON_PKG_DIR)/twisted/news
191 -|$(PYTHON_PKG_DIR)/twisted/news/test
192 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_news.py
193 endef
194
195 define PyPackage/twisted-runner/filespec
196 +|$(PYTHON_PKG_DIR)/twisted/runner
197 endef
198
199 define PyPackage/twisted-web/filespec
200 +|$(PYTHON_PKG_DIR)/twisted/web
201 -|$(PYTHON_PKG_DIR)/twisted/web/test
202 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_web.py
203 endef
204
205 define PyPackage/twisted-words/filespec
206 +|$(PYTHON_PKG_DIR)/twisted/words
207 -|$(PYTHON_PKG_DIR)/twisted/words/test
208 +|$(PYTHON_PKG_DIR)/twisted/plugins/twisted_words.py
209 endef
210
211 define PyPackage/zope-interface/filespec
212 +|$(PYTHON_PKG_DIR)/zope
213 -|$(PYTHON_PKG_DIR)/zope/interface/tests
214 endef
215
216 define Build/Compile
217 $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
218 $(call Build/Compile/PyMod,., \
219 install --prefix="$(PKG_INSTALL_DIR)/usr" --no-compile, \
220 TWISTED_SUBPROJECTS="$(TWISTED_SUBPROJECTS)" \
221 PYTHONPATH="$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)" \
222 )
223 $(call Build/Compile/PyMod,zope.interface-$(ZOPE_IF_VER), \
224 install --prefix="$(PKG_INSTALL_DIR)/usr" --no-compile, \
225 PYTHONPATH="$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)" \
226 )
227 $(SED) 's,#!$(PYTHON),#!/usr/bin/python,' $(PKG_INSTALL_DIR)/usr/bin/*
228
229 $(CP) -a \
230 $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/zope.interface-*.egg/zope \
231 $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/
232 endef
233
234 $(eval $(call PyPackage,twisted))
235 $(eval $(call PyPackage,twisted-conch))
236 $(eval $(call PyPackage,twisted-lore))
237 $(eval $(call PyPackage,twisted-mail))
238 $(eval $(call PyPackage,twisted-names))
239 $(eval $(call PyPackage,twisted-news))
240 $(eval $(call PyPackage,twisted-runner))
241 $(eval $(call PyPackage,twisted-web))
242 $(eval $(call PyPackage,twisted-words))
243 $(eval $(call PyPackage,zope-interface))
244
245 $(eval $(call BuildPackage,twisted))
246 $(eval $(call BuildPackage,twisted-conch))
247 $(eval $(call BuildPackage,twisted-lore))
248 $(eval $(call BuildPackage,twisted-mail))
249 $(eval $(call BuildPackage,twisted-names))
250 $(eval $(call BuildPackage,twisted-news))
251 $(eval $(call BuildPackage,twisted-runner))
252 $(eval $(call BuildPackage,twisted-web))
253 $(eval $(call BuildPackage,twisted-words))
254 $(eval $(call BuildPackage,zope-interface))