You are not logged in.
Pages: 1
This is my first PKGBUILD, and was hoping if you had time if you could point out any changes I should make. One thing I was definitely not sure about was how to handle installing the custom license. Thanks for any help in advanced!
pkgname=JLex
pkgver=1.2.6
pkgrel=1
pkgdesc="JLex is a lexical analyzer generator, written for Java, in Java."
arch=('any')
url="http://www.cs.princeton.edu/~appel/modern/java/JLex/"
license=('custom')
depends=('java-runtime')
makedepends=('jdk')
source=(http://www.cs.princeton.edu/~appel/modern/java/$pkgname/Archive/$pkgver/Main.java)
md5sums=('fe0cff5db3e2f0f5d67a153cf6c783af')
build() {
cd $srcdir
# First, we have to generate the custom license file
head -167 Main.java > LICENSE || return 1
install -m644 -D $srcdir/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
# Now actually build the code
mkdir JLex || return 1
mv Main.java JLex/ || return 1
javac JLex/Main.java || return 1
jar cvfe JLex.jar JLex.Main * || return 1
install -m644 -D $srcdir/JLex.jar $pkgdir/usr/share/java/$pkgname/JLex.jar
# Create a shell script to launch the program
echo "#!/bin/sh" > jlex || return 1
echo 'java -jar /usr/share/java/JLex/JLex.jar "$@"' >> jlex || return 1
install -m755 -D $srcdir/jlex $pkgdir/usr/bin/jlex
}
EDIT: Now it actually accepts command line arguments.
Last edited by dkcampbell (2010-05-21 19:42:11)
Offline
Welcome, keep contributing.
1. Do you really need jdk at build time? If openjdk6 also works, replace
makedepends=('jdk')
by
makedepends=java-environment
2. no capitals in packagenames please.
3. the launchscript should be provided as seperate file.
Offline
Pages: 1