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