Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: RPM installation with --prefix option emits two warnings, remains incomplete #5138

Open
Mambouna opened this issue Jan 17, 2025 · 0 comments
Labels

Comments

@Mambouna
Copy link

Describe the Bug

When installing the RPM MapTool package with the option --prefix to install into a directory other than the standard /opt, the installation emits two warnings and exits with code 2:

  • Warning 1: xdg-desktop-menu: file '/opt/maptool/lib/maptool-MapTool.desktop' does not exist
  • Warning 2: xdg-mime: file '/opt/maptool/lib/maptool-MapTool-MimeInfo.xml' does not exist
  • Exit message: warning: %post(maptool-1.15.2-1.x86_64) scriplet failed, exit status 2

The resulting problem is that no application shortcut has been made on system and that the filetype extension used by MapTool is not recognized. Additionally, the .desktop file provided in the RPM package also assumes an install location of /opt/ for maptool, thus breaking an application shortcut even if the .desktop is installed later manually. Rewriting it is trivial, but for a fully successful installation with no manual intervention, this would need to be changed as well.

So far, I have only determined these two problems but others may exist if code references the install location explicitely as /opt.

To Reproduce

  1. Download maptool-1.15.2-x86_64.rpm from Releases.
  2. Install the RPM package with a non-standard installation directory: sudo rpm --prefix=/home/USERNAME/Maptool/ -ivh maptool-1.15.2-x86_64.rpm
    (directory may be different, the one chosen here is simply a possibility).
  3. Check terminal output of installation process for warnings and try to install .desktop file manually.

Expected Behaviour

MapTool is successfully installed into the directory specified by the --prefix option in an RPM installation. The .desktop file contains the correct paths for a working application shortcut and is installed. The MIME type for MapTool files is correctly installed.

Screenshots

No response

MapTool Info

Version: 1.15.2, New

Desktop

Linux Fedora 41 KDE Plasma

Additional Context

Since I was not sure where else to put it, I will give the information regarding fixing the issue I have here:

The problem seems to stem from harcoded installation paths. The first problem (no application shortcut and MIME type) stems from the method post_install() in package/archlinux/maptool/maptool.install. Since this executes terminal commands and $RPM_INSTALL_PREFIX gets expanded to the supplied prefix during RPM installation, the fix could be pretty simple although I am not sure if usage of jpackage complicates this.

@Mambouna Mambouna added the bug label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant