desktop/josm/PKGBUILD
2015-04-27 23:29:07 +00:00

46 lines
1.7 KiB
Bash

pkgname=josm
pkgver=8279
pkgrel=1
pkgdesc="An editor for OpenStreetMap written in Java"
arch=('x86_64')
url="http://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")
sha256sums=('ce71a1a296b0967b8c486c2fc5bf5c24bba5fbe9fa429e7d4f8558788d02cc6c'
'970d65819cedaa3f5174044e2e2b5d8b1d923603de9844a9d4d6b94e9b106d90'
'4d94ccc5d8e6372e9d9eb1557994c8b41d5f011bc37a7dacdbc55b649da3b969')
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.png "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
# Executable.
install -d "${pkgdir}/usr/bin"
# echo "#!/bin/sh" > ${pkgdir}/usr/bin/${pkgname}
# echo CLASSPATH="/usr/share/java/josm/josm.jar" >> "${pkgdir}/usr/bin/${pkgname}"
# echo java -cp \"\${CLASSPATH}\" org.openstreetmap.josm.gui.MainApplication \"\$@\" \
# >> ${pkgdir}/usr/bin/${pkgname}
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
}