rpm 安装图标到桌面
在 Fedora Gnome 中...
使用 rpm 中的 .desktop 文件,我成功地将我的 gui 软件放入 gnome 应用程序菜单中。
我想知道是否有办法在安装 rpm 时也将图标放到 gnome 桌面上?
更新:
现在我可以让rpmbuild
在%install
中成功使用带有xdg-desktop-icon
的rpmbuild。并在此过程中在我的桌面上放置了一个图标(在安装 rpm 之前!)我做错了什么。有什么建议吗?
这是我的规范文件的相关部分:
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}
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}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您链接到的页面解释了如何在
SPECS
的%install
部分使用desktop-file-install
。除此之外,您可能需要使用xdg-utils
包中的xdg-desktop-icon
。编辑:
显然,
%install
仅在构建时(在make install
时)使用。对于软件包安装和删除,有%pre
、%post
、%preun
和%postun
。看来您应该使用%post
,检查$1
,如 https://fedoraproject.org/wiki/Packaging:ScriptletSnippets。The page you linked to explains how to use
desktop-file-install
on the%install
section of yourSPECS
. Apart from that, you may need to usexdg-desktop-icon
from thexdg-utils
package.EDIT:
Apparently,
%install
is to only be used at build time (atmake 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.此主题将帮助任何来这里寻找更多信息的人:
http://lists.fedoraproject.org/pipermail/packaging/2011-February /007602.html
This thread will help anyone who comes here looking for more information:
http://lists.fedoraproject.org/pipermail/packaging/2011-February/007602.html