| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.117 2004/10/09 18:25:43 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.118 2004/10/13 14:33:01 vapier Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass is for general purpose functions that most ebuilds |
7 | # This eclass is for general purpose functions that most ebuilds |
| 8 | # have to implement themselves. |
8 | # have to implement themselves. |
| … | |
… | |
| 894 | } |
894 | } |
| 895 | |
895 | |
| 896 | # Make a desktop file ! |
896 | # Make a desktop file ! |
| 897 | # Great for making those icons in kde/gnome startmenu ! |
897 | # Great for making those icons in kde/gnome startmenu ! |
| 898 | # Amaze your friends ! Get the women ! Join today ! |
898 | # Amaze your friends ! Get the women ! Join today ! |
| 899 | # gnome2 /usr/share/applications |
|
|
| 900 | # gnome1 /usr/share/gnome/apps/ |
|
|
| 901 | # KDE ${KDEDIR}/share/applnk /usr/share/applnk |
|
|
| 902 | # |
899 | # |
| 903 | # make_desktop_entry(<binary>, [name], [icon], [type], [path]) |
900 | # make_desktop_entry(<binary>, [name], [icon], [type], [path]) |
| 904 | # |
901 | # |
| 905 | # binary: what binary does the app run with ? |
902 | # binary: what binary does the app run with ? |
| 906 | # name: the name that will show up in the menu |
903 | # name: the name that will show up in the menu |
| 907 | # icon: give your little like a pretty little icon ... |
904 | # icon: give your little like a pretty little icon ... |
| 908 | # this can be relative (to /usr/share/pixmaps) or |
905 | # this can be relative (to /usr/share/pixmaps) or |
| 909 | # a full path to an icon |
906 | # a full path to an icon |
| 910 | # type: what kind of application is this ? for categories: |
907 | # type: what kind of application is this ? for categories: |
| 911 | # http://www.freedesktop.org/standards/menu-spec/ |
908 | # http://www.freedesktop.org/standards/menu-spec/ |
| 912 | # path: if your app needs to startup in a specific dir |
909 | # path: if your app needs to startup in a specific dir |
| 913 | make_desktop_entry() { |
910 | make_desktop_entry() { |
| 914 | [ -z "$1" ] && eerror "You must specify the executable" && return 1 |
911 | [ -z "$1" ] && eerror "make_desktop_entry: You must specify the executable" && return 1 |
| 915 | |
912 | |
| 916 | local exec="${1}" |
913 | local exec="${1}" |
| 917 | local name="${2:-${PN}}" |
914 | local name="${2:-${PN}}" |
| 918 | local icon="${3:-${PN}.png}" |
915 | local icon="${3:-${PN}.png}" |
| 919 | local type="${4}" |
916 | local type="${4}" |
| … | |
… | |
| 951 | Exec=${exec} |
948 | Exec=${exec} |
| 952 | Path=${path} |
949 | Path=${path} |
| 953 | Icon=${icon} |
950 | Icon=${icon} |
| 954 | Categories=Application;${type};" > "${desktop}" |
951 | Categories=Application;${type};" > "${desktop}" |
| 955 | |
952 | |
| 956 | if [ -d "/usr/share/applications" ] |
|
|
| 957 | then |
|
|
| 958 | insinto /usr/share/applications |
953 | insinto /usr/share/applications |
| 959 | doins "${desktop}" |
954 | doins "${desktop}" |
| 960 | fi |
|
|
| 961 | |
|
|
| 962 | #if [ -d "/usr/share/gnome/apps" ] |
|
|
| 963 | #then |
|
|
| 964 | # insinto /usr/share/gnome/apps/Games |
|
|
| 965 | # doins ${desktop} |
|
|
| 966 | #fi |
|
|
| 967 | |
|
|
| 968 | #if [ ! -z "`ls /usr/kde/* 2>/dev/null`" ] |
|
|
| 969 | #then |
|
|
| 970 | # for ver in /usr/kde/* |
|
|
| 971 | # do |
|
|
| 972 | # insinto ${ver}/share/applnk/Games |
|
|
| 973 | # doins ${desktop} |
|
|
| 974 | # done |
|
|
| 975 | #fi |
|
|
| 976 | |
|
|
| 977 | if [ -d "/usr/share/applnk" ] |
|
|
| 978 | then |
|
|
| 979 | insinto /usr/share/applnk/${subdir} |
|
|
| 980 | doins "${desktop}" |
|
|
| 981 | fi |
|
|
| 982 | |
955 | |
| 983 | return 0 |
956 | return 0 |
| 984 | } |
957 | } |
| 985 | |
958 | |
| 986 | # for internal use only (unpack_pdv and unpack_makeself) |
959 | # for internal use only (unpack_pdv and unpack_makeself) |