You are not logged in.

#1 2008-12-31 08:12:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Help with PKGBUILD - Buddi

I need to replace the line:

JAVA=`which java`

with

JAVA=/opt/java/jre/bin/java

In the file "buddi" (it's a shell script) but the sed line doesn't appear to be working? sad

Any help would be great smile

pkgname=Buddi
pkgver=3.2.2.5
pkgrel=1
pkgdesc="Personal finance and budgeting program, aimed at those who have little or no financial background."
arch=( i686 x86_64 )
url="http://buddi.thecave.homeunix.org/en/"
license=('GPL')
depends=('jre')
install=
source=(http://transact.dl.sourceforge.net/sourceforge/buddi/$pkgname-$pkgver.tgz)
md5sums=('946aed15ae20244bd4339bdaa61604ad')

build() {
  echo "$srcdir/$pkgname"
  cd "$srcdir/$pkgname"

  mkdir -p "$pkgdir/usr/bin/" || exit 1
  sed -i 's/JAVA=\`which java\`/JAVA=\/opt\/java\/jre\/bin\/java/g' buddi
  cp buddi "$pkgdir/usr/bin/"
  cp Buddi.jar "$pkgdir/usr/bin/"
}

Last edited by fukawi2 (2008-12-31 08:12:28)

Offline

#2 2008-12-31 08:24:11

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,648
Website

Re: Help with PKGBUILD - Buddi

You actually want to use "${JAVA_HOME}/bin/java"

sed -i "s#JAVA=\`which java\`#JAVA=\${JAVA_HOME}/bin/java#" buddi

Offline

#3 2009-01-01 00:13:00

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Help with PKGBUILD - Buddi

Thanks Allan smile

Offline

#4 2009-01-01 00:21:16

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Help with PKGBUILD - Buddi

Where does ${JAVA_HOME} come from? The sed line worked, and the line is replaced properly, but I get this when I try to run buddi:

$ buddi
I cannot find your Java executable.  Please set the JAVA variable in this script.

Which comes from this in the bash script:

# Check if Java is installed.
if [ ! -x ${JAVA} ]; then
    echo "I cannot find your Java executable.  Please set the JAVA variable in this script."
    exit 1
fi

Offline

#5 2009-01-01 02:49:28

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,648
Website

Re: Help with PKGBUILD - Buddi

All java runtimes (jre, openjdk6, ...) should set this varaible in their boot up script in /etc/profile.d/<packgae>.sh

Edit: also your papckage should probably depend on java-runtime instead of jre.

Offline

#6 2009-01-01 06:21:23

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Help with PKGBUILD - Buddi

Thanks again Allan - I'll give that a try smile

Offline

#7 2009-01-05 07:04:53

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: Help with PKGBUILD - Buddi

Allan wrote:

Edit: also your papckage should probably depend on java-runtime instead of jre.

What's the general rule of thumb on this?  If something runs under jre/openjdk6 but not java-gcj-compat, should it still depend on java-runtime?

Up until now, I've just been using jre since pacman seems to grab java-gcj-compat first.

Last edited by tdy (2009-01-05 07:07:55)

Offline

Board footer

Powered by FluxBB