You are not logged in.

#1 2009-02-22 22:21:02

akira86
Member
Registered: 2009-01-16
Posts: 118

first PKGBUILD (gsplit) -> can you check ??

Hello

I wrote my first PKGBUILD, for the gsplit program. But before uploading it to AUR I wonder if someone experienced could check it ?

Thank you in advance

(PS : sorry for my bad english)

# $Id: PKGBUILD, 2009/02/22$
# Maintainer: IDontWantToBeSpamed <IDontWantToBeSpamed>
# Contributor: IDontWantToBeSpamed <IDontWantToBeSpamed>
pkgname=gsplit-svn
pkgver=20090222
pkgrel=1
pkgdesc="frontend for split, written in java"
arch=(i686 x86_64)
url="http://www.respawner.fr/gsplit/"
license=('GPL3')
groups=
provides=('gsplit')
depends=('java-runtime' 'java-gnome')
makedepends=('subversion' 'apache-ant')
source=()
md5sums=()
 
build() {
    name=gsplit

    cd $startdir/src
    svn co http://www.respawner.fr/$pkgname/trunk/$name/
    cd $name
    
    mkdir libs

    CLASSPATH=/usr/local/share/java/gtk.jar ant dist

    cd build
    
    mkdir -p $startdir/pkg/usr/share/$name
    mkdir -p $startdir/pkg/usr/share/java/$name
    mkdir -p $startdir/pkg/usr/bin

    mv data $startdir/pkg/usr/share/$name
    mv po $startdir/pkg/usr/share/$name

    mv gsplit.jar $startdir/pkg/usr/share/java/$name

    echo '#! /bin/sh' > $startdir/pkg/usr/bin/$name
    echo 'java -classpath /usr/local/share/java/gtk.jar:/usr/share/java/gsplit/gsplit.jar gsplit.GSplit' >> $startdir/pkg/usr/bin/$name
    chmod +x $startdir/pkg/usr/bin/$name
}

Offline

#2 2009-02-22 22:58:46

deltaecho
Member
From: Seattle, Washington (USA)
Registered: 2008-08-06
Posts: 182

Re: first PKGBUILD (gsplit) -> can you check ??

Everything looks good to me, except to take advantage of Pacman's subversion capabilities (such as keeping the $pkgver in sync with the svn version), you need to include 2 more variables, _svnroot and _svnmod.  Your PKGBUILD should look something like this:

...
source=()
md5sums=()

_svnroot="http://www.respawner.fr/$pkgname/trunk/$name"
_svnmod="$name"

build() {
    ...
    svn co $_svnroot $_svnmod
    ...
}

Edit: For more information, run `man PKGBUILD'

Last edited by deltaecho (2009-02-22 23:01:01)


Dylon

Offline

#3 2009-02-22 23:00:56

akira86
Member
Registered: 2009-01-16
Posts: 118

Re: first PKGBUILD (gsplit) -> can you check ??

OK Thanks ... I will modify the PKGBUILD.

new version :

# $Id: PKGBUILD, 2009/02/22$
# Maintainer: ***** <***>
# Contributor: ***** <***>
pkgname=gsplit-svn
pkgver=148
pkgrel=1
pkgdesc="frontend for split, written in java"
arch=(i686 x86_64)
url="http://www.respawner.fr/gsplit/"
license=('GPL3')
groups=
provides=('gsplit')
depends=('java-runtime' 'java-gnome')
makedepends=('subversion' 'apache-ant')
source=(gsplit.desktop)
md5sums=('430bf9e6c3eb824edbaa886e4ce1c482')

_svntrunk="http://www.respawner.fr/$pkgname/trunk/gsplit"
_svnmod="gsplit"

build() {
    name=gsplit

    mkdir -p $startdir/pkg/usr/share/$name
    mkdir -p $startdir/pkg/usr/share/java/$name
    mkdir -p $startdir/pkg/usr/bin
    mkdir -p $startdir/pkg/usr/share/icons
    mkdir -p $startdir/pkg/usr/share/applications

    cd $startdir/src
    mv $name.desktop $startdir/pkg/usr/share/applications

    svn co $_svntrunk $_svnmod
    cd $name
    
    mkdir libs

    CLASSPATH=/usr/local/share/java/gtk.jar ant dist

    cd build
    
    cp data/logo.png $startdir/pkg/usr/share/icons/gsplit.png

    mv data $startdir/pkg/usr/share/$name
    mv po $startdir/pkg/usr/share/$name

    mv gsplit.jar $startdir/pkg/usr/share/java/$name

    echo '#! /bin/sh' > $startdir/pkg/usr/bin/$name
    echo 'java -classpath /usr/local/share/java/gtk.jar:/usr/share/java/gsplit/gsplit.jar gsplit.GSplit' >> $startdir/pkg/usr/bin/$name
    chmod +x $startdir/pkg/usr/bin/$name
}

desktop :

[Desktop Entry]
Encoding=UTF-8
Name=gsplit
Comment=frontend for split
GenericName=
Type=Application
TryExec=gsplit
Exec=gsplit
Icon=gsplit.png
Terminal=false
X-MultipleArgs=false
Categories=GTK;Application;Utility;

Last edited by akira86 (2009-02-22 23:15:54)

Offline

#4 2009-02-22 23:53:55

deltaecho
Member
From: Seattle, Washington (USA)
Registered: 2008-08-06
Posts: 182

Re: first PKGBUILD (gsplit) -> can you check ??

deltaecho wrote:

_svnroot="http://www.respawner.fr/$pkgname/trunk/$name"

akira86 wrote:

_svntrunk="http://www.respawner.fr/$pkgname/trunk/gsplit"

tongue (too many variables to recall off the top of my head...)

One more thing -- and I believe I'm using the correct syntax this time -- you can tell your PKGBUILD to update your subversion sources instead of downloading them each time; to do so, change your line that looks like

svn co $_svntrunk $_svnmod

to the block

if [ -d $_svnmod/.svn ]; then
    svn up $_svnmod
else
    svn co $_svntrunk $_svnmod
fi

Dylon

Offline

#5 2009-02-23 00:15:49

akira86
Member
Registered: 2009-01-16
Posts: 118

Re: first PKGBUILD (gsplit) -> can you check ??

No problem for the variable .. I follow your advice to look in the man :-) and it was OK.

I just change the "svn" line with yours and will upload these files on AUR.

Thanks.

Offline

Board footer

Powered by FluxBB