You are not logged in.
Edit: Cutting things out for brevity in the hopes of eliciting a few more responses
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
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
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)
//github/
Offline
$startdir/src -> $srcdir
$startdir/pkg -> $pkgdir
Offline
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
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
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