#!/bin/sh
#
# Rhino package is broken on Ubuntu Feisty, this builds the .deb correctly
# See: https://bugs.launchpad.net/ubuntu/+source/rhino/+bug/93885

RHINO_VERSION=1.6.R5

## Install package building dependencies:
sudo apt-get install fakeroot debhelper cdbs java-gcj-compat-dev
sudo apt-get build-dep rhino

## Get the source:
apt-get source rhino

## Revert the toolsrc patch:
cd rhino-${RHINO_VERSION}/
rm debian/patches/02-dont_build-toolsrc.patch

## Build:
dpkg-buildpackage -rfakeroot

## Install:
cd ..
sudo dpkg -i rhino_${RHINO_VERSION}-0ubuntu1_all.deb

