ruby: add and rework patch from candlerb adding ruby libs as suboptions, addresses ticket:2155

git-svn-id: svn://svn.openwrt.org/openwrt/packages@8284 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
pavlov 2007-07-31 19:50:56 +00:00
parent fc1d343c9b
commit 1eded88a85

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ruby
PKG_VERSION:=1.8.6
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.ruby-lang.org/pub/ruby/1.8/
@ -21,10 +21,9 @@ PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(INCLUDE_DIR)/package.mk
define Package/ruby
define Package/ruby/Default
SECTION:=lang
CATEGORY:=Languages
DEPENDS:=+libruby
TITLE:=Ruby object-oriented scripting language interpreter
DESCRIPTION:=\
Ruby is the interpreted scripting language for quick and \\\
@ -34,6 +33,15 @@ define Package/ruby
URL:=http://www.ruby-lang.org/
endef
define Package/ruby
$(call Package/ruby/Default)
DEPENDS:=+libruby
DESCRIPTION+=\\\
\\\
The ruby master.
MENU:=1
endef
define Package/libruby
SECTION:=libs
CATEGORY:=Libraries
@ -41,6 +49,55 @@ define Package/libruby
URL:=http://www.ruby-lang.org/
endef
# NOTE: it would be a *lot* of work to attempt to break down Ruby's
# standard library bundle into coherent pieces, and work out the dependencies
# between them. This could be useful, e.g. if you don't want to do any XML or
# YAML handling, why carry all that code? However, squashfs does a good
# job of fitting it all into flash.
define Package/rubylibs
$(call Package/ruby/Default)
DEPENDS:=ruby
TITLE:=Ruby standard libraries
URL:=http://www.ruby-lang.org/
endef
# But this one is a quarter of a meg by itself
define Package/rubylib-nkf
$(call Package/ruby/Default)
DEPENDS:=ruby
TITLE:=Ruby Network Kanji Filter
URL:=http://www.ruby-lang.org/
endef
# erb appears to depend only on strscan.so. Separate it?
define Package/ruby-erb
$(call Package/ruby/Default)
DEPENDS:=ruby +libruby +rubylibs
TITLE:=Embedded Ruby interpreter
URL:=http://www.ruby-lang.org/
endef
define Package/ruby-irb
$(call Package/ruby/Default)
DEPENDS:=ruby +libruby +rubylibs
TITLE:=Interactive Ruby shell
URL:=http://www.ruby-lang.org/
endef
define Package/ruby-rdoc
$(call Package/ruby/Default)
DEPENDS:=ruby +libruby +rubylibs
TITLE:=Ruby documentation generator
URL:=http://www.ruby-lang.org/
endef
define Package/ruby-testrb
$(call Package/ruby/Default)
DEPENDS:=ruby +libruby +rubylibs
TITLE:=Ruby unit testing
URL:=http://www.ruby-lang.org/
endef
CONFIGURE_ARGS += \
--enable-shared \
--disable-ipv6 \
@ -62,8 +119,64 @@ define Package/libruby/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so* $(1)/usr/lib/
endef
define Package/rubylibs/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
rm -f $(1)/usr/lib/ruby/1.8/erb.rb
rm -f $(1)/usr/lib/ruby/1.8/irb.rb
rm -rf $(1)/usr/lib/ruby/1.8/irb
rm -rf $(1)/usr/lib/ruby/1.8/rdoc
rm -rf $(1)/usr/lib/ruby/1.8/test
rm -rf $(1)/usr/lib/ruby/1.8/runit
rm -f $(1)/usr/lib/ruby/1.8/irb.rb
find $(1) -name '*.h' | xargs rm -f
find $(1) -name 'nkf.so' | xargs rm -f
endef
define Package/rubylib-nkf/install
( cd $(PKG_INSTALL_DIR); $(TAR) -cf - usr/lib/ruby/1.8/*/nkf.so ) | \
( cd $(1); $(TAR) -xf - )
endef
define Package/ruby-erb/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/lib/ruby/1.8/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/erb.rb $(1)/usr/lib/ruby/1.8/
endef
define Package/ruby-irb/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/irb.rb $(1)/usr/lib/ruby/1.8/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/irb $(1)/usr/lib/ruby/1.8/
endef
define Package/ruby-rdoc/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/rdoc $(1)/usr/lib/ruby/1.8/
endef
define Package/ruby-testrb/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/lib/ruby/1.8
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/test $(1)/usr/lib/ruby/1.8/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.8/runit $(1)/usr/lib/ruby/1.8/
endef
$(eval $(call BuildPackage,ruby))
$(eval $(call BuildPackage,libruby))
$(eval $(call BuildPackage,rubylibs))
$(eval $(call BuildPackage,rubylib-nkf))
$(eval $(call BuildPackage,ruby-erb))
$(eval $(call BuildPackage,ruby-irb))
$(eval $(call BuildPackage,ruby-rdoc))
$(eval $(call BuildPackage,ruby-testrb))
$(eval $(call RequireCommand,ruby, \
$(PKG_NAME) requires ruby installed on the host-system. \