You are not logged in.

#1 2009-12-20 14:21:56

GermanTrainFreak
Member
Registered: 2009-07-11
Posts: 12

Is this PKGBUILD ok? (does not meet file system standards...)

Hello,

I am currently writing on a chess program (https://launchpad.net/klaus) of which I released the first alpha some weeks ago. It's written in Java (yes, I read the packaging guidelines about Java programs).
Now I am trying to get a working PKGBUILD for this program. My current version (see below) is working, but instead of using the file system standards, it puts everything in /opt/klaus. I know this is not correct (and will try to get it working properly in the next alpha), but fixing it in the PKGBUILD seems to be very much trouble for me.

So is this PKGBUILD version o. k. until I fixed the file structure and should I upload it to AUR, or will this be rejected?

# Contributor: Stephan Hillebrand <stefh123 at yahoo dot de>

pkgname=klaus
pkgver=0.1
pkgrel=1
pkgdesc="A platform independent chess program"
arch=('i686' 'x86_64')
url="http://launchpad.net/klaus"
license=('GPL')
groups=("games")
depends=("jre>=6u1")
makedepends=("jdk>=6u1")
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=(http://launchpad.net/klaus/trunk/0.1/+download/$pkgname-$pkgver-source.tar.gz)
noextract=()
md5sums=('5c47f31c0a61de4f213258932120ae16')

build() {
  cd $srcdir/$pkgname-$pkgver
  make || return 1
  mkdir -p ${pkgdir}/opt/klaus
  cp -r bin lib share ${pkgdir}/opt/klaus
#  echo "#!/bin/bash\n/opt/klaus/bin/klaus" > /usr/bin/klaus
  mkdir -p ${pkgdir}/usr/bin
  cat > ${pkgdir}/usr/bin/klaus <<DELIM
#!/bin/bash
/opt/klaus/bin/klaus
DELIM

  chmod a+x ${pkgdir}/usr/bin/klaus

}

Offline

#2 2009-12-20 16:57:50

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Is this PKGBUILD ok? (does not meet file system standards...)

Please remove unused entrys like

optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
noextract=()

If your program also worjs under openjdk, you should use

depends=('java-runtime')
makedepends=('java-environment')

Instead of "mkdir -p" use "install -d".

The startscript shoud be provided as seperate file.

What about /usr/share/klaus/ instead of /opt/klaus ?

Your tarball does not unpack to $srcdir/$pkgname-$pkgver but to a bunch of subdirectories under $srcdir.

Edit: I think the group entry is rather useless for a package in AUR.

Last edited by Stefan Husmann (2009-12-20 17:05:17)

Offline

#3 2009-12-20 17:11:36

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Is this PKGBUILD ok? (does not meet file system standards...)

This works for me:

PKGBUILD

# Contributor: Stephan Hillebrand <stefh123 at yahoo dot de>

pkgname=klaus
pkgver=0.1
pkgrel=1
pkgdesc="A platform independent chess program"
arch=('i686' 'x86_64')
url="http://launchpad.net/klaus"
license=('GPL')
groups=("games")
depends=('bash' 'java-runtime>=6u1')
makedepends=("java-environment>=6u1")
source=(http://launchpad.net/klaus/trunk/0.1/+download/$pkgname-$pkgver-source.tar.gz klaus.sh)
md5sums=('5c47f31c0a61de4f213258932120ae16' '0205506613a36c1fc8ad3e87f3f9bd44')

build() {
  cd $srcdir
  make || return 1
}
package() {
  cd $srcdir
  install -d ${pkgdir}/usr/share/klaus
  cp -r bin lib share ${pkgdir}/usr/share/klaus
  install -Dm755 $srcdir/klaus.sh ${pkgdir}/usr/bin/klaus
}

together with klaus.sh

#!/bin/bash
pushd /usr/share/klaus/bin
./klaus
popd

BTW, your program semms to have problems with german Umlauten and the ß. Is it unicode aware?

Offline

#4 2009-12-20 19:15:27

GermanTrainFreak
Member
Registered: 2009-07-11
Posts: 12

Re: Is this PKGBUILD ok? (does not meet file system standards...)

Stefan Husmann wrote:

BTW, your program semms to have problems with german Umlauten and the ß. Is it unicode aware?

I know. it used to work, but then IntelliJ IDEA created some mess again. I'll fix it in the next alpha.

Thank you for your hints (it's my first PKGBUILD, so I don't have any experience). I was still guessing how to get openjdk working, thank you for answering this as well wink

I tested your script, it works fine at my system, too. Do you think this is ready for uploading to the AUR?

Offline

#5 2009-12-20 20:55:41

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Is this PKGBUILD ok? (does not meet file system standards...)

Yes, why not?

Offline

#6 2009-12-21 12:07:44

GermanTrainFreak
Member
Registered: 2009-07-11
Posts: 12

Re: Is this PKGBUILD ok? (does not meet file system standards...)

Stefan Husmann wrote:

Yes, why not?

ok, thanks for your help cool

edit: Package was uploaded some minutes ago, I changed some things (used java bin package according to Java packaging standards, installed & fixed klaus.desktop file).

Last edited by GermanTrainFreak (2009-12-21 17:03:38)

Offline

Board footer

Powered by FluxBB