debian swirl logo

Back to the packages list jruby

#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/ant.mk

JAVA_HOME            := /usr/lib/jvm/default-java
DEB_ANT_CLEAN_TARGET := clean-all
DEB_ANT_BUILD_TARGET := -Ddev.gems=false -DdocsNotNeeded=true \
    -Dshared.lib.dir=/usr/share/java test dist-bin
DEB_JARS             := ant-junit junit4
UVERSION             := $(shell dpkg-parsechangelog | grep ^Version: | sed 's/^.*: \(.*\)-\(.*\)$$/\1/')

# must be set to avoid test failures
export BUILDING_JRUBY := true

clean::
		$(RM) lib/ruby/site_ruby/shared/yecht.jar debian/stamp-yecht
	# strange workaround for dpkg-source
		$(RM) bin/jruby
		rm -f test/testapp/testapp
		mh_clean

pre-build:: debian/stamp-yecht
debian/stamp-yecht:
	# symlink system yecht-ruby jar into shared directory
		ln -s /usr/share/java/yecht-ruby.jar lib/ruby/site_ruby/shared/yecht.jar
		touch $@

JRUBY_LIB_DIR := $(DEB_DESTDIR)/usr/lib/jruby

install/jruby::
		tar -z -x -f dist/jruby-bin-*.tar.gz --strip 1 -C $(JRUBY_LIB_DIR)
	# Remove all of the VCS directories
		find $(JRUBY_LIB_DIR) -name '.svn'  -delete
		find $(JRUBY_LIB_DIR) -name '.git*' -delete
		find $(JRUBY_LIB_DIR) -name '*.bat' -delete
	# remove extra docs
		$(RM) -r $(JRUBY_LIB_DIR)/docs $(JRUBY_LIB_DIR)/COPYING* $(JRUBY_LIB_DIR)/LICENSE.RUBY
	# remove libjnidispatch.so, to keep the package 
	# architecture-independent; will put it in itw own
	# separate package later on, if need be.
		$(RM) -r $(JRUBY_LIB_DIR)/lib/native
	# Remove all empty directories
		find $(DEB_DESTDIR) -depth -follow -type d -empty -delete
		mh_installpoms -pjruby
		mh_installjar -pjruby --java-lib maven/jruby/pom.xml $(JRUBY_LIB_DIR)/lib/jruby.jar
		rm -f $(DEB_DESTDIR)/usr/share/java/jruby*.jar
		dh_link usr/share/java/jruby.jar usr/share/java/jruby-$(UVERSION).jar

Builds:

jruby
100% pure-java implementation of ruby