2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
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
15 include $(TOPDIR)/rules.mk
18 PKG_VERSION:=1.9.1-p376
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:=e019ae9c643c5efe91be49e29781fb94
27 PKG_BUILD_DEPENDS:=ruby/host
31 include $(INCLUDE_DIR)/host-build.mk
32 include $(INCLUDE_DIR)/package.mk
34 define Package/ruby/Default
38 TITLE:=Ruby scripting language
39 URL:=http://www.ruby-lang.org/
42 define Package/ruby/Default/description
43 Ruby is the interpreted scripting language for quick and easy
44 object-oriented programming. It has many features to process text files
45 and to do system management tasks (as in perl). It is simple,
46 straight-forward, and extensible.
50 $(call Package/ruby/Default)
55 define Package/ruby/description
56 $(call Package/ruby/Default/description)
59 define Package/libruby
60 $(call Package/ruby/Default)
64 TITLE+= (shared library)
68 # Ongoing work to break up ruby's standard library into coherent pieces
69 # with minimal dependencies between them
71 define Package/ruby-core
72 $(call Package/ruby/Default)
73 TITLE:=Ruby standard libraries
77 define Package/ruby-cgi
78 $(call Package/ruby/Default)
79 TITLE:=Ruby CGI support toolkit
83 define Package/ruby-dl
84 $(call Package/ruby/Default)
85 TITLE+= (dynamic linker support) (adds 5MB+)
89 define Package/ruby-enc
90 $(call Package/ruby/Default)
91 TITLE+= (character re-coding library) (adds 2MB+)
95 define Package/ruby-erb
96 $(call Package/ruby/Default)
97 TITLE+= (embedded interpreter)
101 define Package/ruby-gdbm
102 $(call Package/ruby/Default)
103 TITLE:=Ruby support for gdbm
104 DEPENDS:=ruby +libgdbm
107 define Package/ruby-gems
108 $(call Package/ruby/Default)
109 TITLE:=Ruby gems packet management
110 DEPENDS:=ruby +ruby-yaml +ruby-zlib +ruby-openssl +ruby-webrick +ruby-erb
113 define Package/ruby-irb
114 $(call Package/ruby/Default)
115 TITLE+= (interactive shell)
116 DEPENDS:=ruby +ruby-core
119 define Package/ruby-json
120 $(call Package/ruby/Default)
121 TITLE:=Ruby support for JSON
125 define Package/ruby-ncurses
126 $(call Package/ruby/Default)
127 TITLE:=Ruby support for ncurses
128 DEPENDS:=ruby +libncurses
131 define Package/ruby-nkf
132 $(call Package/ruby/Default)
133 TITLE:=Ruby Network Kanji Filter
137 define Package/ruby-openssl
138 $(call Package/ruby/Default)
139 TITLE:=Ruby support for openssl
140 DEPENDS:=ruby +libopenssl
143 define Package/ruby-rdoc
144 $(call Package/ruby/Default)
145 TITLE+= (documentation generator)
149 define Package/ruby-rake
150 $(call Package/ruby/Default)
151 TITLE+=Ruby Rake (make replacement)
155 define Package/ruby-readline
156 $(call Package/ruby/Default)
157 TITLE:=Ruby support for readline
158 DEPENDS:=ruby +libncurses +libreadline
161 define Package/ruby-rexml
162 $(call Package/ruby/Default)
163 TITLE:=Ruby XML toolkit
167 define Package/ruby-rss
168 $(call Package/ruby/Default)
169 TITLE:=Ruby RSS toolkit
173 define Package/ruby-unit
174 $(call Package/ruby/Default)
175 TITLE:=Ruby unit testing toolkit
179 define Package/ruby-webrick
180 $(call Package/ruby/Default)
181 TITLE:=Ruby Web server toolkit
185 define Package/ruby-xmlrpc
186 $(call Package/ruby/Default)
187 TITLE:=Ruby XML-RPC toolkit
191 define Package/ruby-yaml
192 $(call Package/ruby/Default)
193 TITLE:=Ruby YAML toolkit
197 define Package/ruby-zlib
198 $(call Package/ruby/Default)
199 TITLE:=Ruby support for zlib
209 --enable-wide-getaddrinfo \
210 --with-ruby-version=minor \
212 TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
215 DESTDIR="$(PKG_INSTALL_DIR)" \
219 $(call Build/Prepare/Default)
220 ( cd $(PKG_BUILD_DIR) ; \
225 define Package/ruby/install
226 $(INSTALL_DIR) $(1)/usr/bin
227 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
230 define Package/libruby/install
231 $(INSTALL_DIR) $(1)/usr/lib
232 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
235 define Package/ruby-core/install
236 $(INSTALL_DIR) $(1)/usr/lib
237 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
239 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
241 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
243 $(1)/usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
244 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
246 $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest \
247 $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
248 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest \
249 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
250 $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl \
251 $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
252 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
253 $(1)/usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
254 $(1)/usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
255 $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick/ssl.rb \
257 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
259 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/enc \
261 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
262 $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/completion.rb \
263 $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/ext/save-history.rb \
265 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
267 $(1)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb \
269 $(1)/usr/lib/ruby/$(PKG_LIBVER)/json.rb \
270 $(1)/usr/lib/ruby/$(PKG_LIBVER)/json \
271 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/json \
273 $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb \
274 $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb \
276 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rdoc \
278 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb \
279 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake \
281 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb \
282 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems \
284 $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb \
285 $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi \
287 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rexml \
289 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss \
290 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb \
292 $(1)/usr/lib/ruby/$(PKG_LIBVER)/test \
294 $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick \
295 $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb \
297 $(1)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc \
299 $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml \
300 $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
301 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
303 find $(1) -name '*.h' | xargs rm -f
306 define Package/ruby-cgi/install
307 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
308 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi $(1)/usr/lib/ruby/$(PKG_LIBVER)/
309 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
312 define Package/ruby-dl/install
313 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
314 usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
315 ) | ( cd $(1); $(TAR) -xf - )
318 define Package/ruby-enc/install
319 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
320 usr/lib/ruby/$(PKG_LIBVER)/*/enc \
321 ) | ( cd $(1); $(TAR) -xf - )
324 define Package/ruby-erb/install
325 $(INSTALL_DIR) $(1)/usr/bin
326 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
327 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)/
328 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
331 define Package/ruby-gdbm/install
332 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
333 usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
334 ) | ( cd $(1); $(TAR) -xf - )
337 define Package/ruby-gems/install
338 $(INSTALL_DIR) $(1)/usr/bin
339 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
340 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
341 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
342 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems $(1)/usr/lib/ruby/$(PKG_LIBVER)/
345 define Package/ruby-irb/install
346 $(INSTALL_DIR) $(1)/usr/bin
347 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
348 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
349 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
350 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
353 define Package/ruby-json/install
354 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
355 usr/lib/ruby/$(PKG_LIBVER)/json.rb \
356 usr/lib/ruby/$(PKG_LIBVER)/json \
357 usr/lib/ruby/$(PKG_LIBVER)/*/json \
358 ) | ( cd $(1); $(TAR) -xf - )
361 define Package/ruby-ncurses/install
362 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
363 usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
364 ) | ( cd $(1); $(TAR) -xf - )
367 define Package/ruby-nkf/install
368 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
369 usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
370 usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
371 ) | ( cd $(1); $(TAR) -xf - )
374 define Package/ruby-openssl/install
375 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
376 usr/lib/ruby/$(PKG_LIBVER)/digest \
377 usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
378 usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
379 usr/lib/ruby/$(PKG_LIBVER)/*/digest/*.so \
380 usr/lib/ruby/$(PKG_LIBVER)/openssl \
381 usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
382 usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
383 usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
384 usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
385 usr/lib/ruby/$(PKG_LIBVER)/webrick/ssl.rb \
386 ) | ( cd $(1); $(TAR) -xf - )
389 define Package/ruby-rdoc/install
390 $(INSTALL_DIR) $(1)/usr/bin
391 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
392 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
393 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
394 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rdoc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
397 define Package/ruby-rake/install
398 $(INSTALL_DIR) $(1)/usr/bin
399 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/
400 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
401 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
402 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake $(1)/usr/lib/ruby/$(PKG_LIBVER)/
405 define Package/ruby-readline/install
406 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
407 usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
408 usr/lib/ruby/$(PKG_LIBVER)/irb/completion.rb \
409 usr/lib/ruby/$(PKG_LIBVER)/irb/ext/save-history.rb \
410 ) | ( cd $(1); $(TAR) -xf - )
413 define Package/ruby-rexml/install
414 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
415 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rexml $(1)/usr/lib/ruby/$(PKG_LIBVER)/
419 define Package/ruby-rss/install
420 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
421 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss $(1)/usr/lib/ruby/$(PKG_LIBVER)/
422 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
425 define Package/ruby-unit/install
426 $(INSTALL_DIR) $(1)/usr/bin
427 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
428 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
429 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/test $(1)/usr/lib/ruby/$(PKG_LIBVER)/
432 define Package/ruby-webrick/install
433 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
434 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick $(1)/usr/lib/ruby/$(PKG_LIBVER)/
435 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
438 define Package/ruby-xmlrpc/install
439 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
440 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
443 define Package/ruby-yaml/install
444 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
445 usr/lib/ruby/$(PKG_LIBVER)/yaml \
446 usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
447 usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
448 ) | ( cd $(1); $(TAR) -xf - )
451 define Package/ruby-zlib/install
452 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
453 usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
454 ) | ( cd $(1); $(TAR) -xf - )
457 define Build/InstallDev
458 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
460 ) | ( cd $(1); $(TAR) -xf - )
463 $(eval $(call BuildPackage,ruby))
464 $(eval $(call BuildPackage,libruby))
465 $(eval $(call BuildPackage,ruby-core))
466 $(eval $(call BuildPackage,ruby-cgi))
467 $(eval $(call BuildPackage,ruby-dl))
468 $(eval $(call BuildPackage,ruby-enc))
469 $(eval $(call BuildPackage,ruby-erb))
470 $(eval $(call BuildPackage,ruby-gdbm))
471 $(eval $(call BuildPackage,ruby-gems))
472 $(eval $(call BuildPackage,ruby-json))
473 $(eval $(call BuildPackage,ruby-irb))
474 $(eval $(call BuildPackage,ruby-ncurses))
475 $(eval $(call BuildPackage,ruby-nkf))
476 $(eval $(call BuildPackage,ruby-openssl))
477 $(eval $(call BuildPackage,ruby-rake))
478 $(eval $(call BuildPackage,ruby-rdoc))
479 $(eval $(call BuildPackage,ruby-readline))
480 $(eval $(call BuildPackage,ruby-rexml))
481 $(eval $(call BuildPackage,ruby-rss))
482 $(eval $(call BuildPackage,ruby-unit))
483 $(eval $(call BuildPackage,ruby-webrick))
484 $(eval $(call BuildPackage,ruby-xmlrpc))
485 $(eval $(call BuildPackage,ruby-yaml))
486 $(eval $(call BuildPackage,ruby-zlib))
487 $(eval $(call HostBuild))