a3093fc445ff8b30ab15d66257178cdaecd6846b
[openwrt/svn-archive/archive.git] / lang / ruby / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=ruby
11 PKG_VERSION:=1.8.6-p287
12 PKG_RELEASE:=4
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=ftp://ftp.ruby-lang.org/pub/ruby/1.8/
16 PKG_MD5SUM:=80b5f3db12531d36e6c81fac6d05dda9
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/ruby/Default
21 SUBMENU:=Ruby
22 SECTION:=lang
23 CATEGORY:=Languages
24 TITLE:=Ruby scripting language
25 URL:=http://www.ruby-lang.org/
26 endef
27
28 define Package/ruby/Default/description
29 Ruby is the interpreted scripting language for quick and easy
30 object-oriented programming. It has many features to process text files
31 and to do system management tasks (as in perl). It is simple,
32 straight-forward, and extensible.
33 endef
34
35 define Package/ruby
36 $(call Package/ruby/Default)
37 TITLE+= (interpreter)
38 DEPENDS:=+libruby
39 endef
40
41 define Package/ruby/description
42 $(call Package/ruby/Default/description)
43 endef
44
45 define Package/libruby
46 $(call Package/ruby/Default)
47 SUBMENU:=
48 SECTION:=libs
49 CATEGORY:=Libraries
50 TITLE+= (shared library)
51 endef
52
53 # Ongoing work to break up ruby's standard library into coherent pieces
54 # with minimal dependencies between them
55
56 define Package/ruby-core
57 $(call Package/ruby/Default)
58 TITLE:=Ruby standard libraries
59 DEPENDS:=ruby
60 endef
61
62 define Package/ruby-cgi
63 $(call Package/ruby/Default)
64 TITLE:= Ruby CGI support toolkit
65 DEPENDS:=ruby
66 endef
67
68 define Package/ruby-erb
69 $(call Package/ruby/Default)
70 TITLE+= (embedded interpreter)
71 DEPENDS:=ruby
72 endef
73
74 define Package/ruby-gdbm
75 $(call Package/ruby/Default)
76 TITLE:=Ruby support for gdbm
77 DEPENDS:=ruby +libgdbm
78 endef
79
80 define Package/ruby-irb
81 $(call Package/ruby/Default)
82 TITLE+= (interactive shell)
83 DEPENDS:=ruby +ruby-core
84 endef
85
86 define Package/ruby-ncurses
87 $(call Package/ruby/Default)
88 TITLE:=Ruby support for ncurses
89 DEPENDS:=ruby +libncurses
90 endef
91
92 define Package/ruby-nkf
93 $(call Package/ruby/Default)
94 TITLE:=Ruby Network Kanji Filter
95 DEPENDS:=ruby
96 endef
97
98 define Package/ruby-openssl
99 $(call Package/ruby/Default)
100 TITLE:=Ruby support for openssl
101 DEPENDS:=ruby +libopenssl
102 endef
103
104 define Package/ruby-rdoc
105 $(call Package/ruby/Default)
106 TITLE+= (documentation generator)
107 DEPENDS:=ruby
108 endef
109
110 define Package/ruby-readline
111 $(call Package/ruby/Default)
112 TITLE:=Ruby support for readline
113 DEPENDS:=ruby +libncurses +libreadline
114 endef
115
116 define Package/ruby-rexml
117 $(call Package/ruby/Default)
118 TITLE:=Ruby XML toolkit
119 DEPENDS:=ruby
120 endef
121
122 define Package/ruby-rss
123 $(call Package/ruby/Default)
124 TITLE:=Ruby RSS toolkit
125 DEPENDS:=ruby
126 endef
127
128 define Package/ruby-soap
129 $(call Package/ruby/Default)
130 TITLE:=Ruby SOAP toolkit
131 DEPENDS:=ruby
132 endef
133
134 define Package/ruby-unit
135 $(call Package/ruby/Default)
136 TITLE:=Ruby unit testing toolkit
137 DEPENDS:=ruby
138 endef
139
140 define Package/ruby-webrick
141 $(call Package/ruby/Default)
142 TITLE:=Ruby Web server toolkit
143 DEPENDS:=ruby
144 endef
145
146 define Package/ruby-wsdl
147 $(call Package/ruby/Default)
148 TITLE:=Ruby WSDL 1.1 toolkit
149 DEPENDS:=ruby
150 endef
151
152 define Package/ruby-xmlrpc
153 $(call Package/ruby/Default)
154 TITLE:=Ruby XML-RPC toolkit
155 DEPENDS:=ruby
156 endef
157
158 define Package/ruby-xsd
159 $(call Package/ruby/Default)
160 TITLE:=Ruby XML Schema Datatypes toolkit
161 DEPENDS:=ruby
162 endef
163
164 define Package/ruby-yaml
165 $(call Package/ruby/Default)
166 TITLE:=Ruby YAML toolkit
167 DEPENDS:=ruby
168 endef
169
170 define Package/ruby-zlib
171 $(call Package/ruby/Default)
172 TITLE:=Ruby support for zlib
173 DEPENDS:=ruby +zlib
174 endef
175
176
177 CONFIGURE_ARGS += \
178 --enable-shared \
179 --enable-static \
180 --disable-rpath \
181 --enable-wide-getaddrinfo \
182
183 CONFIGURE_VARS += \
184 ac_cv_func_setpgrp_void=yes
185
186 TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
187
188 MAKE_FLAGS += \
189 DESTDIR="$(PKG_INSTALL_DIR)" \
190 SHELL="/bin/bash" \
191 all install
192
193 define Package/ruby/install
194 $(INSTALL_DIR) $(1)/usr/bin
195 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
196 endef
197
198 define Package/libruby/install
199 $(INSTALL_DIR) $(1)/usr/lib
200 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
201 endef
202
203 define Package/ruby-core/install
204 $(INSTALL_DIR) $(1)/usr/lib
205 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
206 rm -rf \
207 $(1)/usr/lib/ruby/1.8/*/curses.so \
208 \
209 $(1)/usr/lib/ruby/1.8/*/gdbm.so \
210 \
211 $(1)/usr/lib/ruby/1.8/kconv.rb \
212 $(1)/usr/lib/ruby/1.8/*/nkf.so \
213 \
214 $(1)/usr/lib/ruby/1.8/digest \
215 $(1)/usr/lib/ruby/1.8/digest.rb \
216 $(1)/usr/lib/ruby/1.8/*/digest \
217 $(1)/usr/lib/ruby/1.8/*/digest.so \
218 $(1)/usr/lib/ruby/1.8/openssl \
219 $(1)/usr/lib/ruby/1.8/openssl.rb \
220 $(1)/usr/lib/ruby/1.8/*/openssl.so \
221 $(1)/usr/lib/ruby/1.8/md5.rb \
222 $(1)/usr/lib/ruby/1.8/rmd160.rb \
223 $(1)/usr/lib/ruby/1.8/sha1.rb \
224 $(1)/usr/lib/ruby/1.8/sha2.rb \
225 $(1)/usr/lib/ruby/1.8/drb/ssl.rb \
226 $(1)/usr/lib/ruby/1.8/net/ftptls.rb \
227 $(1)/usr/lib/ruby/1.8/net/https.rb \
228 $(1)/usr/lib/ruby/1.8/net/telnets.rb \
229 $(1)/usr/lib/ruby/1.8/webrick/ssl.rb \
230 \
231 $(1)/usr/lib/ruby/1.8/*/readline.so \
232 $(1)/usr/lib/ruby/1.8/irb/completion.rb \
233 $(1)/usr/lib/ruby/1.8/irb/ext/save-history.rb \
234 \
235 $(1)/usr/lib/ruby/1.8/*/zlib.so \
236 \
237 $(1)/usr/lib/ruby/1.8/erb.rb \
238 \
239 $(1)/usr/lib/ruby/1.8/irb.rb \
240 $(1)/usr/lib/ruby/1.8/irb \
241 \
242 $(1)/usr/lib/ruby/1.8/rdoc \
243 \
244 $(1)/usr/lib/ruby/1.8/cgi \
245 $(1)/usr/lib/ruby/1.8/cgi.rb \
246 $(1)/usr/lib/ruby/1.8/cgi-lib.rb \
247 \
248 $(1)/usr/lib/ruby/1.8/rexml \
249 \
250 $(1)/usr/lib/ruby/1.8/rss \
251 $(1)/usr/lib/ruby/1.8/rss.rb \
252 \
253 $(1)/usr/lib/ruby/1.8/soap \
254 \
255 $(1)/usr/lib/ruby/1.8/rubyunit.rb \
256 $(1)/usr/lib/ruby/1.8/runit \
257 $(1)/usr/lib/ruby/1.8/test \
258 \
259 $(1)/usr/lib/ruby/1.8/webrick \
260 $(1)/usr/lib/ruby/1.8/webrick.rb \
261 \
262 $(1)/usr/lib/ruby/1.8/wsdl \
263 \
264 $(1)/usr/lib/ruby/1.8/xmlrpc \
265 \
266 $(1)/usr/lib/ruby/1.8/xsd \
267 \
268 $(1)/usr/lib/ruby/1.8/yaml \
269 $(1)/usr/lib/ruby/1.8/yaml.rb \
270 $(1)/usr/lib/ruby/1.8/*/syck.so
271
272 find $(1) -name '*.h' | xargs rm -f
273 endef
274
275 define Package/ruby-cgi/install
276 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
277 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/cgi $(1)/usr/lib/ruby/1.8/
278 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/cgi.rb $(1)/usr/lib/ruby/1.8/
279 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/cgi-lib.rb $(1)/usr/lib/ruby/1.8/
280 endef
281
282 define Package/ruby-erb/install
283 $(INSTALL_DIR) $(1)/usr/bin
284 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
285 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8/
286 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/erb.rb $(1)/usr/lib/ruby/1.8/
287 endef
288
289 define Package/ruby-gdbm/install
290 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
291 usr/lib/ruby/1.8/*/gdbm.so \
292 ) | ( cd $(1); $(TAR) -xf - )
293 endef
294
295 define Package/ruby-irb/install
296 $(INSTALL_DIR) $(1)/usr/bin
297 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
298 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
299 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/irb $(1)/usr/lib/ruby/1.8/
300 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/irb.rb $(1)/usr/lib/ruby/1.8/
301 endef
302
303 define Package/ruby-ncurses/install
304 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
305 usr/lib/ruby/1.8/*/curses.so \
306 ) | ( cd $(1); $(TAR) -xf - )
307 endef
308
309 define Package/ruby-nkf/install
310 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
311 usr/lib/ruby/1.8/kconv.rb \
312 usr/lib/ruby/1.8/*/nkf.so \
313 ) | ( cd $(1); $(TAR) -xf - )
314 endef
315
316 define Package/ruby-openssl/install
317 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
318 usr/lib/ruby/1.8/digest \
319 usr/lib/ruby/1.8/digest.rb \
320 usr/lib/ruby/1.8/*/digest.so \
321 usr/lib/ruby/1.8/*/digest/*.so \
322 usr/lib/ruby/1.8/openssl \
323 usr/lib/ruby/1.8/openssl.rb \
324 usr/lib/ruby/1.8/*/openssl.so \
325 usr/lib/ruby/1.8/md5.rb \
326 usr/lib/ruby/1.8/rmd160.rb \
327 usr/lib/ruby/1.8/sha1.rb \
328 usr/lib/ruby/1.8/sha2.rb \
329 usr/lib/ruby/1.8/drb/ssl.rb \
330 usr/lib/ruby/1.8/net/ftptls.rb \
331 usr/lib/ruby/1.8/net/https.rb \
332 usr/lib/ruby/1.8/net/telnets.rb \
333 usr/lib/ruby/1.8/webrick/ssl.rb \
334 ) | ( cd $(1); $(TAR) -xf - )
335 endef
336
337 define Package/ruby-rdoc/install
338 $(INSTALL_DIR) $(1)/usr/bin
339 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
340 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
341 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
342 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rdoc $(1)/usr/lib/ruby/1.8/
343 endef
344
345 define Package/ruby-readline/install
346 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
347 usr/lib/ruby/1.8/*/readline.so \
348 usr/lib/ruby/1.8/irb/completion.rb \
349 usr/lib/ruby/1.8/irb/ext/save-history.rb \
350 ) | ( cd $(1); $(TAR) -xf - )
351 endef
352
353 define Package/ruby-rexml/install
354 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
355 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rexml $(1)/usr/lib/ruby/1.8/
356 endef
357
358 define Package/ruby-rss/install
359 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
360 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rss $(1)/usr/lib/ruby/1.8/
361 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rss.rb $(1)/usr/lib/ruby/1.8/
362 endef
363
364 define Package/ruby-soap/install
365 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
366 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/soap $(1)/usr/lib/ruby/1.8/
367 endef
368
369 define Package/ruby-unit/install
370 $(INSTALL_DIR) $(1)/usr/bin
371 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
372 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
373 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rubyunit.rb $(1)/usr/lib/ruby/1.8/
374 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/runit $(1)/usr/lib/ruby/1.8/
375 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/test $(1)/usr/lib/ruby/1.8/
376 endef
377
378 define Package/ruby-webrick/install
379 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
380 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/webrick $(1)/usr/lib/ruby/1.8/
381 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/webrick.rb $(1)/usr/lib/ruby/1.8/
382 endef
383
384 define Package/ruby-wsdl/install
385 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
386 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/wsdl $(1)/usr/lib/ruby/1.8/
387 endef
388
389 define Package/ruby-xmlrpc/install
390 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
391 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/xmlrpc $(1)/usr/lib/ruby/1.8/
392 endef
393
394 define Package/ruby-xsd/install
395 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
396 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/xsd $(1)/usr/lib/ruby/1.8/
397 endef
398
399 define Package/ruby-yaml/install
400 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
401 usr/lib/ruby/1.8/yaml \
402 usr/lib/ruby/1.8/yaml.rb \
403 usr/lib/ruby/1.8/*/syck.so \
404 ) | ( cd $(1); $(TAR) -xf - )
405 endef
406
407 define Package/ruby-zlib/install
408 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
409 usr/lib/ruby/1.8/*/zlib.so \
410 ) | ( cd $(1); $(TAR) -xf - )
411 endef
412
413 $(eval $(call RequireCommand,ruby, \
414 $(PKG_NAME) requires ruby installed on the host-system. \
415 ))
416
417 $(eval $(call BuildPackage,ruby))
418 $(eval $(call BuildPackage,libruby))
419 $(eval $(call BuildPackage,ruby-core))
420 $(eval $(call BuildPackage,ruby-cgi))
421 $(eval $(call BuildPackage,ruby-erb))
422 $(eval $(call BuildPackage,ruby-gdbm))
423 $(eval $(call BuildPackage,ruby-irb))
424 $(eval $(call BuildPackage,ruby-ncurses))
425 $(eval $(call BuildPackage,ruby-nkf))
426 $(eval $(call BuildPackage,ruby-openssl))
427 $(eval $(call BuildPackage,ruby-rdoc))
428 $(eval $(call BuildPackage,ruby-readline))
429 $(eval $(call BuildPackage,ruby-rexml))
430 $(eval $(call BuildPackage,ruby-rss))
431 $(eval $(call BuildPackage,ruby-soap))
432 $(eval $(call BuildPackage,ruby-unit))
433 $(eval $(call BuildPackage,ruby-webrick))
434 $(eval $(call BuildPackage,ruby-wsdl))
435 $(eval $(call BuildPackage,ruby-xmlrpc))
436 $(eval $(call BuildPackage,ruby-xsd))
437 $(eval $(call BuildPackage,ruby-yaml))
438 $(eval $(call BuildPackage,ruby-zlib))
439