makedeb


groovy 3.0.9-1


Programming language based on Java, inspired by Python, Ruby and Smalltalk

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for groovy.

# Maintainer: Matt Spaulding <matt@mattops.io>

pkgname=groovy
pkgver=3.0.9
pkgrel=1
pkgdesc='Programming language based on Java, inspired by Python, Ruby and Smalltalk'
arch=('any')
url='http://groovy-lang.org/'
license=('Apache')
depends=('bash' 'openjdk-11-jre')
optdepends=('groovy-docs: html and pdf documentation for Groovy')
makedepends=('gendesk')
# .asc file is available for download, but there was no key available
source=("$pkgname-$pkgver.zip::https://groovy.jfrog.io/ui/api/v1/download?repoKey=dist-release-local&path=groovy-zips%252Fapache-groovy-binary-$pkgver.zip")
sha256sums=('eb34f4ee229b1a424adb87df5b999f66d1b1285694e5332d0800896744c2e421')

prepare() {
	# Generate desktop shortcut
  	gendesk -f -n \
    		--pkgname "$pkgname" \
    		--pkgdesc 'Groovy programming language' \
    		--exec 'groovyConsole' \
    		--name 'Groovy Console'

  	# Patch the scripts
  	for f in "$pkgname-$pkgver/bin/"*; do
    		sed 's:bin/env\ sh:bin/env\ sh\nGROOVY_HOME=/usr/share/groovy\nexport _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=gasp $_JAVA_OPTIONS":' -i "$f"
  	done
}

package() {
  	cd "$pkgname-$pkgver"

  	# Create the directories and package the files
  	install -d "$pkgdir/usr/share/groovy" "$pkgdir/usr/bin"
  	cp -r lib conf "$pkgdir/usr/share/groovy"
  	cp bin/* "$pkgdir/usr/bin"
  	rm "$pkgdir"/usr/bin/*completion
  	install -Dm644 bin/*completion -t "$pkgdir"/usr/share/bash-completion/completions

  	# Remove all DOS/Windows batch files
  	find "$pkgdir" -name '*.bat' -exec rm {} \;

  	# Package the license file
  	install -Dm644 LICENSE -t "$pkgdir"/usr/share/doc/$pkgname/copyright

  	# Package the desktop shortcut for Groovy Console
  	install -Dm644 "$srcdir/$pkgname.desktop" -t "$pkgdir"/usr/share/applications
}