You are not logged in.

#1 2010-10-24 02:36:26

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

Advice on the formatting of a PKGBUILD (and a few misc questions)

I actually posted this on Friday morning in the PKGBUILD section of the forums, but no response yet, so I figured I'd post here as maybe I've posted in the wrong section?  I'm impatient, admittedly, but I was rather hoping to peg this and see about getting a few more things built/uploaded to the AUR this weekend... so smile

Everytime I setup a box that I need to check work email on I have to play around with the groupwise client until I've gotten it built to be installed via pacman.  Not a big deal, but I figured I could/should try to submit it to the AUR so nobody else has to do the googling and such to do the same.

Couple of questions:

1) Am I good to be making a package of the groupwise client for submital?  I'm not really sure why there isn't one already and wasn't sure if there was some legal reason?

I'm including my current (working) PKGBUILD here, for contextual reasons as well as any advice for mishaps I may have made

pkgname=gwclient
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 $startdir/src
    unzip $srcname "*client*"
    cd $startdir/pkg
    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
}

2) I realize that my pkgname is not to standard.  I realize that I should not be using a srcname, and I'm mainly looking for advice on what I should have here.  If I run yaourt -Ss groupwise,  yaourt -Ss gw, or yaourt -Ss gwclient, if I followed the standard, yaourt would be unable to find the package (I believe, and I know not everyone uses yaourt); how would I change my PKGBUILD to resolve that issue while maintaining standards?  Are there any other problems, in any aspect, with my PKGBUILD aside from that I should know about and address?

3a) Additionally, I'd ideally like this to work for X86_64 or i686 architecture, but I'm about out of time I can spend on this today (IE I can't setup a VM to see what 32 bit arch is like).  How would I change this to also work with a 32 bit installation?  Is there a way to add a depends=xxx if arch=64 vs arch=32 that is within standards?  Would I just do an if check off the uname? 

3b) Is it koscher to use an if statement in a PKGBUILD at al?  IE my final sed line has bin32-jre, I could easily have a variable created if arch=32 use /opt/jre, if arch=64 use /opt/bin32-jre, but is that the best way to do this?

For example, is this koscher?

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

Thanks for the read.  Sorry for the noobness, just trying to do my first submittal to the AUR properly.

Offline

#2 2010-10-24 05:49:24

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Advice on the formatting of a PKGBUILD (and a few misc questions)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB