update ruby to 1.8.6-p36 (closes: #2254), add uClibc stdio fix (closes: #2286), repla...
[packages.git] / lang / ruby / Makefile
1 #
2 # Copyright (C) 2006 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 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=ruby
12 PKG_VERSION:=1.8.6-p36
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.ruby-lang.org/pub/ruby/1.8/
17 PKG_MD5SUM:=eb7f25818cb6993839b38d1f21bd4ea1
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/ruby/Default
25   SUBMENU:=Ruby
26   SECTION:=lang
27   CATEGORY:=Languages
28   TITLE:=Ruby scripting language
29   URL:=http://www.ruby-lang.org/
30 endef
31
32 define Package/ruby/Default/description
33  Ruby is the interpreted scripting language for quick and  easy 
34  object-oriented programming.  It has many features to process text files 
35  and to do system management tasks (as in perl).  It is simple, 
36  straight-forward, and extensible.
37 endef
38
39 define Package/ruby
40 $(call Package/ruby/Default)
41   TITLE+= (interpreter)
42   DEPENDS:=+libruby
43 endef
44
45 define Package/ruby/description
46 $(call Package/ruby/Default/description)
47 endef
48
49 define Package/libruby
50 $(call Package/ruby/Default)
51   SUBMENU:=
52   SECTION:=libs
53   CATEGORY:=Libraries
54   TITLE+= (shared library)
55 endef
56
57
58 # NOTE: it would be a *lot* of work to attempt to break down Ruby's
59 # standard library bundle into coherent pieces, and work out the dependencies
60 # between them. This could be useful, e.g. if you don't want to do any XML or
61 # YAML handling, why carry all that code? However, squashfs does a good
62 # job of fitting it all into flash.
63
64 define Package/ruby-core
65 $(call Package/ruby/Default)
66   TITLE:=Ruby standard libraries
67   DEPENDS:=ruby
68 endef
69
70 define Package/ruby-cgi
71 $(call Package/ruby/Default)
72   TITLE:= Ruby CGI support toolkit
73   DEPENDS:=ruby
74 endef
75
76 define Package/ruby-erb
77 $(call Package/ruby/Default)
78   TITLE+= (embedded interpreter)
79   DEPENDS:=ruby
80 endef
81
82 define Package/ruby-gdbm
83 $(call Package/ruby/Default)
84   TITLE:=Ruby support for gdbm
85   DEPENDS:=ruby +libgdbm
86 endef
87
88 define Package/ruby-irb
89 $(call Package/ruby/Default)
90   TITLE+= (interactive shell)
91   DEPENDS:=ruby
92 endef
93
94 define Package/ruby-ncurses
95 $(call Package/ruby/Default)
96   TITLE:=Ruby support for ncurses
97   DEPENDS:=ruby +libncurses
98 endef
99
100 define Package/ruby-nkf
101 $(call Package/ruby/Default)
102   TITLE:=Ruby Network Kanji Filter
103   DEPENDS:=ruby
104 endef
105
106 define Package/ruby-openssl
107 $(call Package/ruby/Default)
108   TITLE:=Ruby support for openssl
109   DEPENDS:=ruby +libopenssl
110 endef
111
112 define Package/ruby-rdoc
113 $(call Package/ruby/Default)
114   TITLE+= (documentation generator)
115   DEPENDS:=ruby
116 endef
117
118 define Package/ruby-readline
119 $(call Package/ruby/Default)
120   TITLE:=Ruby support for readline
121   DEPENDS:=ruby +libncurses +libreadline
122 endef
123
124 define Package/ruby-rexml
125 $(call Package/ruby/Default)
126   TITLE:=Ruby XML toolkit
127   DEPENDS:=ruby
128 endef
129
130 define Package/ruby-rss
131 $(call Package/ruby/Default)
132   TITLE:=Ruby RSS toolkit
133   DEPENDS:=ruby
134 endef
135
136 define Package/ruby-soap
137 $(call Package/ruby/Default)
138   TITLE:=Ruby SOAP toolkit
139   DEPENDS:=ruby
140 endef
141
142 define Package/ruby-unit
143 $(call Package/ruby/Default)
144   TITLE:=Ruby unit testing toolkit
145   DEPENDS:=ruby
146 endef
147
148 define Package/ruby-webrick
149 $(call Package/ruby/Default)
150   TITLE:=Ruby Web server toolkit
151   DEPENDS:=ruby
152 endef
153
154 define Package/ruby-wsdl
155 $(call Package/ruby/Default)
156   TITLE:=Ruby WSDL 1.1 toolkit
157   DEPENDS:=ruby
158 endef
159
160 define Package/ruby-xmlrpc
161 $(call Package/ruby/Default)
162   TITLE:=Ruby XML-RPC toolkit
163   DEPENDS:=ruby
164 endef
165
166 define Package/ruby-xsd
167 $(call Package/ruby/Default)
168   TITLE:=Ruby XML Schema Datatypes toolkit
169   DEPENDS:=ruby
170 endef
171
172 define Package/ruby-yaml
173 $(call Package/ruby/Default)
174   TITLE:=Ruby YAML toolkit
175   DEPENDS:=ruby
176 endef
177
178 define Package/ruby-zlib
179 $(call Package/ruby/Default)
180   TITLE:=Ruby support for zlib
181   DEPENDS:=ruby +zlib
182 endef
183
184
185 CONFIGURE_ARGS += \
186         --enable-shared \
187         --enable-static \
188         --disable-rpath \
189         --disable-ipv6 \
190
191 CONFIGURE_VARS += \
192         ac_cv_func_setpgrp_void=yes \
193
194 MAKE_FLAGS += \
195         DESTDIR="$(PKG_INSTALL_DIR)" \
196         SHELL="/bin/bash" \
197         all install
198
199 define Package/ruby/install
200         $(INSTALL_DIR) $(1)/usr/bin
201         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
202 endef
203
204 define Package/libruby/install
205         $(INSTALL_DIR) $(1)/usr/lib
206         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
207 endef
208
209 define Package/ruby-core/install
210         $(INSTALL_DIR) $(1)/usr/lib
211         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
212         rm -rf  \
213                 $(1)/usr/lib/ruby/1.8/*/curses.so \
214                 \
215                 $(1)/usr/lib/ruby/1.8/*/gdbm.so \
216                 \
217                 $(1)/usr/lib/ruby/1.8/*/nkf.so \
218                 \
219                 $(1)/usr/lib/ruby/1.8/digest \
220                 $(1)/usr/lib/ruby/1.8/digest.rb \
221                 $(1)/usr/lib/ruby/1.8/*/digest \
222                 $(1)/usr/lib/ruby/1.8/*/digest.so \
223                 $(1)/usr/lib/ruby/1.8/openssl \
224                 $(1)/usr/lib/ruby/1.8/openssl.rb \
225                 $(1)/usr/lib/ruby/1.8/*/openssl.so \
226                 $(1)/usr/lib/ruby/1.8/md5.rb \
227                 $(1)/usr/lib/ruby/1.8/rmd160.rb \
228                 $(1)/usr/lib/ruby/1.8/sha1.rb \
229                 $(1)/usr/lib/ruby/1.8/sha2.rb \
230                 \
231                 $(1)/usr/lib/ruby/1.8/*/readline.so \
232                 \
233                 $(1)/usr/lib/ruby/1.8/*/zlib.so \
234                 \
235                 $(1)/usr/lib/ruby/1.8/erb.rb \
236                 \
237                 $(1)/usr/lib/ruby/1.8/irb.rb \
238                 $(1)/usr/lib/ruby/1.8/irb \
239                 \
240                 $(1)/usr/lib/ruby/1.8/rdoc \
241                 \
242                 $(1)/usr/lib/ruby/1.8/cgi \
243                 $(1)/usr/lib/ruby/1.8/cgi.rb \
244                 $(1)/usr/lib/ruby/1.8/cgi-lib.rb \
245                 \
246                 $(1)/usr/lib/ruby/1.8/rexml \
247                 \
248                 $(1)/usr/lib/ruby/1.8/rss \
249                 $(1)/usr/lib/ruby/1.8/rss.rb \
250                 \
251                 $(1)/usr/lib/ruby/1.8/soap \
252                 \
253                 $(1)/usr/lib/ruby/1.8/rubyunit.rb \
254                 $(1)/usr/lib/ruby/1.8/runit \
255                 $(1)/usr/lib/ruby/1.8/test \
256                 \
257                 $(1)/usr/lib/ruby/1.8/webrick \
258                 $(1)/usr/lib/ruby/1.8/webrick.rb \
259                 \
260                 $(1)/usr/lib/ruby/1.8/wsdl \
261                 \
262                 $(1)/usr/lib/ruby/1.8/xmlrpc \
263                 \
264                 $(1)/usr/lib/ruby/1.8/xsd \
265                 \
266                 $(1)/usr/lib/ruby/1.8/yaml \
267                 $(1)/usr/lib/ruby/1.8/yaml.rb \
268                 
269         find $(1) -name '*.h' | xargs rm -f
270 endef
271
272 define Package/ruby-cgi/install
273         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
274         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/cgi $(1)/usr/lib/ruby/1.8/
275         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/cgi.rb $(1)/usr/lib/ruby/1.8/
276         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/cgi-lib.rb $(1)/usr/lib/ruby/1.8/
277 endef
278
279 define Package/ruby-erb/install
280         $(INSTALL_DIR) $(1)/usr/bin
281         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
282         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8/
283         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/erb.rb $(1)/usr/lib/ruby/1.8/
284 endef
285
286 define Package/ruby-gdbm/install
287         ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
288                 usr/lib/ruby/1.8/*/gdbm.so \
289         ) | ( cd $(1); $(TAR) -xf - )
290 endef
291
292 define Package/ruby-irb/install
293         $(INSTALL_DIR) $(1)/usr/bin
294         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
295         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
296         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/irb $(1)/usr/lib/ruby/1.8/
297         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/irb.rb $(1)/usr/lib/ruby/1.8/
298 endef
299
300 define Package/ruby-ncurses/install
301         ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
302                 usr/lib/ruby/1.8/*/curses.so \
303         ) | ( cd $(1); $(TAR) -xf - )
304 endef
305
306 define Package/ruby-nkf/install
307         ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
308                 usr/lib/ruby/1.8/*/nkf.so \
309         ) | ( cd $(1); $(TAR) -xf - )
310 endef
311
312 define Package/ruby-openssl/install
313         ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
314                 usr/lib/ruby/1.8/digest \
315                 usr/lib/ruby/1.8/digest.rb \
316                 usr/lib/ruby/1.8/*/digest.so \
317                 usr/lib/ruby/1.8/*/digest/*.so \
318                 usr/lib/ruby/1.8/openssl \
319                 usr/lib/ruby/1.8/openssl.rb \
320                 usr/lib/ruby/1.8/*/openssl.so \
321                 usr/lib/ruby/1.8/md5.rb \
322                 usr/lib/ruby/1.8/rmd160.rb \
323                 usr/lib/ruby/1.8/sha1.rb \
324                 usr/lib/ruby/1.8/sha2.rb \
325         ) | ( cd $(1); $(TAR) -xf - )
326 endef
327
328 define Package/ruby-rdoc/install
329         $(INSTALL_DIR) $(1)/usr/bin
330         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
331         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
332         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
333         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rdoc $(1)/usr/lib/ruby/1.8/
334 endef
335
336 define Package/ruby-readline/install
337         ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
338                 usr/lib/ruby/1.8/*/readline.so \
339         ) | ( cd $(1); $(TAR) -xf - )
340 endef
341
342 define Package/ruby-rexml/install
343         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
344         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rexml $(1)/usr/lib/ruby/1.8/
345 endef
346
347 define Package/ruby-rss/install
348         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
349         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rss $(1)/usr/lib/ruby/1.8/
350         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rss.rb $(1)/usr/lib/ruby/1.8/
351 endef
352
353 define Package/ruby-soap/install
354         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
355         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/soap $(1)/usr/lib/ruby/1.8/
356 endef
357
358 define Package/ruby-unit/install
359         $(INSTALL_DIR) $(1)/usr/bin
360         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
361         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
362         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rubyunit.rb $(1)/usr/lib/ruby/1.8/
363         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/runit $(1)/usr/lib/ruby/1.8/
364         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/test $(1)/usr/lib/ruby/1.8/
365 endef
366
367 define Package/ruby-webrick/install
368         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
369         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/webrick $(1)/usr/lib/ruby/1.8/
370         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/webrick.rb $(1)/usr/lib/ruby/1.8/
371 endef
372
373 define Package/ruby-wsdl/install
374         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
375         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/wsdl $(1)/usr/lib/ruby/1.8/
376 endef
377
378 define Package/ruby-xmlrpc/install
379         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
380         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/xmlrpc $(1)/usr/lib/ruby/1.8/
381 endef
382
383 define Package/ruby-xsd/install
384         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
385         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/xsd $(1)/usr/lib/ruby/1.8/
386 endef
387
388 define Package/ruby-yaml/install
389         $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
390         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/yaml $(1)/usr/lib/ruby/1.8/
391         $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/yaml.rb $(1)/usr/lib/ruby/1.8/
392 endef
393
394 define Package/ruby-zlib/install
395         ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
396                 usr/lib/ruby/1.8/*/zlib.so \
397         ) | ( cd $(1); $(TAR) -xf - )
398 endef
399
400 $(eval $(call BuildPackage,ruby))
401 $(eval $(call BuildPackage,libruby))
402 $(eval $(call BuildPackage,ruby-core))
403 $(eval $(call BuildPackage,ruby-cgi))
404 $(eval $(call BuildPackage,ruby-erb))
405 $(eval $(call BuildPackage,ruby-gdbm))
406 $(eval $(call BuildPackage,ruby-irb))
407 $(eval $(call BuildPackage,ruby-ncurses))
408 $(eval $(call BuildPackage,ruby-nkf))
409 $(eval $(call BuildPackage,ruby-openssl))
410 $(eval $(call BuildPackage,ruby-rdoc))
411 $(eval $(call BuildPackage,ruby-readline))
412 $(eval $(call BuildPackage,ruby-rexml))
413 $(eval $(call BuildPackage,ruby-rss))
414 $(eval $(call BuildPackage,ruby-soap))
415 $(eval $(call BuildPackage,ruby-unit))
416 $(eval $(call BuildPackage,ruby-webrick))
417 $(eval $(call BuildPackage,ruby-wsdl))
418 $(eval $(call BuildPackage,ruby-xmlrpc))
419 $(eval $(call BuildPackage,ruby-xsd))
420 $(eval $(call BuildPackage,ruby-yaml))
421 $(eval $(call BuildPackage,ruby-zlib))
422
423 $(eval $(call RequireCommand,ruby, \
424         $(PKG_NAME) requires ruby installed on the host-system. \
425 ))
426