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