First Commit
[librecmc/package-feed.git] / lang / ruby / Makefile
1 #
2 # Copyright (C) 2006-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # To Do:
8 #  - dirs not removed when uninstalling!
9 #
10 include $(TOPDIR)/rules.mk
11
12 PKG_NAME:=ruby
13 PKG_VERSION:=2.3.3
14 PKG_RELEASE:=1
15
16 PKG_LIBVER:=2.3
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
19 PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_LIBVER)/
20 PKG_MD5SUM:=882e6146ed26c6e78c02342835f5d46b86de95f0dc4e16543294bc656594cc5b
21 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
22 PKG_LICENSE:=BSD-2-Clause
23 PKG_LICENSE_FILES:=COPYING
24
25 PKG_BUILD_DEPENDS:=ruby/host
26 PKG_INSTALL:=1
27 PKG_BUILD_PARALLEL:=1
28 PKG_FIXUP:=autoreconf
29
30 include $(INCLUDE_DIR)/host-build.mk
31 include $(INCLUDE_DIR)/package.mk
32 include $(INCLUDE_DIR)/nls.mk
33
34 HOST_CONFIGURE_ARGS += \
35         --disable-install-doc \
36         --disable-install-rdoc \
37         --disable-install-capi \
38         --without-gmp \
39         --with-out-ext=tk,tk/tkutil,win32,win32ole,dbm,gdbm,readline \
40
41 # Does not compile with this. Workaround is --without-gmp
42 # https://bugs.ruby-lang.org/issues/11940
43         #--with-static-linked-ext \
44
45 # even not used, host build with restricted exts results in gems not being
46 # compiled for target (probably some cross compiling problem like checking
47 # host for selecting target features)
48 #       --with-out-ext \
49 #       --with-ext=thread,stringio \
50
51 CONFIGURE_ARGS += \
52         --enable-shared \
53         --enable-static \
54         --disable-rpath \
55         $(call autoconf_bool,CONFIG_IPV6,ipv6) \
56         --disable-install-doc \
57         --disable-install-capi \
58         --with-ruby-version=minor \
59         --with-iconv-dir=$(ICONV_PREFIX) \
60         --with-out-ext=tk,tk/tkutil,win32,win32ole
61
62 ifndef CONFIG_RUBY_DIGEST_USE_OPENSSL
63 CONFIGURE_ARGS += \
64         --with-bundled-sha1\
65         --with-bundled-md5\
66         --with-bundled-rmd160\
67         --with-bundled-sha2 \
68
69 endif
70
71 TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
72
73 # Ruby uses DLDFLAGS and not LDFLAGS for libraries. LDFLAGS is only for execs.
74 # However, DLDFLAGS from configure is not passed to Makefile when target is linux.
75 # XLDFLAGS is used by both libraries and execs. This is somehow brute force but
76 # if will fix when some LD_FLAGS is needef for libraries. As side effect, it will
77 # duplicate ld args for binaries.
78 CONFIGURE_VARS += XLDFLAGS="$(TARGET_LDFLAGS)"
79
80 MAKE_FLAGS += \
81         DESTDIR="$(PKG_INSTALL_DIR)" \
82         SHELL="/bin/bash"
83
84 define Build/InstallDev
85         ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
86                 . \
87         ) | ( cd $(1); $(TAR) -xf - )
88 endef
89
90 define Host/Install
91         # When ruby version is updated, make install asks in some cases before replace
92         # an existing different file. Remove them before install and avoid the interaction
93         rm -f $(HOST_BUILD_PREFIX)/bin/rake
94         $(call Host/Install/Default)
95 endef
96
97 define Package/ruby/Default
98   SUBMENU:=Ruby
99   SECTION:=lang
100   CATEGORY:=Languages
101   TITLE:=Ruby scripting language
102   URL:=http://www.ruby-lang.org/
103 endef
104
105 define Package/ruby/Default/description
106  Ruby is the interpreted scripting language for quick and easy
107  object-oriented programming.  It has many features to process text files
108  and to do system management tasks (as in perl).  It is simple,
109  straight-forward, and extensible.
110
111 endef
112
113 define Package/ruby
114 $(call Package/ruby/Default)
115   TITLE+= (interpreter)
116   DEPENDS:=+libruby
117 endef
118
119 define Package/ruby/description
120 $(call Package/ruby/Default/description)
121 endef
122
123 define RubyDependency
124     $(eval \
125         $(call Package/Default)
126         $(call Package/ruby-$(1))
127         FILTER_CONFIG:=$$(strip \
128             $$(foreach config_dep, \
129                 $$(filter @%, \
130                     $$(foreach v, \
131                         $$(DEPENDS), \
132                         $$(if $$(findstring :,$$v),,$$v) \
133                     ) \
134                 ), \
135                 $$(subst @,,$$(config_dep)) \
136             ) \
137         )
138         ifneq (,$$(FILTER_CONFIG))
139            FILTER_CONFIG:=($$(subst $$(space),&&,$$(FILTER_CONFIG))):
140         endif
141     ) \
142     +$(FILTER_CONFIG)ruby-$(1)
143 endef
144
145 define Package/ruby/config
146     comment "Standard Library"
147       depends on PACKAGE_ruby
148
149     config PACKAGE_ruby-stdlib
150       depends on PACKAGE_ruby
151       default m if ALL
152       prompt "Select Ruby Complete Standard Library (ruby-stdlib)"
153
154 endef
155
156 define Package/ruby/install
157         $(INSTALL_DIR) $(1)/usr/bin
158         $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
159         $(INSTALL_DIR) $(1)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)
160         $(INSTALL_DIR) $(1)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)
161         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/lib/ruby/ruby$(PKG_LIBVER)-bin
162         $(INSTALL_BIN) ./files/ruby $(1)/usr/bin/ruby
163         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)/* $(1)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)/
164         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)/* $(1)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)/
165         $(SED) "s%@RUBY_LIBPATH@%/usr/lib/ruby/$(PKG_LIBVER)%" $(1)/usr/bin/ruby
166         $(SED) "s%@RUBY_BINPATH@%/usr/lib/ruby/ruby$(PKG_LIBVER)-bin%" $(1)/usr/bin/ruby
167 endef
168
169 define Package/libruby
170 $(call Package/ruby/Default)
171   SUBMENU:=
172   SECTION:=libs
173   CATEGORY:=Libraries
174   TITLE+= (shared library)
175   DEPENDS+= +libpthread +librt +libgmp
176   ABI_VERSION:=$(PKG_LIBVER)
177 endef
178 define Package/libruby/install
179         $(INSTALL_DIR) $(1)/usr/lib
180         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
181 endef
182
183 RUBY_STDLIB :=
184 define Package/ruby-stdlib
185 $(call Package/ruby/Default)
186   TITLE:=Ruby standard libraries (metadata for all stdlib subsets)
187   DEPENDS:=ruby $(foreach subpackage,$(RUBY_STDLIB),$(strip $(call RubyDependency,$(subpackage))))
188   HIDDEN:=1
189 endef
190
191 define Package/ruby-stdlib/description
192  This metapackage currently install all ruby-* packages,
193  providing a complete Ruby Standard Library.
194
195 endef
196
197 # nothing to do
198 define Package/ruby-stdlib/install
199         /bin/true
200 endef
201
202 define Package/ruby-bigdecimal/files
203 /usr/lib/ruby/$(PKG_LIBVER)/*/bigdecimal.so
204 /usr/lib/ruby/$(PKG_LIBVER)/bigdecimal/
205 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/bigdecimal-*.gemspec
206 endef
207
208 define Package/ruby-cgi/files
209 /usr/lib/ruby/$(PKG_LIBVER)/cgi
210 /usr/lib/ruby/$(PKG_LIBVER)/cgi.rb
211 /usr/lib/ruby/$(PKG_LIBVER)/*/cgi/escape.so
212 endef
213
214 define Package/ruby-csv/files
215 /usr/lib/ruby/$(PKG_LIBVER)/csv.rb
216 endef
217
218 define Package/ruby-datetime/files
219 /usr/lib/ruby/$(PKG_LIBVER)/time.rb
220 /usr/lib/ruby/$(PKG_LIBVER)/date.rb
221 /usr/lib/ruby/$(PKG_LIBVER)/*/date_core.so
222 endef
223
224 define Package/ruby-dbm/description
225  The DBM class provides a wrapper to a Unix-style dbm or Database Manager library.
226  This package provides dbm.so file.
227
228 endef
229 define Package/ruby-dbm/files
230 /usr/lib/ruby/$(PKG_LIBVER)/*/dbm.so
231 endef
232
233 define Package/ruby-debuglib/files
234 /usr/lib/ruby/$(PKG_LIBVER)/profile.rb
235 /usr/lib/ruby/$(PKG_LIBVER)/profiler.rb
236 /usr/lib/ruby/$(PKG_LIBVER)/debug.rb
237 /usr/lib/ruby/$(PKG_LIBVER)/tracer.rb
238 /usr/lib/ruby/$(PKG_LIBVER)/benchmark.rb
239 /usr/lib/ruby/$(PKG_LIBVER)/*/objspace.so
240 endef
241
242 define Package/ruby-did-you-mean/files
243 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/did_you_mean-*.gemspec
244 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/
245 endef
246 define Package/ruby-did-you-mean/files-excluded
247 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/benchmark
248 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/doc
249 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/evaluation
250 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/test
251 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/*.md
252 endef
253
254 define Package/ruby-digest/description
255  Provides digest* files. Can be configured to use OpenSSL or
256  bundled hash functions.
257
258 endef
259 define Package/ruby-digest/config
260
261         config RUBY_DIGEST_USE_OPENSSL
262                 bool "Use OpenSSL functions for ruby digest hash functions"
263         depends on PACKAGE_ruby-digest
264                 help
265                         Ruby can use OpenSSL hash functions or compile alternative implementations. Using
266                         OpenSSL saves about 30KBytes (less when compressed) but requires OpenSSL (that
267                         is way bigger than that). However, if OpenSSL is already needed by another usage,
268                         as ruby-openssl or any other non ruby package, it is better to mark this option.
269                 default n
270
271 endef
272 define Package/ruby-digest/files
273 /usr/lib/ruby/$(PKG_LIBVER)/digest
274 /usr/lib/ruby/$(PKG_LIBVER)/digest.rb
275 /usr/lib/ruby/$(PKG_LIBVER)/*/digest.so
276 /usr/lib/ruby/$(PKG_LIBVER)/*/digest/*
277 endef
278
279 define Package/ruby-drb/files
280 /usr/lib/ruby/$(PKG_LIBVER)/drb.rb
281 /usr/lib/ruby/$(PKG_LIBVER)/drb
282 endef
283
284 define Package/ruby-enc/files
285 /usr/lib/ruby/$(PKG_LIBVER)/*/enc/encdb.so
286 /usr/lib/ruby/$(PKG_LIBVER)/*/enc/iso_8859_1.so
287 /usr/lib/ruby/$(PKG_LIBVER)/*/enc/utf_*.so
288 /usr/lib/ruby/$(PKG_LIBVER)/*/enc/euc_jp.so
289 endef
290
291 define Package/ruby-enc-extra/files
292 /usr/lib/ruby/$(PKG_LIBVER)/*/enc
293 endef
294 define Package/ruby-enc-extra/files-excluded
295 $(call Package/ruby-enc/files)
296 endef
297
298 define Package/ruby-erb/files
299 /usr/bin/erb
300 /usr/lib/ruby/$(PKG_LIBVER)/erb.rb
301 endef
302
303 define Package/ruby-fiddle/files
304 /usr/lib/ruby/$(PKG_LIBVER)/fiddle.rb
305 /usr/lib/ruby/$(PKG_LIBVER)/fiddle/
306 /usr/lib/ruby/$(PKG_LIBVER)/*/fiddle.so
307 endef
308
309 define Package/ruby-filelib/files
310 /usr/lib/ruby/$(PKG_LIBVER)/tmpdir.rb
311 /usr/lib/ruby/$(PKG_LIBVER)/tempfile.rb
312 /usr/lib/ruby/$(PKG_LIBVER)/pathname.rb
313 /usr/lib/ruby/$(PKG_LIBVER)/*/pathname.so
314 /usr/lib/ruby/$(PKG_LIBVER)/find.rb
315 /usr/lib/ruby/$(PKG_LIBVER)/fileutils.rb
316 endef
317
318 define Package/ruby-gdbm/files
319 /usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so
320 endef
321
322 define Package/ruby-gems/files
323 /usr/lib/ruby/$(PKG_LIBVER)/ubygems.rb
324 /usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb
325 /usr/lib/ruby/$(PKG_LIBVER)/rubygems
326 endef
327 define Package/ruby-gems/files-excluded
328 /usr/lib/ruby/$(PKG_LIBVER)/rubygems/test_case.rb
329 /usr/lib/ruby/$(PKG_LIBVER)/rubygems/package/tar_test_case.rb
330 /usr/lib/ruby/$(PKG_LIBVER)/rubygems/installer_test_case.rb
331 endef
332 define Package/ruby-gems/install
333         $(INSTALL_DIR) $(1)/usr/bin
334         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
335         $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default
336         $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/gems
337         $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/doc
338         $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/cache
339         $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/extensions
340         $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/build_info
341         $(call RubyBuildPackage/install,gems,$(1))
342 endef
343
344 define Package/ruby-io-console/files
345 /usr/lib/ruby/$(PKG_LIBVER)/*/io/console.so
346 /usr/lib/ruby/$(PKG_LIBVER)/io/console/
347 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/io-console-*.gemspec
348 endef
349
350 define Package/ruby-irb/files
351 /usr/lib/ruby/$(PKG_LIBVER)/irb
352 /usr/lib/ruby/$(PKG_LIBVER)/irb.rb
353 endef
354 define Package/ruby-irb/install
355         $(INSTALL_DIR) $(1)/usr/bin
356         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
357         $(call RubyBuildPackage/install,irb,$(1))
358 endef
359
360 define Package/ruby-json/files
361 /usr/lib/ruby/$(PKG_LIBVER)/json.rb
362 /usr/lib/ruby/$(PKG_LIBVER)/json
363 /usr/lib/ruby/$(PKG_LIBVER)/*/json
364 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/json-*.gemspec
365 endef
366 define Package/ruby-json/files-excluded
367 $(call Package/ruby-psych/files)
368 endef
369
370 define Package/ruby-logger/files
371 /usr/lib/ruby/$(PKG_LIBVER)/logger.rb
372 /usr/lib/ruby/$(PKG_LIBVER)/syslog/logger.rb
373 /usr/lib/ruby/$(PKG_LIBVER)/*/syslog.so
374 endef
375
376 define Package/ruby-math/files
377 /usr/lib/ruby/$(PKG_LIBVER)/prime.rb
378 /usr/lib/ruby/$(PKG_LIBVER)/mathn.rb
379 /usr/lib/ruby/$(PKG_LIBVER)/cmath.rb
380 /usr/lib/ruby/$(PKG_LIBVER)/*/mathn
381 /usr/lib/ruby/$(PKG_LIBVER)/matrix.rb
382 /usr/lib/ruby/$(PKG_LIBVER)/matrix
383 endef
384
385 define Package/ruby-minitest/files
386 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/minitest-*.gemspec
387 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*
388 endef
389 define Package/ruby-minitest/files-excluded
390 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/test
391 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/*.rdoc
392 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/*.txt
393 endef
394
395 define Package/ruby-misc/files
396 /usr/lib/ruby/$(PKG_LIBVER)/English.rb
397 /usr/lib/ruby/$(PKG_LIBVER)/abbrev.rb
398 /usr/lib/ruby/$(PKG_LIBVER)/base64.rb
399 /usr/lib/ruby/$(PKG_LIBVER)/delegate.rb
400 /usr/lib/ruby/$(PKG_LIBVER)/e2mmap.rb
401 /usr/lib/ruby/$(PKG_LIBVER)/expect.rb
402 /usr/lib/ruby/$(PKG_LIBVER)/getoptlong.rb
403 /usr/lib/ruby/$(PKG_LIBVER)/open3.rb
404 /usr/lib/ruby/$(PKG_LIBVER)/ostruct.rb
405 /usr/lib/ruby/$(PKG_LIBVER)/scanf.rb
406 /usr/lib/ruby/$(PKG_LIBVER)/securerandom.rb
407 /usr/lib/ruby/$(PKG_LIBVER)/set.rb
408 /usr/lib/ruby/$(PKG_LIBVER)/shellwords.rb
409 /usr/lib/ruby/$(PKG_LIBVER)/tsort.rb
410 /usr/lib/ruby/$(PKG_LIBVER)/weakref.rb
411 /usr/lib/ruby/$(PKG_LIBVER)/*/continuation.so
412 /usr/lib/ruby/$(PKG_LIBVER)/*/coverage.so
413 /usr/lib/ruby/$(PKG_LIBVER)/*/etc.so
414 /usr/lib/ruby/$(PKG_LIBVER)/*/fcntl.so
415 /usr/lib/ruby/$(PKG_LIBVER)/*/fiber.so
416 /usr/lib/ruby/$(PKG_LIBVER)/*/pty.so
417 /usr/lib/ruby/$(PKG_LIBVER)/*/stringio.so
418 /usr/lib/ruby/$(PKG_LIBVER)/*/strscan.so
419 endef
420
421 define Package/ruby-mkmf/files
422 /usr/lib/ruby/$(PKG_LIBVER)/mkmf.rb
423 /usr/lib/ruby/$(PKG_LIBVER)/un.rb
424 endef
425
426 define Package/ruby-multithread/files
427 /usr/lib/ruby/$(PKG_LIBVER)/monitor.rb
428 /usr/lib/ruby/$(PKG_LIBVER)/timeout.rb
429 /usr/lib/ruby/$(PKG_LIBVER)/thwait.rb
430 /usr/lib/ruby/$(PKG_LIBVER)/mutex_m.rb
431 /usr/lib/ruby/$(PKG_LIBVER)/sync.rb
432 /usr/lib/ruby/$(PKG_LIBVER)/*/thread.so
433 /usr/lib/ruby/$(PKG_LIBVER)/*/io/wait.so
434 /usr/lib/ruby/$(PKG_LIBVER)/*/io/nonblock.so
435 endef
436
437 define Package/ruby-net/files
438 /usr/lib/ruby/$(PKG_LIBVER)/open-uri.rb
439 /usr/lib/ruby/$(PKG_LIBVER)/net/*
440 endef
441
442 define Package/ruby-net-telnet/files
443 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/net-telnet-*.gemspec
444 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/
445 endef
446 define Package/ruby-net-telnet/files-excluded
447 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/*.md
448 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/*.txt
449 endef
450
451 define Package/ruby-nkf/files
452 /usr/lib/ruby/$(PKG_LIBVER)/kconv.rb
453 /usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so
454 endef
455
456 define Package/ruby-openssl/files
457 /usr/lib/ruby/$(PKG_LIBVER)/openssl
458 /usr/lib/ruby/$(PKG_LIBVER)/openssl.rb
459 /usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so
460 endef
461
462 define Package/ruby-optparse/files
463 /usr/lib/ruby/$(PKG_LIBVER)/optparse.rb
464 /usr/lib/ruby/$(PKG_LIBVER)/optionparser.rb
465 /usr/lib/ruby/$(PKG_LIBVER)/optparse
466 endef
467
468 define Package/ruby-patterns/files
469 /usr/lib/ruby/$(PKG_LIBVER)/observer.rb
470 /usr/lib/ruby/$(PKG_LIBVER)/singleton.rb
471 /usr/lib/ruby/$(PKG_LIBVER)/forwardable.rb
472 endef
473
474 define Package/ruby-powerassert/files
475 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/power_assert-*.gemspec
476 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/power_assert-*
477 endef
478 define Package/ruby-powerassert/files-excluded
479 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/power_assert-*/test
480 endef
481
482 define Package/ruby-prettyprint/files
483 /usr/lib/ruby/$(PKG_LIBVER)/pp.rb
484 /usr/lib/ruby/$(PKG_LIBVER)/prettyprint.rb
485 endef
486
487 define Package/ruby-pstore/files
488 /usr/lib/ruby/$(PKG_LIBVER)/pstore.rb
489 endef
490
491 define Package/ruby-psych/files
492 /usr/lib/ruby/$(PKG_LIBVER)/psych
493 /usr/lib/ruby/$(PKG_LIBVER)/psych.rb
494 /usr/lib/ruby/$(PKG_LIBVER)/psych_jars.rb
495 /usr/lib/ruby/$(PKG_LIBVER)/*/psych.so
496 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/psych-*.gemspec
497 endef
498
499 define Package/ruby-racc/files
500 /usr/lib/ruby/$(PKG_LIBVER)/racc
501 /usr/lib/ruby/$(PKG_LIBVER)/*/racc/*.so
502 endef
503
504 define Package/ruby-rake/files
505 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/rake-*.gemspec
506 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/
507 endef
508 define Package/ruby-rake/files-excluded
509 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/doc
510 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/test
511 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/*.rdoc
512 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/*.txt
513 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-10.4.2/lib/rake/runtest.rb
514 endef
515 define Package/ruby-rake/install
516         $(INSTALL_DIR) $(1)/usr/bin
517         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/;
518         $(call RubyBuildPackage/install,rake,$(1))
519 endef
520
521 define Package/ruby-rbconfig/files
522 /usr/lib/ruby/$(PKG_LIBVER)/*/rbconfig.rb
523 /usr/lib/ruby/$(PKG_LIBVER)/rbconfig/*
524 /usr/lib/ruby/$(PKG_LIBVER)/*/rbconfig/*.so
525 endef
526
527 define Package/ruby-rdoc/files
528         /usr/lib/ruby/$(PKG_LIBVER)/rdoc.rb
529         /usr/lib/ruby/$(PKG_LIBVER)/rdoc
530         /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rdoc-*
531         /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/rdoc-*.gemspec
532 endef
533 define Package/ruby-rdoc/files-excluded
534         /usr/lib/ruby/$(PKG_LIBVER)/rdoc/test_case.rb
535         /usr/lib/ruby/$(PKG_LIBVER)/rdoc/markup/formatter_test_case.rb
536         /usr/lib/ruby/$(PKG_LIBVER)/rdoc/markup/text_formatter_test_case.rb
537 endef
538 define Package/ruby-rdoc/install
539         $(INSTALL_DIR) $(1)/usr/bin
540         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
541         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
542         $(call RubyBuildPackage/install,rdoc,$(1))
543 endef
544
545 define Package/ruby-readline/files
546 /usr/lib/ruby/$(PKG_LIBVER)/*/readline.so
547 endef
548
549 define Package/ruby-rexml/files
550 /usr/lib/ruby/$(PKG_LIBVER)/rexml
551 endef
552
553 define Package/ruby-rinda/files
554 /usr/lib/ruby/$(PKG_LIBVER)/rinda
555 endef
556
557 define Package/ruby-ripper/files
558 /usr/lib/ruby/$(PKG_LIBVER)/ripper.rb
559 /usr/lib/ruby/$(PKG_LIBVER)/ripper
560 /usr/lib/ruby/$(PKG_LIBVER)/*/ripper.so
561 endef
562
563 define Package/ruby-rss/files
564 /usr/lib/ruby/$(PKG_LIBVER)/rss
565 /usr/lib/ruby/$(PKG_LIBVER)/rss.rb
566 endef
567
568 define Package/ruby-sdbm/files
569 /usr/lib/ruby/$(PKG_LIBVER)/*/sdbm.so
570 endef
571
572 define Package/ruby-shell/files
573 /usr/lib/ruby/$(PKG_LIBVER)/shell.rb
574 /usr/lib/ruby/$(PKG_LIBVER)/shell
575 endef
576
577 define Package/ruby-socket/files
578 /usr/lib/ruby/$(PKG_LIBVER)/ipaddr.rb
579 /usr/lib/ruby/$(PKG_LIBVER)/resolv-replace.rb
580 /usr/lib/ruby/$(PKG_LIBVER)/resolv.rb
581 /usr/lib/ruby/$(PKG_LIBVER)/socket.rb
582 /usr/lib/ruby/$(PKG_LIBVER)/*/socket.so
583 endef
584
585 define Package/ruby-testunit/files
586 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/test-unit-*.gemspec
587 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*
588 endef
589 define Package/ruby-testunit/files-excluded
590 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/doc
591 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/test
592 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/sample
593 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/*.md
594 endef
595
596 define Package/ruby-unicodenormalize/files
597 /usr/lib/ruby/$(PKG_LIBVER)/unicode_normalize.rb
598 /usr/lib/ruby/$(PKG_LIBVER)/unicode_normalize
599 endef
600
601 define Package/ruby-uri/files
602 /usr/lib/ruby/$(PKG_LIBVER)/uri.rb
603 /usr/lib/ruby/$(PKG_LIBVER)/uri
604 endef
605
606 define Package/ruby-webrick/files
607 /usr/lib/ruby/$(PKG_LIBVER)/webrick
608 /usr/lib/ruby/$(PKG_LIBVER)/webrick.rb
609 endef
610
611 define Package/ruby-xmlrpc/files
612 /usr/lib/ruby/$(PKG_LIBVER)/xmlrpc
613 /usr/lib/ruby/$(PKG_LIBVER)/xmlrpc.rb
614 endef
615
616 define Package/ruby-yaml/files
617 /usr/lib/ruby/$(PKG_LIBVER)/yaml
618 /usr/lib/ruby/$(PKG_LIBVER)/yaml.rb
619 endef
620
621 define Package/ruby-zlib/files
622 /usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so
623 endef
624
625 RUBY_FILES = $(strip $(call Package/ruby-$(1)/files))
626 RUBY_FILES_EXCLUDED = $(strip $(call Package/ruby-$(1)/files-excluded))
627
628 # 1: short name
629 # 2: install dir
630 define RubyBuildPackage/install
631         ( \
632           cd $(PKG_INSTALL_DIR) && \
633           $(TAR) -cf - \
634             $(if $(RUBY_FILES_EXCLUDED),--exclude-from <(ls -1d $(patsubst /%,%,$(RUBY_FILES_EXCLUDED)))) \
635             --files-from <(ls -1d $(patsubst /%,%,$(RUBY_FILES))) \
636         ) | ( \
637           [ -n "$(2)" ] && cd $(2) && $(TAR) -xf - \
638         )
639 endef
640
641 # 1: short name
642 # 2: description
643 # 3: dependencies on other packages
644 define RubyBuildPackage
645   RUBY_STDLIB += $(1)
646
647   # Package definition
648   ifndef Package/ruby-$(1)
649     define Package/ruby-$(1)
650       $(call Package/ruby/Default)
651       TITLE:=Ruby $(2)
652       DEPENDS:=ruby $(3)
653     endef
654   endif
655
656   ifndef Package/ruby-$(1)/description
657     define Package/ruby-$(1)/description
658       This package contains the ruby $(2).
659
660     endef
661   endif
662
663   # Description
664   ifndef Package/ruby-$(1)/install
665     ifndef Package/ruby-$(1)/files
666        $$(error It must exists either a Package/ruby-$(1)/install or Package/ruby-$(1)/files)
667     endif
668
669     define Package/ruby-$(1)/description +=
670
671 Provides:
672 $(patsubst /%,
673  - /%,$(RUBY_FILES))
674
675     endef
676
677     ifneq ($(RUBY_FILES_EXCLUDED),)
678       define Package/ruby-$(1)/description +=
679
680 Except:
681 $(patsubst /%,
682  - /%,$(RUBY_FILES_EXCLUDED))
683
684       endef
685     endif
686
687     Package/ruby-$(1)/install=$(call RubyBuildPackage/install,$(1),$$(1))
688   endif
689
690   $$(eval $$(call BuildPackage,ruby-$(1)))
691 endef
692
693 $(eval $(call BuildPackage,ruby))
694 $(eval $(call BuildPackage,libruby))
695 $(eval $(call RubyBuildPackage,bigdecimal,Arbitrary-precision decimal floating-point library,))
696 $(eval $(call RubyBuildPackage,cgi,CGI support toolkit,+ruby-filelib +ruby-pstore))
697 $(eval $(call RubyBuildPackage,csv,CSV library,+ruby-patterns +ruby-datetime +ruby-enc))
698 $(eval $(call RubyBuildPackage,datetime,date library))
699 $(eval $(call RubyBuildPackage,dbm,support for dbm,+libdb47))
700 $(eval $(call RubyBuildPackage,debuglib,debug library,+ruby-multithread +ruby-prettyprint))
701 $(eval $(call RubyBuildPackage,did-you-mean,did you mean? experience,+ruby-misc))
702 $(eval $(call RubyBuildPackage,digest,Digest Library,+RUBY_DIGEST_USE_OPENSSL:libopenssl))
703 $(eval $(call RubyBuildPackage,drb,distributed object system,+ruby-filelib +ruby-patterns +ruby-socket))
704 $(eval $(call RubyBuildPackage,enc,character re-coding library charset (small subset),))
705 $(eval $(call RubyBuildPackage,enc-extra,character re-coding library charset (extra subset),+ruby-enc))
706 $(eval $(call RubyBuildPackage,erb,(embedded interpreter),+ruby-cgi))
707 $(eval $(call RubyBuildPackage,fiddle,libffi wrapper,+libffi))
708 $(eval $(call RubyBuildPackage,filelib,file utils library,+ruby-enc +ruby-misc))
709 $(eval $(call RubyBuildPackage,gdbm,support for gdbm,+libgdbm))
710 $(eval $(call RubyBuildPackage,gems,gems packet management,+ruby-net +ruby-rdoc))
711 $(eval $(call RubyBuildPackage,io-console,Console interface,))
712 $(eval $(call RubyBuildPackage,irb,(interactive shell),+ruby-debuglib +ruby-filelib +ruby-math))
713 $(eval $(call RubyBuildPackage,json,support for JSON,+ruby-datetime +ruby-misc))
714 $(eval $(call RubyBuildPackage,logger,logger and syslog library,+ruby-multithread))
715 $(eval $(call RubyBuildPackage,math,math library,+ruby-patterns))
716 $(eval $(call RubyBuildPackage,minitest,Gem minitest,+ruby-gems))
717 $(eval $(call RubyBuildPackage,misc,standard libraries subset (miscellaneous files),))
718 $(eval $(call RubyBuildPackage,mkmf,makefile library,+ruby-filelib +ruby-optparse +ruby-rbconfig))
719 $(eval $(call RubyBuildPackage,multithread,multithread library,+ruby-misc))
720 $(eval $(call RubyBuildPackage,net,Network Protocols Library,+ruby-datetime +ruby-digest +ruby-filelib +ruby-uri))
721 $(eval $(call RubyBuildPackage,net-telnet,telnet client,+ruby-net))
722 $(eval $(call RubyBuildPackage,nkf,Network Kanji Filter,+ruby-enc))
723 $(eval $(call RubyBuildPackage,openssl,support for openssl,+ruby-enc +ruby-multithread +libopenssl))
724 $(eval $(call RubyBuildPackage,optparse,command-line option analysis,+ruby-misc))
725 $(eval $(call RubyBuildPackage,patterns,design patterns implementation,+ruby-multithread))
726 $(eval $(call RubyBuildPackage,powerassert,Gem power_assert,+ruby-ripper))
727 $(eval $(call RubyBuildPackage,prettyprint,PrettyPrint library,+ruby-misc))
728 $(eval $(call RubyBuildPackage,pstore,file based persistence,+ruby-digest +ruby-enc))
729 $(eval $(call RubyBuildPackage,psych,YAML parser and emitter,+ruby-bigdecimal +ruby-datetime +ruby-misc +ruby-enc +libyaml))
730 $(eval $(call RubyBuildPackage,racc,LALR parser generator,))
731 $(eval $(call RubyBuildPackage,rake,Rake (make replacement),+ruby-datetime +ruby-filelib +ruby-optparse +ruby-patterns +ruby-rbconfig))
732 $(eval $(call RubyBuildPackage,rbconfig,RbConfig,))
733 $(eval $(call RubyBuildPackage,rdoc,documentation generator,+ruby-erb +ruby-irb +ruby-json +ruby-racc +ruby-rake +ruby-yaml +ruby-zlib))
734 $(eval $(call RubyBuildPackage,readline,support for readline,+libncurses +libreadline))
735 $(eval $(call RubyBuildPackage,rexml,XML toolkit,+ruby-patterns +ruby-enc))
736 $(eval $(call RubyBuildPackage,rinda,Linda paradigm implementation,+ruby-drb))
737 $(eval $(call RubyBuildPackage,ripper,script parser,))
738 $(eval $(call RubyBuildPackage,rss,RSS toolkit,+ruby-net +ruby-nkf +ruby-rexml))
739 $(eval $(call RubyBuildPackage,sdbm,simple file-based key-value dbm implementation,))
740 $(eval $(call RubyBuildPackage,shell,idiomatic Ruby interface,+ruby-patterns))
741 $(eval $(call RubyBuildPackage,socket,socket support,+ruby-multithread))
742 $(eval $(call RubyBuildPackage,testunit,Gem test-unit,+ruby-csv +ruby-erb +ruby-optparse +ruby-powerassert +ruby-prettyprint +ruby-rexml +ruby-yaml))
743 $(eval $(call RubyBuildPackage,unicodenormalize,String additions for Unicode normalization,+ruby-enc +ruby-enc-extra))
744 $(eval $(call RubyBuildPackage,uri,library to handle URI,+ruby-socket +ruby-enc))
745 $(eval $(call RubyBuildPackage,webrick,Web server toolkit,+ruby-erb +ruby-net +ruby-patterns +ruby-rbconfig))
746 $(eval $(call RubyBuildPackage,xmlrpc,XML-RPC toolkit,+ruby-rexml +ruby-webrick))
747 $(eval $(call RubyBuildPackage,yaml,YAML toolkit,+ruby-dbm +ruby-pstore +ruby-psych))
748 $(eval $(call RubyBuildPackage,zlib,support for zlib,+zlib))
749 $(eval $(call BuildPackage,ruby-stdlib))
750 $(eval $(call HostBuild))