I modified/built and tested these Packages under the current Kamikaze
8.09, both atheros/mips and x86.

rake, gems and friends are included in Ruby 1.9, so those out there who
were looking for Ruby on Rails on OpenWRT, here you go...

Regards

Daniel
#
# Copyright (C) 2006-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id$

#
# To Do:
#  - split up encodings
#  - allow selection of either native or pure version of a library where supported
#  +-> some native libraries are probably only supported if ruby-dl is enabled
# anything else?

include $(TOPDIR)/rules.mk

PKG_NAME:=ruby
PKG_VERSION:=1.9.1-p0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.ruby-lang.org/pub/ruby/1.9/
PKG_MD5SUM:=0278610ec3f895ece688de703d99143e

include $(INCLUDE_DIR)/package.mk

define Package/ruby/Default
  SUBMENU:=Ruby
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=Ruby scripting language
  URL:=http://www.ruby-lang.org/
endef

define Package/ruby/Default/description
 Ruby is the interpreted scripting language for quick and  easy 
 object-oriented programming.  It has many features to process text files 
 and to do system management tasks (as in perl).  It is simple, 
 straight-forward, and extensible.
endef

define Package/ruby
$(call Package/ruby/Default)
  TITLE+= (interpreter)
  DEPENDS:=+libruby
endef

define Package/ruby/description
$(call Package/ruby/Default/description)
endef

define Package/libruby
$(call Package/ruby/Default)
  SUBMENU:=
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE+= (shared library)
endef

# Ongoing work to break up ruby's standard library into coherent pieces
# with minimal dependencies between them

define Package/ruby-core
$(call Package/ruby/Default)
  TITLE:=Ruby standard libraries
  DEPENDS:=ruby
endef

define Package/ruby-cgi
$(call Package/ruby/Default)
  TITLE:=Ruby CGI support toolkit
  DEPENDS:=ruby
endef

define Package/ruby-dl
$(call Package/ruby/Default)
  TITLE+= (dynamic linker support) 5MB+ !!!
  DEPENDS:=ruby
endef

define Package/ruby-enc
$(call Package/ruby/Default)
  TITLE+= (character re-coding library) 2MB+ !!!
  DEPENDS:=ruby
endef

define Package/ruby-erb
$(call Package/ruby/Default)
  TITLE+= (embedded interpreter)
  DEPENDS:=ruby
endef

define Package/ruby-gdbm
$(call Package/ruby/Default)
  TITLE:=Ruby support for gdbm
  DEPENDS:=ruby +libgdbm
endef

define Package/ruby-gems
$(call Package/ruby/Default)
  TITLE:=Ruby gems packet management
  DEPENDS:=ruby +ruby-yaml +ruby-zlib +ruby-openssl +ruby-webrick +ruby-erb
endef

define Package/ruby-irb
$(call Package/ruby/Default)
  TITLE+= (interactive shell)
  DEPENDS:=ruby
endef

define Package/ruby-json
$(call Package/ruby/Default)
  TITLE:=Ruby support for JSON
  DEPENDS:=ruby
endef

define Package/ruby-ncurses
$(call Package/ruby/Default)
  TITLE:=Ruby support for ncurses
  DEPENDS:=ruby +libncurses
endef

define Package/ruby-nkf
$(call Package/ruby/Default)
  TITLE:=Ruby Network Kanji Filter
  DEPENDS:=ruby
endef

define Package/ruby-openssl
$(call Package/ruby/Default)
  TITLE:=Ruby support for openssl
  DEPENDS:=ruby +libopenssl
endef

define Package/ruby-rdoc
$(call Package/ruby/Default)
  TITLE+= (documentation generator)
  DEPENDS:=ruby
endef

define Package/ruby-rake
$(call Package/ruby/Default)
  TITLE+=Ruby Rake (make replacement)
  DEPENDS:=ruby
endef

define Package/ruby-readline
$(call Package/ruby/Default)
  TITLE:=Ruby support for readline
  DEPENDS:=ruby +libncurses +libreadline
endef

define Package/ruby-rexml
$(call Package/ruby/Default)
  TITLE:=Ruby XML toolkit
  DEPENDS:=ruby
endef

define Package/ruby-rss
$(call Package/ruby/Default)
  TITLE:=Ruby RSS toolkit
  DEPENDS:=ruby
endef

define Package/ruby-unit
$(call Package/ruby/Default)
  TITLE:=Ruby unit testing toolkit
  DEPENDS:=ruby
endef

define Package/ruby-webrick
$(call Package/ruby/Default)
  TITLE:=Ruby Web server toolkit
  DEPENDS:=ruby
endef

define Package/ruby-xmlrpc
$(call Package/ruby/Default)
  TITLE:=Ruby XML-RPC toolkit
  DEPENDS:=ruby
endef

define Package/ruby-yaml
$(call Package/ruby/Default)
  TITLE:=Ruby YAML toolkit
  DEPENDS:=ruby
endef

define Package/ruby-zlib
$(call Package/ruby/Default)
  TITLE:=Ruby support for zlib
  DEPENDS:=ruby +zlib
endef


CONFIGURE_ARGS += \
	--enable-shared \
	--enable-static \
	--disable-rpath \
	--enable-ipv6 \
	--enable-wide-getaddrinfo \

CONFIGURE_VARS += \
	ac_cv_func_setpgrp_void=yes

TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)

MAKE_FLAGS += \
	DESTDIR="$(PKG_INSTALL_DIR)" \
	SHELL="/bin/bash" \
	all install


define Package/ruby/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
endef

define Package/libruby/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
endef

define Package/ruby-core/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
	rm -rf	\
		$(1)/usr/lib/ruby/1.9.1/*/curses.so \
		\
		$(1)/usr/lib/ruby/1.9.1/*/gdbm.so \
		\
		$(1)/usr/lib/ruby/1.9.1/kconv.rb \
		$(1)/usr/lib/ruby/1.9.1/*/nkf.so \
		\
		$(1)/usr/lib/ruby/1.9.1/digest \
		$(1)/usr/lib/ruby/1.9.1/digest.rb \
		$(1)/usr/lib/ruby/1.9.1/*/digest \
		$(1)/usr/lib/ruby/1.9.1/*/digest.so \
		$(1)/usr/lib/ruby/1.9.1/openssl \
		$(1)/usr/lib/ruby/1.9.1/openssl.rb \
		$(1)/usr/lib/ruby/1.9.1/*/openssl.so \
		$(1)/usr/lib/ruby/1.9.1/drb/ssl.rb \
		$(1)/usr/lib/ruby/1.9.1/net/ftptls.rb \
		$(1)/usr/lib/ruby/1.9.1/net/https.rb \
		$(1)/usr/lib/ruby/1.9.1/net/telnets.rb \
		$(1)/usr/lib/ruby/1.9.1/webrick/ssl.rb \
		\
		$(1)/usr/lib/ruby/1.9.1/*/dl.so \
		\
		$(1)/usr/lib/ruby/1.9.1/*/enc \
		\
		$(1)/usr/lib/ruby/1.9.1/*/readline.so \
		$(1)/usr/lib/ruby/1.9.1/irb/completion.rb \
		$(1)/usr/lib/ruby/1.9.1/irb/ext/save-history.rb \
		\
		$(1)/usr/lib/ruby/1.9.1/*/zlib.so \
		\
		$(1)/usr/lib/ruby/1.9.1/erb.rb \
		\
		$(1)/usr/lib/ruby/1.9.1/json.rb \
		$(1)/usr/lib/ruby/1.9.1/json \
		$(1)/usr/lib/ruby/1.9.1/*/json \
		\
		$(1)/usr/lib/ruby/1.9.1/irb.rb \
		$(1)/usr/lib/ruby/1.9.1/irb \
		\
		$(1)/usr/lib/ruby/1.9.1/rdoc \
		\
		$(1)/usr/lib/ruby/1.9.1/rake.rb \
		$(1)/usr/lib/ruby/1.9.1/rake \
		\
		$(1)/usr/lib/ruby/1.9.1/rubygems.rb \
		$(1)/usr/lib/ruby/1.9.1/rubygems \
		\
		$(1)/usr/lib/ruby/1.9.1/cgi.rb \
		$(1)/usr/lib/ruby/1.9.1/cgi \
		\
		$(1)/usr/lib/ruby/1.9.1/rexml \
		\
		$(1)/usr/lib/ruby/1.9.1/rss \
		$(1)/usr/lib/ruby/1.9.1/rss.rb \
		\
		$(1)/usr/lib/ruby/1.9.1/test \
		\
		$(1)/usr/lib/ruby/1.9.1/webrick \
		$(1)/usr/lib/ruby/1.9.1/webrick.rb \
		\
		$(1)/usr/lib/ruby/1.9.1/xmlrpc \
		\
		$(1)/usr/lib/ruby/1.9.1/yaml \
		$(1)/usr/lib/ruby/1.9.1/yaml.rb \
		$(1)/usr/lib/ruby/1.9.1/*/syck.so \
	
	find $(1) -name '*.h' | xargs rm -f
endef

define Package/ruby-cgi/install
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/cgi $(1)/usr/lib/ruby/1.9.1/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/cgi.rb $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-dl/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/*/dl.so \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Package/ruby-enc/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/*/enc \
	) | ( 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.9.1/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/erb.rb $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-gdbm/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/*/gdbm.so \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Package/ruby-gems/install
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/rubygems.rb $(1)/usr/lib/ruby/1.9.1/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/rubygems $(1)/usr/lib/ruby/1.9.1/
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.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/irb $(1)/usr/lib/ruby/1.9.1/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/irb.rb $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-json/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/json.rb \
		usr/lib/ruby/1.9.1/json \
		usr/lib/ruby/1.9.1/*/json \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Package/ruby-ncurses/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/*/curses.so \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Package/ruby-nkf/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/kconv.rb \
		usr/lib/ruby/1.9.1/*/nkf.so \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Package/ruby-openssl/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/digest \
		usr/lib/ruby/1.9.1/digest.rb \
		usr/lib/ruby/1.9.1/*/digest.so \
		usr/lib/ruby/1.9.1/*/digest/*.so \
		usr/lib/ruby/1.9.1/openssl \
		usr/lib/ruby/1.9.1/openssl.rb \
		usr/lib/ruby/1.9.1/*/openssl.so \
		usr/lib/ruby/1.9.1/drb/ssl.rb \
		usr/lib/ruby/1.9.1/net/ftptls.rb \
		usr/lib/ruby/1.9.1/net/https.rb \
		usr/lib/ruby/1.9.1/net/telnets.rb \
		usr/lib/ruby/1.9.1/webrick/ssl.rb \
	) | ( cd $(1); $(TAR) -xf - )
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.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/rdoc $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-rake/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/rake.rb $(1)/usr/lib/ruby/1.9.1/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/rake $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-readline/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/*/readline.so \
		usr/lib/ruby/1.9.1/irb/completion.rb \
		usr/lib/ruby/1.9.1/irb/ext/save-history.rb \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Package/ruby-rexml/install
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/rexml $(1)/usr/lib/ruby/1.9.1/
endef


define Package/ruby-rss/install
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/rss $(1)/usr/lib/ruby/1.9.1/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/rss.rb $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-unit/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/test $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-webrick/install
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/webrick $(1)/usr/lib/ruby/1.9.1/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/webrick.rb $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-wsdl/install
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/wsdl $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-xmlrpc/install
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/xmlrpc $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-xsd/install
	$(INSTALL_DIR) $(1)/usr/lib/ruby/1.9.1
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/1.9.1/xsd $(1)/usr/lib/ruby/1.9.1/
endef

define Package/ruby-yaml/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/yaml \
		usr/lib/ruby/1.9.1/yaml.rb \
		usr/lib/ruby/1.9.1/*/syck.so \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Package/ruby-zlib/install
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		usr/lib/ruby/1.9.1/*/zlib.so \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Build/InstallDev
	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
		. \
	) | ( cd $(1); $(TAR) -xf - )
endef

define Build/Prepare
$(call Build/Prepare/Default)
	( cd $(PKG_BUILD_DIR) ; \
		autoconf ; \
	)
endef


$(eval $(call BuildPackage,ruby))
$(eval $(call BuildPackage,libruby))
$(eval $(call BuildPackage,ruby-core))
$(eval $(call BuildPackage,ruby-cgi))
$(eval $(call BuildPackage,ruby-dl))
$(eval $(call BuildPackage,ruby-enc))
$(eval $(call BuildPackage,ruby-erb))
$(eval $(call BuildPackage,ruby-gdbm))
$(eval $(call BuildPackage,ruby-gems))
$(eval $(call BuildPackage,ruby-json))
$(eval $(call BuildPackage,ruby-irb))
$(eval $(call BuildPackage,ruby-ncurses))
$(eval $(call BuildPackage,ruby-nkf))
$(eval $(call BuildPackage,ruby-openssl))
$(eval $(call BuildPackage,ruby-rake))
$(eval $(call BuildPackage,ruby-rdoc))
$(eval $(call BuildPackage,ruby-readline))
$(eval $(call BuildPackage,ruby-rexml))
$(eval $(call BuildPackage,ruby-rss))
$(eval $(call BuildPackage,ruby-unit))
$(eval $(call BuildPackage,ruby-webrick))
$(eval $(call BuildPackage,ruby-xmlrpc))
$(eval $(call BuildPackage,ruby-yaml))
$(eval $(call BuildPackage,ruby-zlib))
diff -u ruby-1.9.1-p0.orig/configure.in ruby-1.9.1-p0/configure.in
--- ruby-1.9.1-p0.orig/configure.in	2009-01-29 17:14:18.000000000 +0000
+++ ruby-1.9.1-p0/configure.in	2009-03-30 17:11:35.000000000 +0100
@@ -190,7 +190,7 @@
 test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
 if test "$GCC" = yes; then
     linker_flag=-Wl,
-    : ${optflags=-O2} ${warnflags="-Wall -Wno-parentheses"}
+    : ${optflags=-Os} ${warnflags="-Wall -Wno-parentheses"}
 else
     linker_flag=
 fi
# Copyright (C) 2008 FON Wireless Ltd.
# mofified by Daniel Golle for the Makrotopia Project
# All rights reserved.
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk

PKG_NAME:=sqlite3-ruby
PKG_VERSION:=1.2.4
PKG_RELEASE:=1
PKG_FIXUP:=libtool

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://rubyforge.org/frs/download.php/42056/$(PKG_SOURCE)
PKG_MD5SUM:=b7bd0e31ee261014535f05deda704acf

RUBYVERSION:=`basename $(STAGING_DIR)/usr/lib/ruby/site_ruby/*`
RUBYARCH:=`basename \`dirname $(STAGING_DIR)/usr/lib/ruby/*/*/rbconfig.rb\``

include $(INCLUDE_DIR)/package.mk

define Package/sqlite3-ruby
  SUBMENU:=Ruby
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=SQLite3 bindings for Ruby
  URL:=http://sqlite-ruby.rubyforge.org/
  DEPENDS:=ruby +libsqlite3
endef

define Package/sqlite3-ruby/description
  Ruby bindings for the SQLite3 database engine
endef


define Build/Configure
	cd "$(PKG_BUILD_DIR)/ext/sqlite3_api" && ruby -I "`dirname $(STAGING_DIR)/usr/lib/ruby/*/*/rbconfig.rb`" extconf.rb 
endef

define Build/Compile
	cd "$(PKG_BUILD_DIR)/ext/sqlite3_api" && $(MAKE)
endef

define Package/sqlite3-ruby/install
	mkdir -p $(1)/usr/lib/ruby/site_ruby/$(RUBYVERSION)/$(RUBYARCH) && \
	cp -v "$(PKG_BUILD_DIR)/ext/sqlite3_api"/*.so $(1)/usr/lib/ruby/site_ruby/$(RUBYVERSION)/$(RUBYARCH) && \
	mkdir -p $(1)/usr/lib/ruby/site_ruby/$(RUBYVERSION)/sqlite3 && \
	( cd $(PKG_BUILD_DIR)/lib; $(TAR) --exclude ._\* -cf - \
		*.rb \
		sqlite3/*.rb \
		sqlite3/driver/native/*.rb \
	) | ( cd $(1)/usr/lib/ruby/site_ruby/$(RUBYVERSION); $(TAR) -xf - )
endef

$(eval $(call BuildPackage,sqlite3-ruby))
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to