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