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