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