2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
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:=e558a0e00ae318d43bf6ff9af452bad2
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22 include $(INCLUDE_DIR)/package.mk
24 define Package/ruby/Default
27 TITLE:=Ruby object-oriented scripting language interpreter
29 Ruby is the interpreted scripting language for quick and \\\
30 easy object-oriented programming. It has many features to \\\
31 process text files and to do system management tasks (as in \\\
32 perl). It is simple, straight-forward, and extensible.
33 URL:=http://www.ruby-lang.org/
37 $(call Package/ruby/Default)
45 define Package/libruby
48 TITLE:=Libraries necessary to run Ruby
49 URL:=http://www.ruby-lang.org/
52 # NOTE: it would be a *lot* of work to attempt to break down Ruby's
53 # standard library bundle into coherent pieces, and work out the dependencies
54 # between them. This could be useful, e.g. if you don't want to do any XML or
55 # YAML handling, why carry all that code? However, squashfs does a good
56 # job of fitting it all into flash.
57 define Package/rubylibs
58 $(call Package/ruby/Default)
60 TITLE:=Ruby standard libraries
61 URL:=http://www.ruby-lang.org/
64 # But this one is a quarter of a meg by itself
65 define Package/rubylib-nkf
66 $(call Package/ruby/Default)
68 TITLE:=Ruby Network Kanji Filter
69 URL:=http://www.ruby-lang.org/
72 # erb appears to depend only on strscan.so. Separate it?
73 define Package/ruby-erb
74 $(call Package/ruby/Default)
75 DEPENDS:=ruby +libruby +rubylibs
76 TITLE:=Embedded Ruby interpreter
77 URL:=http://www.ruby-lang.org/
80 define Package/ruby-irb
81 $(call Package/ruby/Default)
82 DEPENDS:=ruby +libruby +rubylibs
83 TITLE:=Interactive Ruby shell
84 URL:=http://www.ruby-lang.org/
87 define Package/ruby-rdoc
88 $(call Package/ruby/Default)
89 DEPENDS:=ruby +libruby +rubylibs
90 TITLE:=Ruby documentation generator
91 URL:=http://www.ruby-lang.org/
94 define Package/ruby-testrb
95 $(call Package/ruby/Default)
96 DEPENDS:=ruby +libruby +rubylibs
97 TITLE:=Ruby unit testing
98 URL:=http://www.ruby-lang.org/
105 ac_cv_func_setpgrp_void=yes
108 DESTDIR="$(PKG_INSTALL_DIR)" \
112 define Package/ruby/install
113 $(INSTALL_DIR) $(1)/usr/bin
114 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
117 define Package/libruby/install
118 $(INSTALL_DIR) $(1)/usr/lib
119 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so* $(1)/usr/lib/
122 define Package/rubylibs/install
123 $(INSTALL_DIR) $(1)/usr/lib
124 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
125 rm -f $(1)/usr/lib/ruby/1.8/erb.rb
126 rm -f $(1)/usr/lib/ruby/1.8/irb.rb
127 rm -rf $(1)/usr/lib/ruby/1.8/irb
128 rm -rf $(1)/usr/lib/ruby/1.8/rdoc
129 rm -rf $(1)/usr/lib/ruby/1.8/test
130 rm -rf $(1)/usr/lib/ruby/1.8/runit
131 rm -f $(1)/usr/lib/ruby/1.8/irb.rb
132 find $(1) -name '*.h' | xargs rm -f
133 find $(1) -name 'nkf.so' | xargs rm -f
136 define Package/rubylib-nkf/install
137 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - usr/lib/ruby/1.8/*/nkf.so ) | \
138 ( cd $(1); $(TAR) -xf - )
141 define Package/ruby-erb/install
142 $(INSTALL_DIR) $(1)/usr/bin
143 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
144 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8/
145 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/erb.rb $(1)/usr/lib/ruby/1.8/
148 define Package/ruby-irb/install
149 $(INSTALL_DIR) $(1)/usr/bin
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
151 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
152 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/irb.rb $(1)/usr/lib/ruby/1.8/
153 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/irb $(1)/usr/lib/ruby/1.8/
156 define Package/ruby-rdoc/install
157 $(INSTALL_DIR) $(1)/usr/bin
158 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
159 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
160 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
161 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rdoc $(1)/usr/lib/ruby/1.8/
164 define Package/ruby-testrb/install
165 $(INSTALL_DIR) $(1)/usr/bin
166 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
167 $(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
168 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/test $(1)/usr/lib/ruby/1.8/
169 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/runit $(1)/usr/lib/ruby/1.8/
172 $(eval $(call BuildPackage,ruby))
173 $(eval $(call BuildPackage,libruby))
174 $(eval $(call BuildPackage,rubylibs))
175 $(eval $(call BuildPackage,rubylib-nkf))
176 $(eval $(call BuildPackage,ruby-erb))
177 $(eval $(call BuildPackage,ruby-irb))
178 $(eval $(call BuildPackage,ruby-rdoc))
179 $(eval $(call BuildPackage,ruby-testrb))
181 $(eval $(call RequireCommand,ruby, \
182 $(PKG_NAME) requires ruby installed on the host-system. \