1#!/bin/bash -v 2 3usage() { 4 echo "usage: $0 <bittedness> <SVN revision> <build number>" 5 echo "" 6} 7 8die() { 9 usage 10 echo "failed: $@" 11 exit 1 12} 13 14BITS="$1"; shift 15REVISION="$1"; shift 16BUILDNUM="$1"; shift 17 18[ -n "$BITS" ] || die "you must specify bittedness" 19[ -n "$REVISION" ] || die "you must specify the SVN revision" 20[ -n "$BUILDNUM" ] || die "you must specify the build number" 21 22RPM_ARCH="" 23RPM_ARGS="" 24HOST_ARGS="" 25 26OS=`uname -s | tr 'A-Z' 'a-z'` 27MACHINE=`uname -m` 28 29if [ "$OS" = "linux" ]; then 30 if [ "$BITS" = "64" ]; then 31 # HOST_ARGS="--host=x86_64-$OS" 32 HOST_ARGS="--target=x86_64-$OS" 33 RPM_ARCH="--with-rpm-arch=x86_64" 34 else 35 # HOST_ARGS="--host=i386-$OS" 36 HOST_ARGS="--target=i386-$OS" 37 RPM_ARCH="--with-rpm-arch=i386" 38 fi 39fi 40 41sh m4/autogen.sh || die "failed to autogen" 42make distclean || : 43./configure --prefix=/usr --with-java="${JAVA_HOME}" --with-jvm-arch=$BITS "$RPM_ARCH" "$RPM_ARGS" "$HOST_ARGS" || die "failed to configure" 44make dist || die "unable to make dist" 45if [ -x /bin/rpm ]; then 46 make rpm RELEASE="0.${REVISION}.${BUILDNUM}" || die "failed to make an RPM" 47else 48 make || die "failed to run make" 49 make install DESTDIR=`pwd`/dist || die "failed to run make install" 50 rm -rf dist 51fi 52