rpm installing an icon to the desktop
Asked Answered
H

2

9

In Fedora Gnome...

Using a .desktop file in my rpm, I have successfully put my gui software into the gnome application menu.

I am wondering if there is a way to also put the icon onto the gnome desktop when installing the rpm?

update:

Now I can get rpmbuild to successfully use rpmbuild with xdg-desktop-icon in %install... and in the process puts an icon on my desktop (before even installing the rpm!) I am doing something wrong. Any suggestions?

Here is the relevant part of my spec file:

Source1: %{name}.desktop
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  gettext, python-devel, desktop-file-utils, xdg-utils

...

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE1}
xdg-desktop-icon install --novendor %{SOURCE1}
Heckelphone answered 31/1, 2011 at 21:40 Comment(3)
possible duplicate of Linux desktop shortcut and icon from installIssus
@Nathan Campos -- the answers to that question did not tell how to put an icon onto the desktop. The comment from Colin on that page suggests it is not common practice, but doesn't tell how to do it.Heckelphone
just because the answers are wrong doesn't mean the question isn't a duplicate. You can bump the question to try to get more people to answer it.Fry
H
-1

This thread will help anyone who comes here looking for more information: http://lists.fedoraproject.org/pipermail/packaging/2011-February/007602.html

Heckelphone answered 21/5, 2011 at 17:35 Comment(1)
You linked to some mailing list email which provides a dead link. This is why SO answers aren't supposed to be just links to some other page on the internet. You need to actually provide an answer here.Warnock
N
1

The page you linked to explains how to use desktop-file-install on the %install section of your SPECS. Apart from that, you may need to use xdg-desktop-icon from the xdg-utils package.

EDIT:

Apparently, %install is to only be used at build time (at make install time). For package installation and removal there's %pre, %post, %preun and %postun. It looks like you should use %post, checking $1 as explained on https://fedoraproject.org/wiki/Packaging:ScriptletSnippets.

Nicolenicolea answered 31/1, 2011 at 22:53 Comment(1)
Thx! xdg-desktop-icon seems like the right idea... I am having trouble using it correctly. I've modified the o.p. Any suggestions?Heckelphone
H
-1

This thread will help anyone who comes here looking for more information: http://lists.fedoraproject.org/pipermail/packaging/2011-February/007602.html

Heckelphone answered 21/5, 2011 at 17:35 Comment(1)
You linked to some mailing list email which provides a dead link. This is why SO answers aren't supposed to be just links to some other page on the internet. You need to actually provide an answer here.Warnock

© 2022 - 2024 — McMap. All rights reserved.