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