2345c86af0b9f6504fd51e77ae1b91ff85654678
[openwrt/svn-archive/archive.git] / lang / ruby / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 #
10 # To Do:
11 # - split up encodings
12 # - allow selection of either native or pure version of a library where supported
13 # +-> some native libraries are probably only supported if ruby-dl is enabled
14 # anything else?
15
16 include $(TOPDIR)/rules.mk
17
18 PKG_NAME:=ruby
19 PKG_LIBVER:=1.9.1
20 PKG_VERSION:=$(PKG_LIBVER)-p243
21 PKG_RELEASE:=1
22
23 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
24 PKG_SOURCE_URL:=ftp://ftp.ruby-lang.org/pub/ruby/1.9/
25 PKG_MD5SUM:=66d4f8403d13623051091347764881a0
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 endef
64
65 # Ongoing work to break up ruby's standard library into coherent pieces
66 # with minimal dependencies between them
67
68 define Package/ruby-core
69 $(call Package/ruby/Default)
70 TITLE:=Ruby standard libraries
71 DEPENDS:=ruby
72 endef
73
74 define Package/ruby-cgi
75 $(call Package/ruby/Default)
76 TITLE:=Ruby CGI support toolkit
77 DEPENDS:=ruby
78 endef
79
80 define Package/ruby-dl
81 $(call Package/ruby/Default)
82 TITLE+= (dynamic linker support) (adds 5MB+)
83 DEPENDS:=ruby
84 endef
85
86 define Package/ruby-enc
87 $(call Package/ruby/Default)
88 TITLE+= (character re-coding library) (adds 2MB+)
89 DEPENDS:=ruby
90 endef
91
92 define Package/ruby-erb
93 $(call Package/ruby/Default)
94 TITLE+= (embedded interpreter)
95 DEPENDS:=ruby
96 endef
97
98 define Package/ruby-gdbm
99 $(call Package/ruby/Default)
100 TITLE:=Ruby support for gdbm
101 DEPENDS:=ruby +libgdbm
102 endef
103
104 define Package/ruby-gems
105 $(call Package/ruby/Default)
106 TITLE:=Ruby gems packet management
107 DEPENDS:=ruby +ruby-yaml +ruby-zlib +ruby-openssl +ruby-webrick +ruby-erb
108 endef
109
110 define Package/ruby-irb
111 $(call Package/ruby/Default)
112 TITLE+= (interactive shell)
113 DEPENDS:=ruby +ruby-core
114 endef
115
116 define Package/ruby-json
117 $(call Package/ruby/Default)
118 TITLE:=Ruby support for JSON
119 DEPENDS:=ruby
120 endef
121
122 define Package/ruby-ncurses
123 $(call Package/ruby/Default)
124 TITLE:=Ruby support for ncurses
125 DEPENDS:=ruby +libncurses
126 endef
127
128 define Package/ruby-nkf
129 $(call Package/ruby/Default)
130 TITLE:=Ruby Network Kanji Filter
131 DEPENDS:=ruby
132 endef
133
134 define Package/ruby-openssl
135 $(call Package/ruby/Default)
136 TITLE:=Ruby support for openssl
137 DEPENDS:=ruby +libopenssl
138 endef
139
140 define Package/ruby-rdoc
141 $(call Package/ruby/Default)
142 TITLE+= (documentation generator)
143 DEPENDS:=ruby
144 endef
145
146 define Package/ruby-rake
147 $(call Package/ruby/Default)
148 TITLE+=Ruby Rake (make replacement)
149 DEPENDS:=ruby
150 endef
151
152 define Package/ruby-readline
153 $(call Package/ruby/Default)
154 TITLE:=Ruby support for readline
155 DEPENDS:=ruby +libncurses +libreadline
156 endef
157
158 define Package/ruby-rexml
159 $(call Package/ruby/Default)
160 TITLE:=Ruby XML toolkit
161 DEPENDS:=ruby
162 endef
163
164 define Package/ruby-rss
165 $(call Package/ruby/Default)
166 TITLE:=Ruby RSS toolkit
167 DEPENDS:=ruby
168 endef
169
170 define Package/ruby-unit
171 $(call Package/ruby/Default)
172 TITLE:=Ruby unit testing toolkit
173 DEPENDS:=ruby
174 endef
175
176 define Package/ruby-webrick
177 $(call Package/ruby/Default)
178 TITLE:=Ruby Web server toolkit
179 DEPENDS:=ruby
180 endef
181
182 define Package/ruby-xmlrpc
183 $(call Package/ruby/Default)
184 TITLE:=Ruby XML-RPC toolkit
185 DEPENDS:=ruby
186 endef
187
188 define Package/ruby-yaml
189 $(call Package/ruby/Default)
190 TITLE:=Ruby YAML toolkit
191 DEPENDS:=ruby
192 endef
193
194 define Package/ruby-zlib
195 $(call Package/ruby/Default)
196 TITLE:=Ruby support for zlib
197 DEPENDS:=ruby +zlib
198 endef
199
200
201 CONFIGURE_ARGS += \
202 --enable-shared \
203 --enable-static \
204 --disable-rpath \
205 --enable-ipv6 \
206 --enable-wide-getaddrinfo \
207
208 CONFIGURE_VARS += \
209 ac_cv_func_setpgrp_void=yes
210
211 TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
212
213 MAKE_FLAGS += \
214 DESTDIR="$(PKG_INSTALL_DIR)" \
215 SHELL="/bin/bash" \
216 all install
217
218 define Package/ruby/install
219 $(INSTALL_DIR) $(1)/usr/bin
220 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
221 endef
222
223 define Package/libruby/install
224 $(INSTALL_DIR) $(1)/usr/lib
225 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
226 endef
227
228 define Package/ruby-core/install
229 $(INSTALL_DIR) $(1)/usr/lib
230 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
231 rm -rf \
232 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
233 \
234 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
235 \
236 $(1)/usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
237 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
238 \
239 $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest \
240 $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
241 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest \
242 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
243 $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl \
244 $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
245 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
246 $(1)/usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
247 $(1)/usr/lib/ruby/$(PKG_LIBVER)/net/ftptls.rb \
248 $(1)/usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
249 $(1)/usr/lib/ruby/$(PKG_LIBVER)/net/telnets.rb \
250 $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick/ssl.rb \
251 \
252 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
253 \
254 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/enc \
255 \
256 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
257 $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/completion.rb \
258 $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/ext/save-history.rb \
259 \
260 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
261 \
262 $(1)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb \
263 \
264 $(1)/usr/lib/ruby/$(PKG_LIBVER)/json.rb \
265 $(1)/usr/lib/ruby/$(PKG_LIBVER)/json \
266 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/json \
267 \
268 $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb \
269 $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb \
270 \
271 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rdoc \
272 \
273 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb \
274 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake \
275 \
276 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb \
277 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems \
278 \
279 $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb \
280 $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi \
281 \
282 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rexml \
283 \
284 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss \
285 $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb \
286 \
287 $(1)/usr/lib/ruby/$(PKG_LIBVER)/test \
288 \
289 $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick \
290 $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb \
291 \
292 $(1)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc \
293 \
294 $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml \
295 $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
296 $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
297
298 find $(1) -name '*.h' | xargs rm -f
299 endef
300
301 define Package/ruby-cgi/install
302 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
303 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi $(1)/usr/lib/ruby/$(PKG_LIBVER)/
304 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
305 endef
306
307 define Package/ruby-dl/install
308 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
309 usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
310 ) | ( cd $(1); $(TAR) -xf - )
311 endef
312
313 define Package/ruby-enc/install
314 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
315 usr/lib/ruby/$(PKG_LIBVER)/*/enc \
316 ) | ( cd $(1); $(TAR) -xf - )
317 endef
318
319 define Package/ruby-erb/install
320 $(INSTALL_DIR) $(1)/usr/bin
321 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
322 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)/
323 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
324 endef
325
326 define Package/ruby-gdbm/install
327 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
328 usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
329 ) | ( cd $(1); $(TAR) -xf - )
330 endef
331
332 define Package/ruby-gems/install
333 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
334 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
335 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems $(1)/usr/lib/ruby/$(PKG_LIBVER)/
336 endef
337
338 define Package/ruby-irb/install
339 $(INSTALL_DIR) $(1)/usr/bin
340 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
341 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
342 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
343 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
344 endef
345
346 define Package/ruby-json/install
347 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
348 usr/lib/ruby/$(PKG_LIBVER)/json.rb \
349 usr/lib/ruby/$(PKG_LIBVER)/json \
350 usr/lib/ruby/$(PKG_LIBVER)/*/json \
351 ) | ( cd $(1); $(TAR) -xf - )
352 endef
353
354 define Package/ruby-ncurses/install
355 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
356 usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
357 ) | ( cd $(1); $(TAR) -xf - )
358 endef
359
360 define Package/ruby-nkf/install
361 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
362 usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
363 usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
364 ) | ( cd $(1); $(TAR) -xf - )
365 endef
366
367 define Package/ruby-openssl/install
368 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
369 usr/lib/ruby/$(PKG_LIBVER)/digest \
370 usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
371 usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
372 usr/lib/ruby/$(PKG_LIBVER)/*/digest/*.so \
373 usr/lib/ruby/$(PKG_LIBVER)/openssl \
374 usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
375 usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
376 usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
377 usr/lib/ruby/$(PKG_LIBVER)/net/ftptls.rb \
378 usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
379 usr/lib/ruby/$(PKG_LIBVER)/net/telnets.rb \
380 usr/lib/ruby/$(PKG_LIBVER)/webrick/ssl.rb \
381 ) | ( cd $(1); $(TAR) -xf - )
382 endef
383
384 define Package/ruby-rdoc/install
385 $(INSTALL_DIR) $(1)/usr/bin
386 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
387 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
388 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
389 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rdoc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
390 endef
391
392 define Package/ruby-rake/install
393 $(INSTALL_DIR) $(1)/usr/bin
394 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/
395 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
396 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
397 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake $(1)/usr/lib/ruby/$(PKG_LIBVER)/
398 endef
399
400 define Package/ruby-readline/install
401 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
402 usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
403 usr/lib/ruby/$(PKG_LIBVER)/irb/completion.rb \
404 usr/lib/ruby/$(PKG_LIBVER)/irb/ext/save-history.rb \
405 ) | ( cd $(1); $(TAR) -xf - )
406 endef
407
408 define Package/ruby-rexml/install
409 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
410 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rexml $(1)/usr/lib/ruby/$(PKG_LIBVER)/
411 endef
412
413
414 define Package/ruby-rss/install
415 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
416 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss $(1)/usr/lib/ruby/$(PKG_LIBVER)/
417 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
418 endef
419
420 define Package/ruby-unit/install
421 $(INSTALL_DIR) $(1)/usr/bin
422 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
423 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
424 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/test $(1)/usr/lib/ruby/$(PKG_LIBVER)/
425 endef
426
427 define Package/ruby-webrick/install
428 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
429 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick $(1)/usr/lib/ruby/$(PKG_LIBVER)/
430 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
431 endef
432
433 define Package/ruby-xmlrpc/install
434 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
435 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
436 endef
437
438 define Package/ruby-yaml/install
439 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
440 usr/lib/ruby/$(PKG_LIBVER)/yaml \
441 usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
442 usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
443 ) | ( cd $(1); $(TAR) -xf - )
444 endef
445
446 define Package/ruby-zlib/install
447 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
448 usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
449 ) | ( cd $(1); $(TAR) -xf - )
450 endef
451
452 define Build/InstallDev
453 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
454 . \
455 ) | ( cd $(1); $(TAR) -xf - )
456 endef
457
458 define Build/Prepare
459 $(call Build/Prepare/Default)
460 ( cd $(PKG_BUILD_DIR) ; \
461 autoconf ; \
462 )
463 endef
464
465
466 $(eval $(call BuildPackage,ruby))
467 $(eval $(call BuildPackage,libruby))
468 $(eval $(call BuildPackage,ruby-core))
469 $(eval $(call BuildPackage,ruby-cgi))
470 $(eval $(call BuildPackage,ruby-dl))
471 $(eval $(call BuildPackage,ruby-enc))
472 $(eval $(call BuildPackage,ruby-erb))
473 $(eval $(call BuildPackage,ruby-gdbm))
474 $(eval $(call BuildPackage,ruby-gems))
475 $(eval $(call BuildPackage,ruby-json))
476 $(eval $(call BuildPackage,ruby-irb))
477 $(eval $(call BuildPackage,ruby-ncurses))
478 $(eval $(call BuildPackage,ruby-nkf))
479 $(eval $(call BuildPackage,ruby-openssl))
480 $(eval $(call BuildPackage,ruby-rake))
481 $(eval $(call BuildPackage,ruby-rdoc))
482 $(eval $(call BuildPackage,ruby-readline))
483 $(eval $(call BuildPackage,ruby-rexml))
484 $(eval $(call BuildPackage,ruby-rss))
485 $(eval $(call BuildPackage,ruby-unit))
486 $(eval $(call BuildPackage,ruby-webrick))
487 $(eval $(call BuildPackage,ruby-xmlrpc))
488 $(eval $(call BuildPackage,ruby-yaml))
489 $(eval $(call BuildPackage,ruby-zlib))
490 $(eval $(call HostBuild))