# $FreeWRT$
#-
# This file is part of the FreeWRT project. FreeWRT is copyrighted
# material, please see the LICENCE file in the top-level directory
# or at http://www.freewrt.org/licence for details.

# == Doc
# * http://wiki.rubygarden.org/Ruby/page/show/RubyOnUCLinux

include ${TOPDIR}/rules.mk

PKG_NAME:=		ruby
PKG_VERSION:=		1.8.5-p12
PKG_RELEASE:=		1
PKG_MD5SUM:=		d7d12dd9124c9b7d55cdbbee313e3931
PKG_SOURCE_URL:=	http://ftp.ruby-lang.org/pub/ruby

include ${TOPDIR}/mk/package.mk

#PKG_DEPEND:="woot?"

$(eval $(call PKG_template,RUBY,ruby,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))

CONFIGURE_STYLE:=	gnu
# Fix for ./configure
CONFIGURE_ENV+=         ac_cv_func_setpgrp_void=yes
#CONFIGURE_ARGS+=	--disable-threads

BUILD_STYLE:=		auto
INSTALL_STYLE:=		auto

# Enable some ruby extension / options
post-configure:
	echo "option nodynamic" > ${WRKBUILD}/ext/Setup
	echo "socket" >> ${WRKBUILD}/ext/Setup

# Remove the /usr/lib/libruby.so and keep the static (~1M) ?
post-install:
	rm -rf ${WRKINST}/usr/lib/site_ruby
	find ${WRKINST}/usr -name "*.h" -delete
	cp -a ${WRKINST}/usr ${IDIR_RUBY}

include ${TOPDIR}/mk/pkg-bottom.mk

