Skip to content

Follow the Linux packaging guidelines #3108

Description

@Tobiichi-Origuchi

Is there an existing issue for this?

  • I have searched the existing issues

Pain

The current package violates the Linux packaging guidelines.

The /usr/share hierarchy is for all read-only architecture independent data files. However, spotube binary itself, as well as its libs, are all architecture-dependent.

/usr/share/appdata is legacy path, AppStream metadata should now install to /usr/share/metainfo

Suggested solution

Self-contained packages should install to /opt/pkg/, example /opt/spotube. Than, symbolic link /usr/bin/spotube -> /opt/spotube/spotube.

Install AppStream metadata to /usr/share/metainfo/com.github.KRTirtho.Spotube.metainfo.xml

Finally, it should look like:

/opt/spotube/
├── spotube
├── data/...
└── lib/...

/usr/share/
├── applications/spotube.desktop
├── icons/spotube/spotube-logo.png
└── metainfo/com.github.KRTirtho.Spotube.metainfo.xml

/usr/bin/spotube -> /opt/spotube/spotube

Useful resources

Definition of /usr/share
/usr/share : Architecture-independent data: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html

This hierarchy is intended to be shareable among all architecture platforms of a given OS; thus, for example, a site with i386, Alpha, and PPC platforms might maintain a single /usr/share directory that is centrally-mounted.

Sample PKGBUILD for a Flutter app by Arch Wiki
User:Gromit/Flutter package guidelines: https://wiki.archlinux.org/title/User%3AGromit/Flutter_package_guidelines

Important: Legacy Path: https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#spec-component-location

AppStream tools scan the /usr/share/appdata/ path for legacy compatibility as well. It should not be used anymore by new software though, even on older Linux distributions (like RHEL 7 and Ubuntu 16.04 LTS) the metainfo path is well supported. Support for the legacy path will likely be dropped completely with a future AppStream 1.0 release.

Additional information

No response

Self grab

  • I'm ready to work on this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions