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