[Git][debian-gis-team/josm-installer][experimental] 32 commits: Revert "Update branch in gbp.conf & Vcs-Git URL."

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Mon Apr 3 16:05:05 BST 2023



Bas Couwenberg pushed to branch experimental at Debian GIS Project / josm-installer


Commits:
9a0c1b53 by Bas Couwenberg at 2021-08-15T14:26:13+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."

This reverts commit aa2c18daaab8e3c206f6246424a2a9d0cb6b7d49.

- - - - -
9d73d9b7 by Bas Couwenberg at 2021-08-15T14:26:40+02:00
Move from experimental to unstable.

- - - - -
5389c2b6 by Bas Couwenberg at 2021-09-02T06:12:43+02:00
Updated linux directory to r18171.

- - - - -
f9121238 by Bas Couwenberg at 2021-09-02T06:18:33+02:00
Install systemd service and timer in /usr/lib instead of /usr.

- - - - -
08123651 by Bas Couwenberg at 2021-09-02T06:23:43+02:00
Update lintian overrides.

- - - - -
ebc1586f by Bas Couwenberg at 2021-09-02T06:23:43+02:00
Set distribution to unstable.

- - - - -
30bf0fdb by Bas Couwenberg at 2021-09-08T16:32:56+02:00
Bump Standards-Version to 4.6.0, no changes.

- - - - -
c6f7fb34 by Bas Couwenberg at 2021-09-12T07:43:55+02:00
Bump debhelper compat to 12.

Changes:
- Drop --list-missing from dh_install

- - - - -
e48f45cb by Bas Couwenberg at 2021-09-12T14:37:08+02:00
Update lintian overrides.

- - - - -
5f61a138 by Bas Couwenberg at 2021-11-02T05:58:38+01:00
Updated linux directory to r18297.

- - - - -
e39ea3d0 by Bas Couwenberg at 2021-11-02T06:03:29+01:00
Move systemd files back to /lib.

- - - - -
afe8dede by Bas Couwenberg at 2021-11-02T06:03:39+01:00
Set distribution to unstable.

- - - - -
e61ad74f by Bas Couwenberg at 2022-01-03T08:43:28+01:00
Updated linux directory to r18304.

- - - - -
848aa9fb by Bas Couwenberg at 2022-01-03T08:43:47+01:00
Set distribution to unstable.

- - - - -
036589e4 by Bas Couwenberg at 2022-04-06T05:40:27+02:00
Updated linux directory to r18402.

- - - - -
3aa36919 by Bas Couwenberg at 2022-04-06T05:40:44+02:00
Set distribution to unstable.

- - - - -
1d2b120d by Bas Couwenberg at 2022-06-21T07:09:45+02:00
Bump Standards-Version to 4.6.1, no changes.

- - - - -
748b88be by Bas Couwenberg at 2022-07-07T05:58:15+02:00
Updated linux directory to r18500.

- - - - -
99a208da by Bas Couwenberg at 2022-07-07T05:58:40+02:00
Set distribution to unstable.

- - - - -
efd28a6d by Bas Couwenberg at 2022-07-09T11:41:55+02:00
Updated linux directory to r18512.

- - - - -
d7b54029 by Bas Couwenberg at 2022-07-12T20:45:15+02:00
Updated linux directory to r18515.

- - - - -
5d6d90cd by Bas Couwenberg at 2022-07-12T20:49:04+02:00
Merge josm launcher improvements.

- - - - -
47b47f45 by Bas Couwenberg at 2022-07-12T20:53:04+02:00
Fix typo in README.

- - - - -
20c61895 by Bas Couwenberg at 2022-08-02T06:41:29+02:00
Set distribution to unstable.

- - - - -
a43602d0 by Bas Couwenberg at 2022-10-05T05:35:01+02:00
Fix flake8 'E275 missing whitespace after keyword' issues. (closes: #1021288)

- - - - -
6909643e by Bas Couwenberg at 2022-10-05T05:40:39+02:00
Change alignment of closing parenthesis.

- - - - -
3c6e66e1 by Bas Couwenberg at 2022-10-05T05:40:52+02:00
Set distribution to unstable.

- - - - -
f0f85632 by Bas Couwenberg at 2022-11-27T18:45:40+01:00
Add Rules-Requires-Root to control file.

- - - - -
c3ba6ed9 by Bas Couwenberg at 2023-01-18T17:00:00+01:00
Bump Standards-Version to 4.6.2, no changes.

- - - - -
605cfd25 by Bas Couwenberg at 2023-04-03T16:53:55+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
283a31e2 by Bas Couwenberg at 2023-04-03T16:54:51+02:00
Updated linux directory to r18699.

- - - - -
455aa96e by Bas Couwenberg at 2023-04-03T16:55:06+02:00
Set distribution to experimental.

- - - - -


18 changed files:

- debian/README.Debian
- debian/changelog
- − debian/compat
- debian/control
- − debian/get-orig-source
- debian/rules
- josm
- josm-installer.py
- linux/latest/DEBIAN/control
- linux/latest/etc/default/josm-latest
- linux/latest/usr/bin/josm-latest
- linux/latest/usr/share/applications/org.openstreetmap.josm-latest.desktop
- linux/latest/usr/share/mime/packages/josm-latest.xml
- linux/tested/DEBIAN/control
- linux/tested/etc/default/josm
- linux/tested/usr/bin/josm
- linux/tested/usr/share/applications/org.openstreetmap.josm.desktop
- linux/tested/usr/share/mime/packages/josm.xml


Changes:

=====================================
debian/README.Debian
=====================================
@@ -8,7 +8,7 @@ provided by the JOSM project.
 Both josm and josm-installer use the 'tested' variant, but josm-installer can
 also be used to download the 'latest' variant.
 
-The josm-installer package contain the desktop integration for JOSM, the
+The josm-installer package contains the desktop integration for JOSM, the
 josm-installer script to download the JAR, and a systemd service and timer
 to periodically download new builds of the JAR.
 


=====================================
debian/changelog
=====================================
@@ -1,3 +1,70 @@
+josm-installer (0.0.2+svn18699~exp1) experimental; urgency=medium
+
+  * Add Rules-Requires-Root to control file.
+  * Bump Standards-Version to 4.6.2, no changes.
+  * Updated linux directory to r18699.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 03 Apr 2023 16:54:53 +0200
+
+josm-installer (0.0.2+svn18515) unstable; urgency=medium
+
+  * Fix flake8 'E275 missing whitespace after keyword' issues.
+    (closes: #1021288)
+  * Change alignment of closing parenthesis.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 05 Oct 2022 05:40:40 +0200
+
+josm-installer (0.0.1+svn18515) unstable; urgency=medium
+
+  * Updated linux directory to r18515.
+  * Merge josm launcher improvements.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 02 Aug 2022 06:41:21 +0200
+
+josm-installer (0.0.1+svn18500) unstable; urgency=medium
+
+  * Bump Standards-Version to 4.6.1, no changes.
+  * Updated linux directory to r18500.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 07 Jul 2022 05:58:27 +0200
+
+josm-installer (0.0.1+svn18402) unstable; urgency=medium
+
+  * Updated linux directory to r18402.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 06 Apr 2022 05:40:31 +0200
+
+josm-installer (0.0.1+svn18304) unstable; urgency=medium
+
+  * Updated linux directory to r18304.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 03 Jan 2022 08:43:30 +0100
+
+josm-installer (0.0.1+svn18297) unstable; urgency=medium
+
+  * Bump Standards-Version to 4.6.0, no changes.
+  * Bump debhelper compat to 12, changes:
+    - Drop --list-missing from dh_install
+  * Update lintian overrides.
+  * Updated linux directory to r18297.
+  * Move systemd files back to /lib.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 02 Nov 2021 06:03:30 +0100
+
+josm-installer (0.0.1+svn18171) unstable; urgency=medium
+
+  * Updated linux directory to r18171.
+  * Install systemd service and timer in /usr/lib instead of /usr.
+  * Update lintian overrides.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 02 Sep 2021 06:12:46 +0200
+
+josm-installer (0.0.1+svn17970) unstable; urgency=medium
+
+  * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 15 Aug 2021 14:26:36 +0200
+
 josm-installer (0.0.1+svn17970~exp1) experimental; urgency=medium
 
   * Updated linux directory to r17970.


=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-10


=====================================
debian/control
=====================================
@@ -3,7 +3,7 @@ Maintainer: Debian GIS Project <pkg-grass-devel at lists.alioth.debian.org>
 Uploaders: Bas Couwenberg <sebastic at debian.org>
 Section: contrib/utils
 Priority: optional
-Build-Depends: debhelper (>= 10~),
+Build-Depends: debhelper-compat (= 12),
                python3,
                python3-flake8,
                shellcheck,
@@ -11,10 +11,11 @@ Build-Depends: debhelper (>= 10~),
                docbook-xsl,
                docbook-xml,
                xsltproc
-Standards-Version: 4.5.1
+Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/debian-gis-team/josm-installer
 Vcs-Git: https://salsa.debian.org/debian-gis-team/josm-installer.git -b experimental
 Homepage: https://josm.openstreetmap.de
+Rules-Requires-Root: no
 
 Package: josm-installer
 Architecture: all


=====================================
debian/get-orig-source deleted
=====================================
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-set -e
-
-COMPRESS=xz
-
-NAME=$(dpkg-parsechangelog -S Source)
-VERSION=$(dpkg-parsechangelog -S Version)
-
-PACKAGE=$NAME
-
-DEBIANDIR=$(readlink -f $(dirname $0))
-PACKAGEDIR=$(readlink -f $(dirname ${DEBIANDIR}))
-PARENTDIR=$(readlink -f $(dirname ${PACKAGEDIR}))
-
-TMPDIR=$(mktemp -d)
-
-cd ${TMPDIR}
-
-TARDIR=${NAME}-${VERSION}
-
-# RDNAPTRANS2008
-# http://gnss-data.kadaster.nl/root/misc/rdnaptrans2008/RDNAPTRANS2008.zip
-#
-# Download page:
-# https://www.kadaster.nl/rdnaptrans2008-download-
-
-wget "https://salsa.debian.org/debian-gis-team/proj-rdnap/-/archive/upstream/2008/proj-rdnap-upstream-2008.zip" -O proj-rdnap-upstream-2008.zip
-
-unzip proj-rdnap-upstream-2008.zip -d proj-rdnap-upstream-2008
-
-mv proj-rdnap-upstream-2008/proj-rdnap-upstream-2008 "${TARDIR}"
-
-# RDNAPTRANS2018
-# https://kadaster.nl/documents/1888506/2496175/RDNAPTRANS.zip/827827a3-b88a-5d16-55b6-7f83010e1b2f
-#
-# Download page:
-# https://formulieren.kadaster.nl/page/download-rdnaptrans
-
-wget "https://kadaster.nl/documents/1888506/2496175/RDNAPTRANS.zip/827827a3-b88a-5d16-55b6-7f83010e1b2f" -O RDNAPTRANS.zip
-
-unzip RDNAPTRANS.zip -d RDNAPTRANS2018
-
-mv RDNAPTRANS2018/* "${TARDIR}"
-
-ORIGTARFILE="${PACKAGE}_${VERSION}.orig.tar.${COMPRESS}"
-
-GZIP="--best --no-name" XZ_OPT="-6v" tar --owner=root --group=root --mode=a+rX -caf ${ORIGTARFILE} "${TARDIR}"
-
-mv ${ORIGTARFILE} ${PARENTDIR}
-
-rm -rf ${TARDIR}
-cd -
-rm -rf ${TMPDIR}
-
-exit 0


=====================================
debian/rules
=====================================
@@ -28,33 +28,30 @@ endif
 override_dh_auto_install:
 	dh_auto_install
 
-	install -o root -g root -d $(CURDIR)/debian/josm-installer/usr/bin
-	install -o root -g root -m 755 $(CURDIR)/josm $(CURDIR)/debian/josm-installer/usr/bin/josm
-	install -o root -g root -m 755 $(CURDIR)/josm-installer.py $(CURDIR)/debian/josm-installer/usr/bin/josm-installer
+	install -d $(CURDIR)/debian/josm-installer/usr/bin
+	install -m 755 $(CURDIR)/josm $(CURDIR)/debian/josm-installer/usr/bin/josm
+	install -m 755 $(CURDIR)/josm-installer.py $(CURDIR)/debian/josm-installer/usr/bin/josm-installer
 
-	install -o root -g root -d $(CURDIR)/debian/josm-installer/lib/systemd/system
-	install -o root -g root -m 644 $(CURDIR)/josm-installer.service $(CURDIR)/debian/josm-installer/lib/systemd/system/josm-installer.service
-	install -o root -g root -m 644 $(CURDIR)/josm-installer.timer $(CURDIR)/debian/josm-installer/lib/systemd/system/josm-installer.timer
+	install -d $(CURDIR)/debian/josm-installer/lib/systemd/system
+	install -m 644 $(CURDIR)/josm-installer.service $(CURDIR)/debian/josm-installer/lib/systemd/system/josm-installer.service
+	install -m 644 $(CURDIR)/josm-installer.timer $(CURDIR)/debian/josm-installer/lib/systemd/system/josm-installer.timer
 
-	install -o root -g root -d $(CURDIR)/debian/josm-installer/usr/share/josm
-	install -o root -g root -m 644 $(CURDIR)/placeholder $(CURDIR)/debian/josm-installer/usr/share/josm/.placeholder
+	install -d $(CURDIR)/debian/josm-installer/usr/share/josm
+	install -m 644 $(CURDIR)/placeholder $(CURDIR)/debian/josm-installer/usr/share/josm/.placeholder
 
-	install -o root -g root -d $(CURDIR)/debian/josm-installer/etc/default
-	install -o root -g root -m 644 $(CURDIR)/linux/tested/etc/default/josm $(CURDIR)/debian/josm-installer/etc/default/josm
+	install -d $(CURDIR)/debian/josm-installer/etc/default
+	install -m 644 $(CURDIR)/linux/tested/etc/default/josm $(CURDIR)/debian/josm-installer/etc/default/josm
 
 	for size in 512x512 256x256 192x192 128x128 96x96 80x80 72x72 64x64 48x48 42x42 40x40 36x36 32x32 24x24 22x22 16x16 8x8; do \
-		install -o root -g root -d $(CURDIR)/debian/josm-installer/usr/share/icons/hicolor/$${size}/apps ; \
-		install -o root -g root -m 644 $(CURDIR)/linux/tested/usr/share/icons/hicolor/$${size}/apps/org.openstreetmap.josm.png $(CURDIR)/debian/josm-installer/usr/share/icons/hicolor/$${size}/apps/org.openstreetmap.josm.png ; \
+		install -d $(CURDIR)/debian/josm-installer/usr/share/icons/hicolor/$${size}/apps ; \
+		install -m 644 $(CURDIR)/linux/tested/usr/share/icons/hicolor/$${size}/apps/org.openstreetmap.josm.png $(CURDIR)/debian/josm-installer/usr/share/icons/hicolor/$${size}/apps/org.openstreetmap.josm.png ; \
 	done
-	install -o root -g root -d $(CURDIR)/debian/josm-installer/usr/share/icons/hicolor/scalable/apps
-	install -o root -g root -m 644 $(CURDIR)/linux/tested/usr/share/icons/hicolor/scalable/apps/org.openstreetmap.josm.svg $(CURDIR)/debian/josm-installer/usr/share/icons/hicolor/scalable/apps/org.openstreetmap.josm.svg
+	install -d $(CURDIR)/debian/josm-installer/usr/share/icons/hicolor/scalable/apps
+	install -m 644 $(CURDIR)/linux/tested/usr/share/icons/hicolor/scalable/apps/org.openstreetmap.josm.svg $(CURDIR)/debian/josm-installer/usr/share/icons/hicolor/scalable/apps/org.openstreetmap.josm.svg
 
-	install -o root -g root -m 644 $(CURDIR)/linux/tested/usr/share/pixmaps/org.openstreetmap.josm.png $(CURDIR)/debian/josm-installer/usr/share/pixmaps/org.openstreetmap.josm.png
-	install -o root -g root -m 644 $(CURDIR)/linux/tested/usr/share/applications/org.openstreetmap.josm.desktop $(CURDIR)/debian/josm-installer/usr/share/applications/org.openstreetmap.josm.desktop
-	install -o root -g root -m 644 $(CURDIR)/linux/tested/usr/share/metainfo/org.openstreetmap.josm.appdata.xml $(CURDIR)/debian/josm-installer/usr/share/metainfo/org.openstreetmap.josm.appdata.xml
+	install -m 644 $(CURDIR)/linux/tested/usr/share/pixmaps/org.openstreetmap.josm.png $(CURDIR)/debian/josm-installer/usr/share/pixmaps/org.openstreetmap.josm.png
+	install -m 644 $(CURDIR)/linux/tested/usr/share/applications/org.openstreetmap.josm.desktop $(CURDIR)/debian/josm-installer/usr/share/applications/org.openstreetmap.josm.desktop
+	install -m 644 $(CURDIR)/linux/tested/usr/share/metainfo/org.openstreetmap.josm.appdata.xml $(CURDIR)/debian/josm-installer/usr/share/metainfo/org.openstreetmap.josm.appdata.xml
 
-	install -o root -g root -d $(CURDIR)/debian/josm-installer/usr/share/mime/packages
-	install -o root -g root -m 644 $(CURDIR)/linux/tested/usr/share/mime/packages/josm.xml $(CURDIR)/debian/josm-installer/usr/share/mime/packages
-
-override_dh_install:
-	dh_install --list-missing
+	install -d $(CURDIR)/debian/josm-installer/usr/share/mime/packages
+	install -m 644 $(CURDIR)/linux/tested/usr/share/mime/packages/josm.xml $(CURDIR)/debian/josm-installer/usr/share/mime/packages


=====================================
josm
=====================================
@@ -2,10 +2,10 @@
 # Simple wrapper script used to start JOSM in Debian
 set -e
 
-JOSM_JAR="/usr/share/josm/josm.jar"
+JOSM_PATH="/usr/share/josm/josm.jar"
 
-if [ ! -e "${JOSM_JAR}" ]; then
-    echo "JOSM JAR not found: ${JOSM_JAR}" >&2
+if [ ! -e "${JOSM_PATH}" ]; then
+    echo "JOSM JAR not found: ${JOSM_PATH}" >&2
     echo "Execute josm-installer as root" >&2
 
     exit 1
@@ -13,40 +13,62 @@ fi
 
 # First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK.
 # Override to a specific one using $JAVACMD
-ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
+if [ -e "/etc/alternatives/java" ]; then
+    ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
+fi
 
-# Let's get the current architecture -- needed for multiarchified Java
-ARCH=$(dpkg --print-architecture 2> /dev/null || true)
+if [ -v JAVA_HOME ]; then
+    JAVA_CMDS="$JAVA_HOME/bin/java"
+else
+    JAVA_CMDS=""
+fi
 
-JAVA_CMDS="$JAVA_HOME/bin/java"
+dpkg_java() {
+    # Let's get the current architecture -- needed for multiarchified Java
+    ARCH=$(dpkg --print-architecture 2> /dev/null || true)
+    # If OpenJDK is only available headless, do not try it
+    if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
+    || dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
+        # LTS versions in decreased order
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-17-openjdk/bin/java /usr/lib/jvm/java-17-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java"
+        # Released versions in decreased order
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-18-openjdk/bin/java /usr/lib/jvm/java-18-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-16-openjdk/bin/java /usr/lib/jvm/java-16-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-15-openjdk/bin/java /usr/lib/jvm/java-15-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-14-openjdk/bin/java /usr/lib/jvm/java-14-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-13-openjdk/bin/java /usr/lib/jvm/java-13-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-12-openjdk/bin/java /usr/lib/jvm/java-12-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-10-openjdk/bin/java /usr/lib/jvm/java-10-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java"
+        # Development version(s)
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-19-openjdk/bin/java /usr/lib/jvm/java-19-openjdk-$ARCH/bin/java"
+    fi
+}
 
-# If OpenJDK is only available headless, do not try it
-if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
-|| dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
-	# LTS versions in decreased order
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java"
-	# Released versions in decreased order
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-14-openjdk/bin/java /usr/lib/jvm/java-14-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-13-openjdk/bin/java /usr/lib/jvm/java-13-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-12-openjdk/bin/java /usr/lib/jvm/java-12-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-10-openjdk/bin/java /usr/lib/jvm/java-10-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java"
-	# Development version
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-15-openjdk/bin/java /usr/lib/jvm/java-15-openjdk-$ARCH/bin/java"
+java_version() {
+    ${1} -version 2>&1 | head -n1 | awk -F'"' '{print $2}' | awk -F'.' '{print $1}'
+}
+
+if dpkg --version > /dev/null 2>&1; then
+    dpkg_java
 fi
+
 # Undetermined version
 JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/default-java/bin/java /usr/bin/java"
+JOSM_VERSION="josm"
 
-if [ -f /etc/default/josm ]; then
-    . /etc/default/josm
+if [ -f "/etc/default/${JOSM_VERSION}" ]; then
+    # shellcheck source=/etc/default/josm
+    . "/etc/default/${JOSM_VERSION}"
 fi
 
 JAVA_OPTS="-Djosm.restart=true -Djava.net.useSystemProxies=true $JAVA_OPTS"
 
-if [ -z "${JAVACMD}" ]; then
+if [ -z "${JAVACMD}" ] && [ -n "${ALTERNATIVE_JDK}" ]; then
     for jcmd in $JAVA_CMDS; do
-        if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ]; then
+        if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ] && [ -x "$jcmd" ]; then
             JAVACMD="$jcmd"
             break
         fi
@@ -63,15 +85,22 @@ if [ -z "${JAVACMD}" ]; then
 fi
 
 if [ "$JAVACMD" ]; then
-    echo "Using $JAVACMD to execute josm." || true
-    if [[ "${JAVACMD}" =~ 'java-9' ]] || [[ "${JAVACMD}" =~ 'java-10' ]]; then
+    echo "Using $JAVACMD to execute ${JOSM_VERSION}." || true
+    JAVA_VERSION=$(java_version "${JAVACMD}")
+    JAVAFX_HOME="${JAVAFX_HOME:-/usr/share/openjfx/lib}"
+    JOSM_PATH="${JOSM_PATH:-/usr/share/${JOSM_VERSION}/${JOSM_VERSION}.jar}"
+    if [[ "${JAVA_VERSION}" -ge 11 ]]; then
+        JAVA_OPTS="--module-path ${JAVAFX_HOME} --add-modules java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web $JAVA_OPTS"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.base/sun.security.action=ALL-UNNAMED"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED"
+    elif [[ "${JAVA_VERSION}" -ge 9 ]]; then
         JAVA_OPTS="--add-modules java.activation,java.se.ee $JAVA_OPTS"
-    elif [[ "${JAVACMD}" =~ 'java-1' ]]; then
-        JAVA_OPTS="--add-modules java.scripting,java.sql $JAVA_OPTS"
     fi
     set +e
     while true; do
-        $JAVACMD $JAVA_OPTS -jar "${JOSM_JAR}" "$@"
+        # shellcheck disable=SC2086
+        $JAVACMD $JAVA_OPTS -jar "${JOSM_PATH}" "$@"
         if [ "z$?" != "z9" ]; then
             break
         fi


=====================================
josm-installer.py
=====================================
@@ -13,36 +13,36 @@ args = None
 def sanity_check(jar_dir, josm_symlink):
     if not os.path.exists(jar_dir):
         print(
-               "JAR directory does not exist: %s" % jar_dir,
-               file=sys.stderr,
-             )
+            "JAR directory does not exist: %s" % jar_dir,
+            file=sys.stderr,
+        )
 
         return False
 
     if not os.access(jar_dir, os.W_OK):
         print(
-               "JAR directory is not writable: %s" % jar_dir,
-               file=sys.stderr,
-             )
+            "JAR directory is not writable: %s" % jar_dir,
+            file=sys.stderr,
+        )
 
         return False
 
     if not os.path.isdir(jar_dir):
         print(
-               "JAR directory is not a directory: %s" % jar_dir,
-               file=sys.stderr,
-             )
+            "JAR directory is not a directory: %s" % jar_dir,
+            file=sys.stderr,
+        )
 
         return False
 
-    if(
+    if (
         os.path.lexists(josm_symlink) and
         not os.path.islink(josm_symlink)
-      ):
+    ):
         print(
-               "JOSM symlink is not a symlink: %s" % josm_symlink,
-               file=sys.stderr,
-             )
+            "JOSM symlink is not a symlink: %s" % josm_symlink,
+            file=sys.stderr,
+        )
 
         return False
 
@@ -51,9 +51,9 @@ def sanity_check(jar_dir, josm_symlink):
 
 def josm_installer():
     josm_symlink = os.path.join(
-                       args.jar_dir,
-                       'josm.jar',
-                   )
+        args.jar_dir,
+        'josm.jar',
+    )
 
     if not sanity_check(args.jar_dir, josm_symlink):
         sys.exit(1)
@@ -64,9 +64,9 @@ def josm_installer():
         variant = 'tested'
 
     version_url = (
-                    'https://josm.openstreetmap.de/'
-                    'wiki/TestedVersion?format=txt'
-                  )
+        'https://josm.openstreetmap.de/'
+        'wiki/TestedVersion?format=txt'
+    )
 
     jar_url = 'https://josm.openstreetmap.de/josm-%s.jar' % variant
 
@@ -77,11 +77,11 @@ def josm_installer():
 
     if args.latest:
         local_file = os.path.join(
-                         args.jar_dir,
-                         'josm-%s.jar' % (
-                             variant,
-                         ),
-                     )
+            args.jar_dir,
+            'josm-%s.jar' % (
+                variant,
+            ),
+        )
     else:
         if args.debug:
             print("GET %s" % version_url)
@@ -89,7 +89,8 @@ def josm_installer():
         r = s.get(version_url)
 
         if r.status_code != requests.codes.ok:
-            print("Error: Request failed: %s (%s %s)" % (
+            print(
+                "Error: Request failed: %s (%s %s)" % (
                     version_url,
                     r.status_code,
                     r.reason,
@@ -104,18 +105,19 @@ def josm_installer():
         version = r.text
 
         local_file = os.path.join(
-                         args.jar_dir,
-                         'josm-%s-%s.jar' % (
-                             variant,
-                             version,
-                         ),
-                     )
+            args.jar_dir,
+            'josm-%s-%s.jar' % (
+                variant,
+                version,
+            ),
+        )
 
     download = True
 
     if os.path.exists(local_file) and not args.latest:
         if args.verbose:
-            print("JOSM %s already downloaded: %s" % (
+            print(
+                "JOSM %s already downloaded: %s" % (
                     '%s %s' % (variant, version),
                     local_file,
                 )
@@ -127,7 +129,7 @@ def josm_installer():
     if not download:
         sys.exit(0)
 
-    if(
+    if (
         (
           os.path.exists(local_file) and
           not os.access(local_file, os.W_OK)
@@ -136,7 +138,7 @@ def josm_installer():
           not os.path.exists(local_file) and
           not os.access(os.path.dirname(local_file), os.W_OK)
         )
-      ):
+    ):
         print("Error: Cannot write: %s" % local_file, file=sys.stderr)
         sys.exit(1)
 
@@ -146,7 +148,8 @@ def josm_installer():
     r = s.get(jar_url)
 
     if r.status_code != requests.codes.ok:
-        print("Error: Request failed: %s (%s %s)" % (
+        print(
+            "Error: Request failed: %s (%s %s)" % (
                 version_url,
                 r.status_code,
                 r.reason,
@@ -175,40 +178,40 @@ def main():
     global args
 
     default = {
-                'jar-dir': '/usr/share/josm',
-              }
+        'jar-dir': '/usr/share/josm',
+    }
 
     parser = argparse.ArgumentParser()
 
     parser.add_argument(
-                         '-J', '--jar-dir',
-                         metavar='<PATH>',
-                         action='store',
-                         help='Path to store JAR file (default: %s)' % (
-                             default['jar-dir'],
-                         ),
-                         default=default['jar-dir'],
-                       )
+        '-J', '--jar-dir',
+        metavar='<PATH>',
+        action='store',
+        help='Path to store JAR file (default: %s)' % (
+            default['jar-dir'],
+        ),
+        default=default['jar-dir'],
+    )
     parser.add_argument(
-                         '-L', '--latest',
-                         action='store_true',
-                         help='Install latest instead of tested',
-                       )
+        '-L', '--latest',
+        action='store_true',
+        help='Install latest instead of tested',
+    )
     parser.add_argument(
-                         '-f', '--force',
-                         action='store_true',
-                         help='Force download',
-                       )
+        '-f', '--force',
+        action='store_true',
+        help='Force download',
+    )
     parser.add_argument(
-                         '-d', '--debug',
-                         action='store_true',
-                         help='Enable debug output',
-                       )
+        '-d', '--debug',
+        action='store_true',
+        help='Enable debug output',
+    )
     parser.add_argument(
-                         '-v', '--verbose',
-                         action='store_true',
-                         help='Enable verbose output',
-                       )
+        '-v', '--verbose',
+        action='store_true',
+        help='Enable verbose output',
+    )
 
     args = parser.parse_args()
 


=====================================
linux/latest/DEBIAN/control
=====================================
@@ -6,8 +6,7 @@ Homepage: https://josm.openstreetmap.de
 Priority: extra
 Architecture: all
 Depends: openjdk-11-jre | java11-runtime | openjdk-8-jre | java8-runtime,
-         proj-data, fonts-noto
-Recommends: openjfx
+         proj-data, fonts-noto, openjfx
 Description: Editor for OpenStreetMap (daily development snapshot)
  JOSM is an editor for OpenStreetMap (OSM) written in Java.
   The current version supports stand alone GPX tracks, GPX track data


=====================================
linux/latest/etc/default/josm-latest
=====================================
@@ -2,8 +2,8 @@
 # Uncomment the JAVA_OPTS lines to enable their use by /usr/bin/josm-latest
 
 # Increase usable memory
-#JAVA_OPTS="${JAVA_OPTS} -Xmx2048m"
+#JAVA_OPTS="-Xmx2048m ${JAVA_OPTS}"
 
 # Enable OpenGL pipeline (2D graphic accelerators)
-#JAVA_OPTS="${JAVA_OPTS} -Dsun.java2d.opengl=True"
+#JAVA_OPTS="-Dsun.java2d.opengl=True ${JAVA_OPTS}"
 


=====================================
linux/latest/usr/bin/josm-latest
=====================================
@@ -4,43 +4,62 @@ set -e
 
 # First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK.
 # Override to a specific one using $JAVACMD
-ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
+if [ -e "/etc/alternatives/java" ]; then
+    ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
+fi
 
-# Let's get the current architecture -- needed for multiarchified Java
-ARCH=$(dpkg --print-architecture 2> /dev/null || true)
+if [ -v JAVA_HOME ]; then
+    JAVA_CMDS="$JAVA_HOME/bin/java"
+else
+    JAVA_CMDS=""
+fi
 
-JAVA_CMDS="$JAVA_HOME/bin/java"
+dpkg_java() {
+    # Let's get the current architecture -- needed for multiarchified Java
+    ARCH=$(dpkg --print-architecture 2> /dev/null || true)
+    # If OpenJDK is only available headless, do not try it
+    if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
+    || dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
+        # LTS versions in decreased order
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-17-openjdk/bin/java /usr/lib/jvm/java-17-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java"
+        # Released versions in decreased order
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-18-openjdk/bin/java /usr/lib/jvm/java-18-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-16-openjdk/bin/java /usr/lib/jvm/java-16-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-15-openjdk/bin/java /usr/lib/jvm/java-15-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-14-openjdk/bin/java /usr/lib/jvm/java-14-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-13-openjdk/bin/java /usr/lib/jvm/java-13-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-12-openjdk/bin/java /usr/lib/jvm/java-12-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-10-openjdk/bin/java /usr/lib/jvm/java-10-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java"
+        # Development version(s)
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-19-openjdk/bin/java /usr/lib/jvm/java-19-openjdk-$ARCH/bin/java"
+    fi
+}
 
-# If OpenJDK is only available headless, do not try it
-if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
-|| dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
-	# LTS versions in decreased order
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java"
-	# Released versions in decreased order
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-16-openjdk/bin/java /usr/lib/jvm/java-16-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-15-openjdk/bin/java /usr/lib/jvm/java-15-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-14-openjdk/bin/java /usr/lib/jvm/java-14-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-13-openjdk/bin/java /usr/lib/jvm/java-13-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-12-openjdk/bin/java /usr/lib/jvm/java-12-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-10-openjdk/bin/java /usr/lib/jvm/java-10-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java"
-	# Development version(s)
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-17-openjdk/bin/java /usr/lib/jvm/java-17-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-18-openjdk/bin/java /usr/lib/jvm/java-18-openjdk-$ARCH/bin/java"
+java_version() {
+    ${1} -version 2>&1 | head -n1 | awk -F'"' '{print $2}' | awk -F'.' '{print $1}'
+}
+
+if dpkg --version > /dev/null 2>&1; then
+    dpkg_java
 fi
+
 # Undetermined version
 JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/default-java/bin/java /usr/bin/java"
+JOSM_VERSION="josm-latest"
 
-if [ -f /etc/default/josm-latest ]; then
-    . /etc/default/josm-latest
+if [ -f "/etc/default/${JOSM_VERSION}" ]; then
+    # shellcheck source=/etc/default/josm-latest
+    . "/etc/default/${JOSM_VERSION}"
 fi
 
 JAVA_OPTS="-Djosm.restart=true -Djosm.dir.name=JOSM-latest -Djava.net.useSystemProxies=true $JAVA_OPTS"
 
-if [ -z "${JAVACMD}" ]; then
+if [ -z "${JAVACMD}" ] && [ -n "${ALTERNATIVE_JDK}" ]; then
     for jcmd in $JAVA_CMDS; do
-        if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ]; then
+        if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ] && [ -x "$jcmd" ]; then
             JAVACMD="$jcmd"
             break
         fi
@@ -57,15 +76,22 @@ if [ -z "${JAVACMD}" ]; then
 fi
 
 if [ "$JAVACMD" ]; then
-    echo "Using $JAVACMD to execute josm-latest." || true
-    if [[ "${JAVACMD}" =~ 'java-9' ]] || [[ "${JAVACMD}" =~ 'java-10' ]]; then
+    echo "Using $JAVACMD to execute ${JOSM_VERSION}." || true
+    JAVA_VERSION=$(java_version "${JAVACMD}")
+    JAVAFX_HOME="${JAVAFX_HOME:-/usr/share/openjfx/lib}"
+    JOSM_PATH="${JOSM_PATH:-/usr/share/${JOSM_VERSION}/${JOSM_VERSION}.jar}"
+    if [[ "${JAVA_VERSION}" -ge 11 ]]; then
+        JAVA_OPTS="--module-path ${JAVAFX_HOME} --add-modules java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web $JAVA_OPTS"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.base/sun.security.action=ALL-UNNAMED"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED"
+    elif [[ "${JAVA_VERSION}" -ge 9 ]]; then
         JAVA_OPTS="--add-modules java.activation,java.se.ee $JAVA_OPTS"
-    elif [[ "${JAVACMD}" =~ 'java-1' ]]; then
-        JAVA_OPTS="--add-modules java.scripting,java.sql $JAVA_OPTS"
     fi
     set +e
     while true; do
-        $JAVACMD $JAVA_OPTS -jar /usr/share/josm-latest/josm-latest.jar "$@"
+        # shellcheck disable=SC2086
+        $JAVACMD $JAVA_OPTS -jar "${JOSM_PATH}" "$@"
         if [ "z$?" != "z9" ]; then
             break
         fi


=====================================
linux/latest/usr/share/applications/org.openstreetmap.josm-latest.desktop
=====================================
@@ -7,8 +7,8 @@ Comment=Extensible off-line editor for OpenStreetMap (OSM)
 Icon=org.openstreetmap.josm-latest
 Exec=josm-latest %U
 Terminal=false
-MimeType=application/x-osm+xml;application/x-gpx+xml;application/geo+json;application/x-josm-session+xml;application/x-josm-session+zip;x-scheme-handler/geo;
+MimeType=application/geo+json;application/gpx+xml;application/gzip;application/vnd.openstreetmap.data+xml;application/x-bzip2;application/x-gpx+xml;application/x-josm-session+xml;application/x-josm-session+zip;application/x-osm+xml;application/x-xz;application/zip;x-scheme-handler/geo;
 StartupNotify=true
 Categories=Education;Geoscience;Maps;
-StartupWMClass=org-openstreetmap-josm-MainApplication
+StartupWMClass=org-openstreetmap-josm-gui-MainApplication
 Keywords=OpenStreetMap;OSM;


=====================================
linux/latest/usr/share/mime/packages/josm-latest.xml
=====================================
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
-        <mime-type type="application/x-osm+xml">
+        <mime-type type="application/vnd.openstreetmap.data+xml">
                 <sub-class-of type="application/xml"/>
                 <comment>OSM XML file</comment>
                 <glob pattern="*.osm"/>


=====================================
linux/tested/DEBIAN/control
=====================================
@@ -6,8 +6,7 @@ Homepage: https://josm.openstreetmap.de
 Priority: extra
 Architecture: all
 Depends: openjdk-11-jre | java11-runtime | openjdk-8-jre | java8-runtime,
-         proj-data, fonts-noto
-Recommends: openjfx
+         proj-data, fonts-noto, openjfx
 Conflicts: josm-plugins
 Replaces: josm-plugins
 Description: Editor for OpenStreetMap


=====================================
linux/tested/etc/default/josm
=====================================
@@ -2,8 +2,8 @@
 # Uncomment the JAVA_OPTS lines to enable their use by /usr/bin/josm
 
 # Increase usable memory
-#JAVA_OPTS="${JAVA_OPTS} -Xmx2048m"
+#JAVA_OPTS="-Xmx2048m ${JAVA_OPTS}"
 
 # Enable OpenGL pipeline (2D graphic accelerators)
-#JAVA_OPTS="${JAVA_OPTS} -Dsun.java2d.opengl=True"
+#JAVA_OPTS="-Dsun.java2d.opengl=True ${JAVA_OPTS}"
 


=====================================
linux/tested/usr/bin/josm
=====================================
@@ -4,43 +4,62 @@ set -e
 
 # First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK.
 # Override to a specific one using $JAVACMD
-ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
+if [ -e "/etc/alternatives/java" ]; then
+    ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
+fi
 
-# Let's get the current architecture -- needed for multiarchified Java
-ARCH=$(dpkg --print-architecture 2> /dev/null || true)
+if [ -v JAVA_HOME ]; then
+    JAVA_CMDS="$JAVA_HOME/bin/java"
+else
+    JAVA_CMDS=""
+fi
 
-JAVA_CMDS="$JAVA_HOME/bin/java"
+dpkg_java() {
+    # Let's get the current architecture -- needed for multiarchified Java
+    ARCH=$(dpkg --print-architecture 2> /dev/null || true)
+    # If OpenJDK is only available headless, do not try it
+    if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
+    || dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
+        # LTS versions in decreased order
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-17-openjdk/bin/java /usr/lib/jvm/java-17-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java"
+        # Released versions in decreased order
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-18-openjdk/bin/java /usr/lib/jvm/java-18-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-16-openjdk/bin/java /usr/lib/jvm/java-16-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-15-openjdk/bin/java /usr/lib/jvm/java-15-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-14-openjdk/bin/java /usr/lib/jvm/java-14-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-13-openjdk/bin/java /usr/lib/jvm/java-13-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-12-openjdk/bin/java /usr/lib/jvm/java-12-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-10-openjdk/bin/java /usr/lib/jvm/java-10-openjdk-$ARCH/bin/java"
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java"
+        # Development version(s)
+        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-19-openjdk/bin/java /usr/lib/jvm/java-19-openjdk-$ARCH/bin/java"
+    fi
+}
 
-# If OpenJDK is only available headless, do not try it
-if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
-|| dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
-	# LTS versions in decreased order
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java"
-	# Released versions in decreased order
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-16-openjdk/bin/java /usr/lib/jvm/java-16-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-15-openjdk/bin/java /usr/lib/jvm/java-15-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-14-openjdk/bin/java /usr/lib/jvm/java-14-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-13-openjdk/bin/java /usr/lib/jvm/java-13-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-12-openjdk/bin/java /usr/lib/jvm/java-12-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-10-openjdk/bin/java /usr/lib/jvm/java-10-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java"
-	# Development version(s)
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-17-openjdk/bin/java /usr/lib/jvm/java-17-openjdk-$ARCH/bin/java"
-	JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-18-openjdk/bin/java /usr/lib/jvm/java-18-openjdk-$ARCH/bin/java"
+java_version() {
+    ${1} -version 2>&1 | head -n1 | awk -F'"' '{print $2}' | awk -F'.' '{print $1}'
+}
+
+if dpkg --version > /dev/null 2>&1; then
+    dpkg_java
 fi
+
 # Undetermined version
 JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/default-java/bin/java /usr/bin/java"
+JOSM_VERSION="josm"
 
-if [ -f /etc/default/josm ]; then
-    . /etc/default/josm
+if [ -f "/etc/default/${JOSM_VERSION}" ]; then
+    # shellcheck source=/etc/default/josm
+    . "/etc/default/${JOSM_VERSION}"
 fi
 
 JAVA_OPTS="-Djosm.restart=true -Djava.net.useSystemProxies=true $JAVA_OPTS"
 
-if [ -z "${JAVACMD}" ]; then
+if [ -z "${JAVACMD}" ] && [ -n "${ALTERNATIVE_JDK}" ]; then
     for jcmd in $JAVA_CMDS; do
-        if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ]; then
+        if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ] && [ -x "$jcmd" ]; then
             JAVACMD="$jcmd"
             break
         fi
@@ -57,15 +76,22 @@ if [ -z "${JAVACMD}" ]; then
 fi
 
 if [ "$JAVACMD" ]; then
-    echo "Using $JAVACMD to execute josm." || true
-    if [[ "${JAVACMD}" =~ 'java-9' ]] || [[ "${JAVACMD}" =~ 'java-10' ]]; then
+    echo "Using $JAVACMD to execute ${JOSM_VERSION}." || true
+    JAVA_VERSION=$(java_version "${JAVACMD}")
+    JAVAFX_HOME="${JAVAFX_HOME:-/usr/share/openjfx/lib}"
+    JOSM_PATH="${JOSM_PATH:-/usr/share/${JOSM_VERSION}/${JOSM_VERSION}.jar}"
+    if [[ "${JAVA_VERSION}" -ge 11 ]]; then
+        JAVA_OPTS="--module-path ${JAVAFX_HOME} --add-modules java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web $JAVA_OPTS"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.base/sun.security.action=ALL-UNNAMED"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED"
+        JAVA_OPTS="$JAVA_OPTS --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED"
+    elif [[ "${JAVA_VERSION}" -ge 9 ]]; then
         JAVA_OPTS="--add-modules java.activation,java.se.ee $JAVA_OPTS"
-    elif [[ "${JAVACMD}" =~ 'java-1' ]]; then
-        JAVA_OPTS="--add-modules java.scripting,java.sql $JAVA_OPTS"
     fi
     set +e
     while true; do
-        $JAVACMD $JAVA_OPTS -jar /usr/share/josm/josm.jar "$@"
+        # shellcheck disable=SC2086
+        $JAVACMD $JAVA_OPTS -jar "${JOSM_PATH}" "$@"
         if [ "z$?" != "z9" ]; then
             break
         fi


=====================================
linux/tested/usr/share/applications/org.openstreetmap.josm.desktop
=====================================
@@ -7,8 +7,8 @@ Comment=Extensible off-line editor for OpenStreetMap (OSM)
 Icon=org.openstreetmap.josm
 Exec=josm %U
 Terminal=false
-MimeType=application/x-osm+xml;application/x-gpx+xml;application/geo+json;application/x-josm-session+xml;application/x-josm-session+zip;x-scheme-handler/geo;
+MimeType=application/geo+json;application/gpx+xml;application/gzip;application/vnd.openstreetmap.data+xml;application/x-bzip2;application/x-gpx+xml;application/x-josm-session+xml;application/x-josm-session+zip;application/x-osm+xml;application/x-xz;application/zip;x-scheme-handler/geo;
 StartupNotify=true
 Categories=Education;Geoscience;Maps;
-StartupWMClass=org-openstreetmap-josm-MainApplication
+StartupWMClass=org-openstreetmap-josm-gui-MainApplication
 Keywords=OpenStreetMap;OSM;


=====================================
linux/tested/usr/share/mime/packages/josm.xml
=====================================
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
-        <mime-type type="application/x-osm+xml">
+        <mime-type type="application/vnd.openstreetmap.data+xml">
                 <sub-class-of type="application/xml"/>
                 <comment>OSM XML file</comment>
                 <glob pattern="*.osm"/>



View it on GitLab: https://salsa.debian.org/debian-gis-team/josm-installer/-/compare/22923d2644b2cd4667ff0f6672912bd9e589eba2...455aa96eeda6787d0e2e032b6a0920b4fc8ab7de

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/josm-installer/-/compare/22923d2644b2cd4667ff0f6672912bd9e589eba2...455aa96eeda6787d0e2e032b6a0920b4fc8ab7de
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20230403/20e6ef59/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list