Set install prefix in Exec= line of .desktop file + register icon and menu entry when installing RPM package.

This commit is contained in:
Ghislain MARY 2018-03-27 10:30:23 +02:00
parent 2107ddfff0
commit 9507ce64d2
3 changed files with 13 additions and 4 deletions

View file

@ -420,7 +420,9 @@ foreach (target ${TARGET_NAME} ${TESTER_TARGET_NAME})
)
endforeach ()
install(FILES "assets/linphone.desktop"
configure_file("assets/linphone.desktop.cmake" "linphone.desktop" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/linphone.desktop"
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
)
install(FILES "${ASSETS_DIR}/images/linphone_logo.svg"

View file

@ -3,7 +3,7 @@ Name=Linphone
GenericName=SIP Phone
Comment=Linphone is a libre SIP client
Type=Application
Exec=linphone %u
Exec=@CMAKE_INSTALL_PREFIX@/linphone %u
Icon=linphone
Terminal=false
Categories=Network;Telephony;

View file

@ -57,8 +57,15 @@ make install DESTDIR=%{buildroot}
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post
/sbin/ldconfig
xdg-icon-resource install --novendor --mode system --context apps %{_datarootdir}/icons/hicolor/scalable/apps/linphone.svg linphone;
xdg-desktop-menu install --novendor --mode system %{_datarootdir}/applications/linphone.desktop
%postun
xdg-desktop-menu uninstall --mode system linphone.desktop
xdg-icon-resource uninstall --mode system linphone
/sbin/ldconfig
%files
%defattr(-,root,root,-)