You are not logged in.

#1 2010-10-22 15:39:54

Vryali
Member
From: Columbia, SC
Registered: 2008-09-17
Posts: 21

Advice/Help on the a PKGBUILD for 32 & 64 bit arch w/diff deps?

Edit: Cutting things out for brevity in the hopes of eliciting a few more responses smile

What I'd really wanted to be able to do was basically as follows:

...
archtype=`uname -m`
if [ "$arch" == "x86_64" ]
then
    javadep="bin32-jre"
else
    javadep="jre"
fi
...
depends=('glibc' 'libstdc++5' 'gcc' 'unzip' '${javadep}')
...

It doesn't seem I can do that in a PKGBUILD, and was looking for advice on making the package work for both 32 & 64 bit architectures.  Currently, there are two packages in the AUR (gwclient32 & gwclient64) and I'd really like to make it just a single package for both architectures.  The 64 bit is below.

pkgname=gwclient64
pkgver=8.0.2
pkgrel=1
pkgdesc="Novell Groupwise 8 Client for Linux"
arch=('x86_64')
url="http://gwclient.provo.novell.com/"
md5sums=('520165448d2cb741fab1aadf9c52e5e0')
depends=('glibc' 'libstdc++5' 'gcc' 'unzip' 'bin32-jre')
srcname="GW802LinuxClient.zip"
source=(http://gwclient.provo.novell.com/client/$srcname)
license="Novell-GW-8"

build()
{
    cd $srcdir
    unzip $srcname "*client*"
    cd $pkgdir
    rpmextract.sh $startdir/src/novell-groupwise-client-8.0.2-90840.i586.rpm
    chmod +rx opt usr usr/share
    rm -rf opt/novell/groupwise/client/jre
    sed -i 's%opt/novell/groupwise/client/jre%${JAVA_HOME}/jre%' "$startdir"/pkg/opt/novell/groupwise/client/bin/groupwise
    sed -i '/LD_LIBRARY_PATH/s/:.*/:\/opt\/bin32-jre\/jre\/lib\/i386:\/opt\/bin32-jre\/jre\/lib\/i386\/client/' $startdir/pkg/opt/novell/groupwise/client/bin/groupwise
}

The 32 is similar, just different paths for java (opt/bin32-jre/jre vs opt/java/jre) and instead of bin32-jre it needs jre for a dep.

Last edited by Vryali (2010-11-08 03:45:24)

Offline

#2 2010-11-05 15:43:08

Vryali
Member
From: Columbia, SC
Registered: 2008-09-17
Posts: 21

Re: Advice/Help on the a PKGBUILD for 32 & 64 bit arch w/diff deps?

I've got the 32 and 64 bit packages both up in the AUR, just running a quick yaourt on the 32 bit atm to make sure it works as I'd expect.  That said, it's still two separate packages, and I don't know what I need to do to make it so that the dependancies allow for a check on arch to see what it needs....  Would again really appreciate it if someone could clue me in on this.

Offline

#3 2010-11-05 16:12:28

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Advice/Help on the a PKGBUILD for 32 & 64 bit arch w/diff deps?

Vryali wrote:

Edit: For example, would this be koscher?

...
archtype=`uname -m`
if [ "$arch" == "x86_64" ]
then
    javadep="bin32-jre"
else
    javadep="jre"
fi
...
depends=('glibc' 'libstdc++5' 'gcc' 'unzip' '${javadep}')
...

From a purely bash perspective (I'm no packaging expert)...

'$var' evaluates to the literal string, $var... you'll want "${javadep}" or just "$javadep" there and it would work.  Is it right to do it that way? I dunno.

Last edited by brisbin33 (2010-11-05 16:12:49)

Offline

#4 2010-11-05 22:54:08

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

Re: Advice/Help on the a PKGBUILD for 32 & 64 bit arch w/diff deps?

$startdir/src -> $srcdir
$startdir/pkg -> $pkgdir

Offline

#5 2010-11-08 03:40:31

Vryali
Member
From: Columbia, SC
Registered: 2008-09-17
Posts: 21

Re: Advice/Help on the a PKGBUILD for 32 & 64 bit arch w/diff deps?

Simple enough change to get the right variable names, my bad on that.  However, any advice on consolidating my two existing packages (gwclient32 & gwclient64) into a single package?

Edit: Edited the hell out of the first post/subject in hopes of getting a few more peeks/responses.

Last edited by Vryali (2010-11-08 03:45:46)

Offline

#6 2010-11-08 08:02:43

skodabenz
Banned
From: Tamilnadu, India
Registered: 2010-04-11
Posts: 382

Re: Advice/Help on the a PKGBUILD for 32 & 64 bit arch w/diff deps?

You could do

depends=('glibc' 'libstdc++5' 'gcc' 'unzip')

case ${CARCH} in
     i686 )
           depends=(${depends} 'jre')
           ;;
     x86_64 )
           depends=(${depends} 'bin32-jre')
           ;;
esac

The mistake in your code is this

'${javadep}'

within single quotes, the environment variable is not substituted with the actual value. You should have used

depends=('glibc' 'libstdc++5' 'gcc' 'unzip' "${javadep}")

or depends=('glibc' 'libstdc++5' 'gcc' 'unzip' ${javadep})

Also no need for - archtype=`uname -m`

${CARCH} will do the job. Hope this solves your problem.

Source : http://aur.archlinux.org/packages/grub2 … r/PKGBUILD


My new forum user/nick name is "the.ridikulus.rat" .

Offline

#7 2010-11-08 21:23:21

xduugu
Member
Registered: 2008-10-16
Posts: 292

Re: Advice/Help on the a PKGBUILD for 32 & 64 bit arch w/diff deps?

skodabenz wrote:

case ${CARCH} in
     i686 )
           depends=(${depends} 'jre')
           ;;
     x86_64 )
           depends=(${depends} 'bin32-jre')
           ;;
esac

better use "depends=(${depends[@]} 'jre')", otherwise you will only get the first entry of the depends array.

Offline

Board footer

Powered by FluxBB