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

Diff of /eclass/eutils.eclass

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

Revision 1.332 Revision 1.340
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.332 2010/02/17 02:22:43 reavertm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.340 2010/03/07 03:00:08 vapier Exp $
4 4
5# @ECLASS: eutils.eclass 5# @ECLASS: eutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds 8# @BLURB: many extra (but common) functions that are used in ebuilds
52} 52}
53 53
54else 54else
55 55
56ebeep() { 56ebeep() {
57 eqawarn "QA Notice: ebeep is not defined in EAPI=3, please file a bug at http://bugs.gentoo.org" 57 ewarn "QA Notice: ebeep is not defined in EAPI=${EAPI}, please file a bug at http://bugs.gentoo.org"
58} 58}
59 59
60epause() { 60epause() {
61 eqawarn "QA Notice: epause is not defined in EAPI=3, please file a bug at http://bugs.gentoo.org" 61 ewarn "QA Notice: epause is not defined in EAPI=${EAPI}, please file a bug at http://bugs.gentoo.org"
62} 62}
63 63
64fi 64fi
65 65
66# @FUNCTION: ecvs_clean 66# @FUNCTION: ecvs_clean
882 local catmin=${CATEGORY##*-} 882 local catmin=${CATEGORY##*-}
883 case ${catmaj} in 883 case ${catmaj} in
884 app) 884 app)
885 case ${catmin} in 885 case ${catmin} in
886 accessibility) type=Accessibility;; 886 accessibility) type=Accessibility;;
887 admin) type=System;; 887 admin) type=System;;
888 antivirus) type=System;; 888 antivirus) type=System;;
889 arch) type=Archiving;; 889 arch) type=Archiving;;
890 backup) type=Archiving;; 890 backup) type=Archiving;;
891 cdr) type=DiscBurning;; 891 cdr) type=DiscBurning;;
892 dicts) type=Dictionary;; 892 dicts) type=Dictionary;;
893 doc) type=Documentation;; 893 doc) type=Documentation;;
894 editors) type=TextEditor;; 894 editors) type=TextEditor;;
895 emacs) type=TextEditor;; 895 emacs) type=TextEditor;;
896 emulation) type=Emulator;; 896 emulation) type=Emulator;;
897 laptop) type=HardwareSettings;; 897 laptop) type=HardwareSettings;;
898 office) type=Office;; 898 office) type=Office;;
899 pda) type=PDA;; 899 pda) type=PDA;;
900 vim) type=TextEditor;; 900 vim) type=TextEditor;;
901 xemacs) type=TextEditor;; 901 xemacs) type=TextEditor;;
902 *) type=;;
903 esac 902 esac
904 ;; 903 ;;
905 904
906 dev) 905 dev)
907 type="Development" 906 type="Development"
908 ;; 907 ;;
909 908
910 games) 909 games)
911 case ${catmin} in 910 case ${catmin} in
912 action|fps) type=ActionGame;; 911 action|fps) type=ActionGame;;
913 arcade) type=ArcadeGame;; 912 arcade) type=ArcadeGame;;
914 board) type=BoardGame;; 913 board) type=BoardGame;;
915 emulation) type=Emulator;; 914 emulation) type=Emulator;;
916 kids) type=KidsGame;; 915 kids) type=KidsGame;;
917 puzzle) type=LogicGame;; 916 puzzle) type=LogicGame;;
918 roguelike) type=RolePlaying;; 917 roguelike) type=RolePlaying;;
919 rpg) type=RolePlaying;; 918 rpg) type=RolePlaying;;
920 simulation) type=Simulation;; 919 simulation) type=Simulation;;
921 sports) type=SportsGame;; 920 sports) type=SportsGame;;
922 strategy) type=StrategyGame;; 921 strategy) type=StrategyGame;;
923 *) type=;;
924 esac 922 esac
925 type="Game;${type}" 923 type="Game;${type}"
926 ;; 924 ;;
927 925
928 gnome) 926 gnome)
937 type="Network;Email" 935 type="Network;Email"
938 ;; 936 ;;
939 937
940 media) 938 media)
941 case ${catmin} in 939 case ${catmin} in
940 gfx)
942 gfx) type=Graphics;; 941 type=Graphics
942 ;;
943 *)
944 case ${catmin} in
943 radio) type=Tuner;; 945 radio) type=Tuner;;
944 sound) type=Audio;; 946 sound) type=Audio;;
945 tv) type=TV;; 947 tv) type=TV;;
946 video) type=Video;; 948 video) type=Video;;
947 *) type=;; 949 esac
950 type="AudioVideo;${type}"
951 ;;
948 esac 952 esac
949 type="AudioVideo;${type}"
950 ;; 953 ;;
951 954
952 net) 955 net)
953 case ${catmin} in 956 case ${catmin} in
954 dialup) type=Dialup;; 957 dialup) type=Dialup;;
955 ftp) type=FileTransfer;; 958 ftp) type=FileTransfer;;
956 im) type=InstantMessaging;; 959 im) type=InstantMessaging;;
957 irc) type=IRCClient;; 960 irc) type=IRCClient;;
958 mail) type=Email;; 961 mail) type=Email;;
959 news) type=News;; 962 news) type=News;;
960 nntp) type=News;; 963 nntp) type=News;;
961 p2p) type=FileTransfer;; 964 p2p) type=FileTransfer;;
962 *) type=;; 965 voip) type=Telephony;;
963 esac 966 esac
964 type="Network;${type}" 967 type="Network;${type}"
965 ;; 968 ;;
966 969
967 sci) 970 sci)
968 case ${catmin} in 971 case ${catmin} in
969 astro*) type=Astronomy;; 972 astro*) type=Astronomy;;
970 bio*) type=Biology;; 973 bio*) type=Biology;;
971 calc*) type=Calculator;; 974 calc*) type=Calculator;;
972 chem*) type=Chemistry;; 975 chem*) type=Chemistry;;
973 elec*) type=Electronics;; 976 elec*) type=Electronics;;
974 geo*) type=Geology;; 977 geo*) type=Geology;;
975 math*) type=Math;; 978 math*) type=Math;;
976 physics) type=Physics;; 979 physics) type=Physics;;
977 visual*) type=DataVisualization;; 980 visual*) type=DataVisualization;;
978 *) type=;;
979 esac 981 esac
980 type="Science;${type}" 982 type="Education;Science;${type}"
981 ;; 983 ;;
982 984
983 sys) 985 sys)
984 type="System" 986 type="System"
985 ;; 987 ;;
986 988
987 www) 989 www)
988 case ${catmin} in 990 case ${catmin} in
989 client) type=WebBrowser;; 991 client) type=WebBrowser;;
990 *) type=;;
991 esac 992 esac
992 type="Network" 993 type="Network;${type}"
993 ;; 994 ;;
994 995
995 *) 996 *)
996 type= 997 type=
997 ;; 998 ;;
1002 else 1003 else
1003 local desktop_name="${PN}-${SLOT}" 1004 local desktop_name="${PN}-${SLOT}"
1004 fi 1005 fi
1005 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" 1006 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
1006 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop 1007 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
1008
1009 # Don't append another ";" when a valid category value is provided.
1010 type=${type%;}${type:+;}
1011
1012 eshopts_push -s extglob
1013 if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then
1014 ewarn "As described in the Icon Theme Specification, icon file extensions are not"
1015 ewarn "allowed in .desktop files if the value is not an absolute path."
1016 icon=${icon%.@(xpm|png|svg)}
1017 fi
1018 eshopts_pop
1007 1019
1008 cat <<-EOF > "${desktop}" 1020 cat <<-EOF > "${desktop}"
1009 [Desktop Entry] 1021 [Desktop Entry]
1010 Name=${name} 1022 Name=${name}
1011 Type=Application 1023 Type=Application
1012 Comment=${DESCRIPTION} 1024 Comment=${DESCRIPTION}
1013 Exec=${exec} 1025 Exec=${exec}
1014 TryExec=${exec%% *} 1026 TryExec=${exec%% *}
1015 Icon=${icon} 1027 Icon=${icon}
1016 Categories=${type}; 1028 Categories=${type}
1017 EOF 1029 EOF
1018 1030
1019 [[ ${path} ]] && echo "Path=${path}" >> "${desktop}" 1031 [[ ${path} ]] && echo "Path=${path}" >> "${desktop}"
1020 1032
1021 ( 1033 (
1022 # wrap the env here so that the 'insinto' call 1034 # wrap the env here so that the 'insinto' call
1023 # doesn't corrupt the env of the caller 1035 # doesn't corrupt the env of the caller
1024 insinto /usr/share/applications 1036 insinto /usr/share/applications
1025 doins "${desktop}" 1037 doins "${desktop}"
1026 ) 1038 ) || die "installing desktop file failed"
1027} 1039}
1028 1040
1029# @FUNCTION: validate_desktop_entries 1041# @FUNCTION: validate_desktop_entries
1030# @USAGE: [directories] 1042# @USAGE: [directories]
1031# @MAINTAINER: 1043# @MAINTAINER:

Legend:
Removed from v.1.332  
changed lines
  Added in v.1.340

  ViewVC Help
Powered by ViewVC 1.1.20