/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.132 Revision 1.133
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.132 2004/12/26 22:23:35 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.133 2004/12/29 18:19:04 lanius 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.
906 cp "${f}" ${T}/edos2unix 906 cp "${f}" ${T}/edos2unix
907 sed 's/\r$//' ${T}/edos2unix > "${f}" 907 sed 's/\r$//' ${T}/edos2unix > "${f}"
908 done 908 done
909} 909}
910 910
911
912##############################################################
913# START: Handle .desktop files and menu entries #
914# maybe this should be separated into a new eclass some time #
915# lanius@gentoo.org #
916##############################################################
917
911# Make a desktop file ! 918# Make a desktop file !
912# Great for making those icons in kde/gnome startmenu ! 919# Great for making those icons in kde/gnome startmenu !
913# Amaze your friends ! Get the women ! Join today ! 920# Amaze your friends ! Get the women ! Join today !
914# 921#
915# make_desktop_entry(<binary>, [name], [icon], [type], [path]) 922# make_desktop_entry(<binary>, [name], [icon], [type], [path])
968 insinto /usr/share/applications 975 insinto /usr/share/applications
969 doins "${desktop}" 976 doins "${desktop}"
970 977
971 return 0 978 return 0
972} 979}
980
981# Make a GDM/KDM Session file
982#
983# make_desktop_entry(<title>, <command>)
984# title: File to execute to start the Window Manager
985# command: Name of the Window Manager
986
987make_session_desktop() {
988
989 [ -z "$1" ] && eerror "make_session_desktop: You must specify the title" && return 1
990 [ -z "$2" ] && eerror "make_session_desktop: You must specify the command" && return 1
991
992 local title="${1}"
993 local command="${2}"
994 local desktop="${T}/${wm}.desktop"
995
996echo "[Desktop Entry]
997Encoding=UTF-8
998Name=${title}
999Comment=This session logs you into ${title}
1000Exec=${command}
1001TryExec=${command}
1002Type=Application" > "${desktop}"
1003
1004 insinto /usr/share/xsessions
1005 doins "${desktop}"
1006
1007 return 0
1008}
1009
1010domenu() {
1011 local i
1012 local j
1013 insinto /usr/share/applications
1014 for i in ${@}
1015 do
1016 if [ -f "${i}" ];
1017 then
1018 doins ${i}
1019 elif [ -d "${i}" ];
1020 then
1021 for j in ${i}/*.desktop
1022 do
1023 doins ${j}
1024 done
1025 fi
1026 done
1027}
1028
1029doicon() {
1030 local i
1031 local j
1032 insinto /usr/share/pixmaps
1033 for i in ${@}
1034 do
1035 if [ -f "${i}" ];
1036 then
1037 doins ${i}
1038 elif [ -d "${i}" ];
1039 then
1040 for j in ${i}/*.png
1041 do
1042 doins ${j}
1043 done
1044 fi
1045 done
1046}
1047
1048##############################################################
1049# END: Handle .desktop files and menu entries #
1050##############################################################
1051
973 1052
974# for internal use only (unpack_pdv and unpack_makeself) 1053# for internal use only (unpack_pdv and unpack_makeself)
975find_unpackable_file() { 1054find_unpackable_file() {
976 local src="$1" 1055 local src="$1"
977 if [ -z "${src}" ] 1056 if [ -z "${src}" ]

Legend:
Removed from v.1.132  
changed lines
  Added in v.1.133

  ViewVC Help
Powered by ViewVC 1.1.20