make zope-interface auto-select when you select twisted
[openwrt/svn-archive/archive.git] / libs / twisted / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=twisted
12 PKG_VERSION:=2.5.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://tmrc.mit.edu/mirror/twisted/Twisted/2.5
17 PKG_MD5SUM:=56df2ae66db57932515a491c03bf514f
18 PKG_CAT:=bzcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 TWISTED_SUPPROJECTS:=core
25
26 ZOPE_IF_VER=3.3.0
27
28 define Package/twisted/default
29 SECTION:=libs
30 CATEGORY:=Libraries
31 URL:=http://twistedmatrix.com
32 TITLE:=A networking engine written in Python
33 DESCRIPTION:=\
34 Twisted is a networking engine written in Python, supporting \\\
35 numerous protocols. It contains a web server, numerous chat \\\
36 clients, chat servers, mail servers, and more.
37 endef
38
39 define Package/twisted
40 $(call Package/twisted/default)
41 DEPENDS:=+python +zope-interface
42 TITLE:=A networking engine written in Python
43 DESCRIPTION:=\
44 Twisted is a networking engine written in Python, supporting \\\
45 numerous protocols. It contains a web server, numerous chat \\\
46 clients, chat servers, mail servers, and more.
47 URL:=http://twistedmatrix.com
48 MENU:=1
49 endef
50
51 define Package/zope-interface
52 $(call Package/twisted/default)
53 TITLE:=zope-interface
54 DESCRIPTION:=zope-interface
55 endef
56
57 define Package/twisted-conch
58 $(call Package/twisted/default)
59 DEPENDS:=twisted
60 TITLE:=TwistedConch
61 endef
62
63 define Package/twisted-lore
64 $(call Package/twisted/default)
65 DEPENDS:=twisted
66 TITLE:=TwistedLore
67 endef
68
69 define Package/twisted-mail
70 $(call Package/twisted/default)
71 DEPENDS:=twisted
72 TITLE:=TwistedMail
73 endef
74
75 define Package/twisted-names
76 $(call Package/twisted/default)
77 DEPENDS:=twisted
78 TITLE:=TwistedNames
79 endef
80
81 define Package/twisted-news
82 $(call Package/twisted/default)
83 DEPENDS:=twisted
84 TITLE:=TwistedNews
85 endef
86
87 define Package/twisted-runner
88 $(call Package/twisted/default)
89 DEPENDS:=twisted
90 TITLE:=TwistedRunner
91 endef
92
93 define Package/twisted-web
94 $(call Package/twisted/default)
95 DEPENDS:=twisted
96 TITLE:=TwistedWeb
97 endef
98
99 define Package/twisted-words
100 $(call Package/twisted/default)
101 DEPENDS:=twisted
102 TITLE:=TwistedWords
103 endef
104
105 ifneq ($(CONFIG_PACKAGE_twisted-words),)
106 TWISTED_SUBPROJECTS+=words
107 endif
108 ifneq ($(CONFIG_PACKAGE_twisted-conch),)
109 TWISTED_SUBPROJECTS+=conch
110 endif
111 ifneq ($(CONFIG_PACKAGE_twisted-lore),)
112 TWISTED_SUBPROJECTS+=lore
113 endif
114 ifneq ($(CONFIG_PACKAGE_twisted-mail),)
115 TWISTED_SUBPROJECTS+=mail
116 endif
117 ifneq ($(CONFIG_PACKAGE_twisted-names),)
118 TWISTED_SUBPROJECTS+=names
119 endif
120 ifneq ($(CONFIG_PACKAGE_twisted-news),)
121 TWISTED_SUBPROJECTS+=news
122 endif
123 ifneq ($(CONFIG_PACKAGE_twisted-runner),)
124 TWISTED_SUBPROJECTS+=runner
125 endif
126 ifneq ($(CONFIG_PACKAGE_twisted-web),)
127 TWISTED_SUBPROJECTS+=web
128 endif
129
130
131 define Build/Configure
132 endef
133
134
135 define Build/Compile
136 cd $(PKG_BUILD_DIR)/zope.interface-$(ZOPE_IF_VER); \
137 $(STAGING_DIR)/usr/bin/hostpython ./setup.py \
138 install --prefix=$(PKG_INSTALL_DIR)/usr --no-compile;
139
140 cd $(PKG_BUILD_DIR)/; \
141 TWISTED_SUBPROJECTS="$(TWISTED_SUBPROJECTS)" \
142 PYTHONPATH="$(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages" \
143 $(STAGING_DIR)/usr/bin/hostpython \
144 ./setup.py install --prefix=$(PKG_INSTALL_DIR)/usr --no-compile;
145 endef
146
147 define Package/zope-interface/install
148 $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages
149 $(CP) -a $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/zope \
150 $(1)/usr/lib/python2.5/site-packages/
151 endef
152
153 TWISTED_DIR=/usr/lib/python2.5/site-packages/twisted
154 define Package/twisted/install
155 $(INSTALL_DIR) $(1)/usr/bin
156 $(SED) 's@#!$(STAGING_DIR)/usr/bin/hostpython@#!/usr/bin/python@' $(PKG_INSTALL_DIR)/usr/bin/mktap
157 $(SED) 's@#!$(STAGING_DIR)/usr/bin/hostpython@#!/usr/bin/python@' $(PKG_INSTALL_DIR)/usr/bin/twistd
158 $(INSTALL_BIN) \
159 $(PKG_INSTALL_DIR)/usr/bin/mktap \
160 $(PKG_INSTALL_DIR)/usr/bin/twistd \
161 $(1)/usr/bin
162 $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages/twisted/plugins
163 cd $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/twisted; \
164 $(CP) -a application copyright.py cred enterprise im.py __init__.py \
165 internet manhole persisted plugin.py protocols \
166 python scripts spread tap test trial _version.py \
167 $(1)/usr/lib/python2.5/site-packages/twisted
168 $(INSTALL_BIN) \
169 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/dropin.cache \
170 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/__init__.py \
171 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/notestplugin.py \
172 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/testplugin.py \
173 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_ftp.py \
174 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_inet.py \
175 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_manhole.py \
176 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_portforward.py \
177 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_reactors.py \
178 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_socks.py \
179 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_telnet.py \
180 $(PKG_INSTALL_DIR)/$(TWISTED_DIR)/plugins/twisted_trial.py \
181 $(1)/$(TWISTED_DIR)/plugins/
182 endef
183
184 define BuildSubmodule
185 define Package/$(1)/install
186 $(INSTALL_DIR) $$(1)/usr/lib/python2.5/site-packages/twisted/plugins
187 $(CP) -a \
188 $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/twisted/$(2) \
189 $$(1)/usr/lib/python2.5/site-packages/twisted/
190 $(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/
191 endef
192
193 $$(eval $$(call BuildPackage,$(1)))
194 endef
195
196 define Package/twisted-runner/install
197 $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages/twisted
198 $(CP) -a \
199 $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/twisted/runner $(1)/usr/lib/python2.5/site-packages/twisted/
200 endef
201
202 $(eval $(call BuildPackage,zope-interface))
203 $(eval $(call BuildPackage,twisted))
204 $(eval $(call BuildSubmodule,twisted-words,words))
205 $(eval $(call BuildSubmodule,twisted-conch,conch))
206 $(eval $(call BuildSubmodule,twisted-lore,lore))
207 $(eval $(call BuildSubmodule,twisted-mail,mail))
208 $(eval $(call BuildSubmodule,twisted-names,names))
209 $(eval $(call BuildSubmodule,twisted-news,news))
210 $(eval $(call BuildPackage,twisted-runner))
211 $(eval $(call BuildSubmodule,twisted-web,web))