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