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