desktop/groovy/PKGBUILD
2017-03-25 12:06:43 +01:00

63 lines
2.1 KiB
Bash

pkgbase=groovy
pkgname=('groovy' 'groovy-docs')
pkgver=2.4.10
pkgrel=1
pkgdesc='Programming language based on Java, inspired by Python, Ruby and Smalltalk'
arch=('any')
url='http://groovy-lang.org/'
license=('APACHE')
makedepends=('gendesk')
source=("http://dl.bintray.com/groovy/maven/apache-$pkgbase-binary-$pkgver.zip"
"http://dl.bintray.com/groovy/maven/apache-$pkgbase-docs-$pkgver.zip"
"$pkgbase.png")
sha256sums=('1c4dff3b6edf9a8ced3bca658ee1857cee90cfed1ee3474a2790045033c317a9'
'250ded30b9fd8b6baa2652b901908229d913dab0695ee3f6244b72c871bb8fb3'
'24e539235b5762b1220f39d7953a52e9b4a458c2be4f66a60219755363ba6dba')
prepare() {
# Generate desktop shortcut
gendesk -f -n --pkgname "$pkgbase" --pkgdesc 'Groovy programming language' \
--exec 'groovyConsole' --name 'Groovy Console'
# Set GROOVY_HOME correctly at the top of all the scripts.
# There are probably better ways to do this, but this works.
for f in "$pkgbase-$pkgver/bin/"*; do
sed 's:bin/sh:bin/sh\nGROOVY_HOME=/usr/share/groovy:' -i "$f"
done
cd "$pkgbase-$pkgver/embeddable"
ln -sf "$pkgbase-all-$pkgver.jar" "$pkgbase-all.jar"
}
package_groovy() {
depends=('bash' 'java-environment')
optdepends=('groovy-docs: html and pdf documentation for Groovy')
cd "$pkgbase-$pkgver"
# Create the directories and package the files
install -d "$pkgdir/usr/share/groovy" "$pkgdir/usr/bin"
cp -r lib conf embeddable "$pkgdir/usr/share/groovy"
cp bin/* "$pkgdir/usr/bin"
# Remove all DOS/Windows batch files
find $pkgdir -name '*.bat' -exec rm {} \;
# Package the license file
install -Dm644 LICENSE \
"$pkgdir/usr/share/licenses/$pkgbase/LICENSE"
# Package the desktop shortcut for Groovy Console
install -Dm644 "$srcdir/$pkgbase.desktop" \
"$pkgdir/usr/share/applications/$pkgbase.desktop"
install -Dm644 "$srcdir/$pkgbase.png" \
"$pkgdir/usr/share/pixmaps/$pkgbase.png"
}
package_groovy-docs() {
cd "$pkgbase-$pkgver"
install -d "$pkgdir/usr/share/doc/$pkgbase-$pkgver"
cp -r html/* licenses "$pkgdir/usr/share/doc/$pkgbase-$pkgver"
find "$pkgdir" -type f -exec chmod -x {} \;
}