Multi-Python application desktop file rpmlint issue
I try to package a multi-python application and I got the build working so far, but when adding a desktop file I get this rpmlint problems: [ 42s] warning: absolute symlink: /usr/bin/NanoVNASaver -> /etc/alternatives/NanoVNASaver [ 42s] warning: absolute symlink: /usr/share/applications/nanovna-saver.desktop -> /etc/alternatives/nanovna-saver.desktop [ 42s] warning: absolute symlink: /usr/share/pixmaps/nanovna-saver.png -> /etc/alternatives/nanovna-saver.png [ 43s] error: lua script failed: [string "<lua>"]:4: cannot open file '/home/abuild/rpmbuild/BUILDROOT/nanovna-saver-0.3.8-2.1.x86_64/usr/share/applications/nanovna-saver.desktop' (No such file or directory) and finally: [ 46s] RPMLINT report: [ 46s] =============== [ 47s] /tmp/rpmlint.python39-nanovna-saver-0.3.8-2.1.noarch.rpm.jgk388ja/usr/share/applications/nanovna-saver.desktop: file does not exist [ 47s] 0 packages and 0 specfiles checked; 0 errors, 3 warnings. [ 47s] Traceback (most recent call last): [ 47s] File "rpmlint.py", line 378, in <module> [ 47s] File "rpmlint.py", line 166, in main [ 47s] File "rpmlint.py", line 224, in runChecks [ 47s] File "AbstractCheck.py", line 51, in check [ 47s] File "AbstractCheck.py", line 101, in check_binary [ 47s] File "MenuXDGCheck.py", line 92, in check_file [ 47s] File "MenuXDGCheck.py", line 34, in parse_desktop_file [ 47s] File "./codecs.py", line 905, in open [ 47s] FileNotFoundError: [Errno 2] No such file or directory: '/tmp/rpmlint.python39-nanovna-saver-0.3.8-2.1.noarch.rpm.jgk388ja/usr/share/applications/nanovna-saver.desktop' The package is built here: https://build.opensuse.org/package/show/home:frank_kunz/nanovna-saver I used this package as example https://build.opensuse.org/package/show/openSUSE:Factory/python-Twisted since this has man pages handled by python_alternative and my idea was to do it the same for a desktop file. I'm not sure if python_alternative is the right way to go for desktop files, or if there is an other possibility. The python packaging wiki(https://en.opensuse.org/openSUSE:Packaging_Python) does not list that. How can I fix that problem, or, if any, what is the better way to package the desktop file? Br, Frank
Hi Frank, Am 11.05.21 um 19:14 schrieb Frank Kunz:
I try to package a multi-python application and I got the build working so far, but when adding a desktop file I get this rpmlint problems:
The package is built here: https://build.opensuse.org/package/show/home:frank_kunz/nanovna-saver
I used this package as example https://build.opensuse.org/package/show/openSUSE:Factory/python-Twisted since this has man pages handled by python_alternative and my idea was to do it the same for a desktop file. I'm not sure if python_alternative is the right way to go for desktop files, or if there is an other possibility. The python packaging wiki(https://en.opensuse.org/openSUSE:Packaging_Python) does not list that. How can I fix that problem, or, if any, what is the better way to package the desktop file?
Br, Frank
To me, NanoVNA-Saver looks like an application rather than a library of modules to be imported by other modules/applications. Making it singlespec multi-python is probably not necessary or even desired. Better create a single nanovna-saver package without the %python_subpackages generator and use python3-foo dependencies. You can still leverage the python-rpm-macros. Even python_module, if you `%define pythons python3`. If you really want to create packages for multiple python flavors, you can avoid file conflicts for the .desktop file and icon with at least two options: 1. Provide a desktop file and icon for every subpackage No need to make it u-a controlled. You will just have entries for every flavor in the application menu. sr#893151 2. Create a unflavored subpackage for the desktop file and icon. Only the u-a selected command will have a menu entry. sr#893153 HTH, Ben
Am 14.05.21 um 16:37 schrieb Ben Greiner:
To me, NanoVNA-Saver looks like an application rather than a library of modules to be imported by other modules/applications. Making it singlespec multi-python is probably not necessary or even desired. Better create a single nanovna-saver package without the %python_subpackages generator and use python3-foo dependencies. You can still leverage the python-rpm-macros. Even python_module, if you `%define pythons python3`.
Yes, NanoVNA-Saver is a application and is not thought as a library that can be used by other modules/applications. But from here: https://en.opensuse.org/openSUSE:Packaging_Python#Executables "For packages that carry executables you need to use %python_alternative to ensure easy switching between implementation for the binary for users." I read that as the singlespec multi-python using u_a for applications is a must and not an option. If that is optional, then it would be good when the wiki page could explain when singlespec multi-python + u_a should be used for an application.
If you really want to create packages for multiple python flavors, you can avoid file conflicts for the .desktop file and icon with at least two options:
1. Provide a desktop file and icon for every subpackage No need to make it u-a controlled. You will just have entries for every flavor in the application menu. sr#893151
2. Create a unflavored subpackage for the desktop file and icon. Only the u-a selected command will have a menu entry. sr#893153
Thanks a lot for those two examples. In the meantime I followed your first advice and removed the singlespec multi-python support from the package. Br, Frank
participants (2)
-
Ben Greiner
-
Frank Kunz