# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.335 2010/02/26 05:17:24 halcy0n Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.336 2010/02/26 05:33:57 abcd Exp $
# @ECLASS: eutils.eclass
# @MAINTAINER:
news) type=News;;
nntp) type=News;;
p2p) type=FileTransfer;;
+ voip) type=Telephony;;
*) type=;;
esac
type="Network;${type}"
visual*) type=DataVisualization;;
*) type=;;
esac
- type="Science;${type}"
+ type="Education;Science;${type}"
;;
sys)
client) type=WebBrowser;;
*) type=;;
esac
- type="Network"
+ type="Network;${type}"
;;
*)
local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
#local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
+ # Don't append another ";" when a valid category value is provided.
+ type=${type%;}${type:+;}
+
+ eshopts_push -s extglob
+ if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then
+ ewarn "As described in the Icon Theme Specification, icon file extensions are not"
+ ewarn "allowed in .desktop files if the value is not an absolute path."
+ icon=${icon%.@(xpm|png|svg)}
+ fi
+ eshopts_pop
+
cat <<-EOF > "${desktop}"
[Desktop Entry]
Name=${name}
Exec=${exec}
TryExec=${exec%% *}
Icon=${icon}
- Categories=${type};
+ Categories=${type}
EOF
[[ ${path} ]] && echo "Path=${path}" >> "${desktop}"