desktop/josm/PKGBUILD
2018-09-10 05:27:31 +02:00

47 lines
1.5 KiB
Bash

pkgname=josm
pkgver=14178
pkgrel=1
pkgdesc="An editor for OpenStreetMap written in Java"
arch=('x86_64')
url="https://josm.openstreetmap.de"
license=('GPL')
depends=('java-runtime' 'intltool')
#screenshot=('http://wiki.openstreetmap.org/w/images/thumb/4/4e/JOSM-Jan-2009.jpg/800px-JOSM-Jan-2009.jpg')
source=("${url}/${pkgname}-tested.jar"
"${pkgname}.desktop"
"$pkgname.conf.d")
noextract=($pkgname-tested.jar)
sha256sums=('19d8b2cf7d8408bccdb4242974e4215e67fb6a67a76d6ba3dfa8b1b591265621'
'970d65819cedaa3f5174044e2e2b5d8b1d923603de9844a9d4d6b94e9b106d90'
'4d94ccc5d8e6372e9d9eb1557994c8b41d5f011bc37a7dacdbc55b649da3b969')
prepare() {
cd "${srcdir}"
bsdtar -xf $pkgname-tested.jar images/logo.svg
}
package() {
install -D -m644 ${pkgname}-tested.jar "${pkgdir}/usr/share/java/${pkgname}/${pkgname}.jar"
# Desktop integration.
install -D -m644 ${pkgname}.desktop "${pkgdir}/usr/share/applications/${pkgname}.desktop"
install -D -m644 images/logo.svg "${pkgdir}/usr/share/pixmaps/${pkgname}.svg"
# Executable.
install -d "${pkgdir}/usr/bin"
cat <<"EOF" >${pkgdir}/usr/bin/$pkgname
#!/bin/sh
# source application-specific settings
while true; do
JOSM_ARGS=
[ -f /etc/conf.d/josm ] && . /etc/conf.d/josm
CLASSPATH="/usr/share/java/josm/josm.jar"
java ${JOSM_ARGS} -cp "${CLASSPATH}" -Djosm.restart=true org.openstreetmap.josm.gui.MainApplication "$@"
[ $? -eq 9 ] || break
done
EOF
chmod 755 "${pkgdir}/usr/bin/${pkgname}"
install -Dm644 ${srcdir}/$pkgname.conf.d ${pkgdir}/etc/conf.d/$pkgname
}