Skip to content

Conversation

@camelCaseNick
Copy link

@camelCaseNick camelCaseNick commented Mar 21, 2024

The goal of this is to make JFileSync3 easier to package or otherwise distribute and install on Freedesktop.org compliant systems. Relocatability, following the data directory layout, and a valid component description in the AppStream format are common requirements amongst both package-based, and container-based distribution channels.

JFileSync3 is not relocatable, not because of requirements of the JAR itself, or its wrapping shell script, but because the desktop file hard-codes a path to the shell script, and to the icon. The Freedesktop.org data directory layout allows for relative paths in the desktop entry file on Freedesktop.org conforming systems, and thus makes it relocatable.

This change to the desktop entry makes it a requirement to have the used bin directory in the $PATH and the share directory in $XDG_DATA_DIRS. Making it relocatable, and not having this requirement, are mutually exclusive, without a hack in the desktop entry such as using /bin/sh -c with which JFileSync3 command substitution and defaulting to the current hard-coded location. If desired, in order to retain compatibility with current zip archives, it could either contain two desktop entries, or there could be a second distZip flavour.

The desktop entry specification recommends “a reversed DNS domain name controlled by the author of the application”, with the AppStream specification making this a requirement. Normally, this would match the internally used ID. However, JFileSync3 inherited JFileSync's jfs not following Java's naming convention. As such, here io.github.mgoellnitz.JFileSync3 is used as it is guaranteed to be a valid ID through existence of this repo.

These changes only apply to the file structure inside the xdg subdirectory, and thus hopefully only apply to those Freedesktop.org conforming systems. However, this change was not tested on other systems.

This leaves open questions, task, and decisions to be made:

  • Verify Windows and non-XDG Unices are not affected by this. (Highly probable, but untested due to lack of access to them.)
  • Decide on an application ID.
  • Retain compatibility with missing in $XDG_DATA_DIRS and $PATH or document new requirement?
  • Complete AppStream description.
    • It allows for a specification of an optional email address as an <update_contact/> for distros to use.
    • Is GitHub the canonical location?
    • <release/>s can have <description/>s. Should they here? If so, how best to integrate it into JFileSync3's release workflow?

Relevant Freedesktop.org specifications:

@camelCaseNick camelCaseNick force-pushed the camelCaseNick/xdg branch 6 times, most recently from 4c43fb2 to a8af3e1 Compare July 7, 2025 23:01
JFileSync3 is not relocatable, not because of
requirements of the JAR itself, or its wrapping shell
script, but because the desktop file hard-codes a path
to the shell script, and to the icon.

The Freedesktop.org data directory layout allows for
relative paths in the desktop file on Freedesktop.org
conforming systems, and thus makes it relocatable.

Link: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Link: https://specifications.freedesktop.org/menu-spec/latest/paths.html
Link: https://specifications.freedesktop.org/icon-theme-spec/latest/#icon_lookup

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
The Freedesktop.org desktop entry specification
recommends an ID "controlled by the author", while the
AppStream specification makes it a requirement.

The desktop entry uses JFileSync3, and the project
internally jfs as inherited from JFileSync. Both are not
registered TLDs.

io.github.mgoellnitz.JFileSync3 is used as it is
guaranteed to be a valid ID through existence of this
repo.

Link: https://specifications.freedesktop.org/desktop-entry-spec/latest/file-naming.html
Link: https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
@mgoellnitz mgoellnitz force-pushed the master branch 2 times, most recently from b033fc4 to 43abd20 Compare July 8, 2025 21:38
@mgoellnitz mgoellnitz force-pushed the master branch 2 times, most recently from 5556afa to 7c589a3 Compare July 20, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant