| 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.97 2004/08/31 09:05:24 lv Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.99 2004/09/07 11:41:29 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. |
| … | |
… | |
| 13 | INHERITED="$INHERITED $ECLASS" |
13 | INHERITED="$INHERITED $ECLASS" |
| 14 | |
14 | |
| 15 | DEPEND="!bootstrap? ( sys-devel/patch )" |
15 | DEPEND="!bootstrap? ( sys-devel/patch )" |
| 16 | |
16 | |
| 17 | DESCRIPTION="Based on the ${ECLASS} eclass" |
17 | DESCRIPTION="Based on the ${ECLASS} eclass" |
|
|
18 | |
|
|
19 | # Wait for the supplied number of seconds. If no argument is supplied, defaults |
|
|
20 | # to five seconds. If the EPAUSE_IGNORE env var is set, don't wait. If we're not |
|
|
21 | # outputting to a terminal, don't wait. For compatability purposes, the argument |
|
|
22 | # must be an integer greater than zero. |
|
|
23 | # Bug 62950, Ciaran McCreesh <ciaranm@gentoo.org> (05 Sep 2004) |
|
|
24 | epause() { |
|
|
25 | if [ -z "$EPAUSE_IGNORE" ] && [ -t 1 ] ; then |
|
|
26 | sleep ${1:-5} |
|
|
27 | fi |
|
|
28 | } |
|
|
29 | |
|
|
30 | # Beep the specified number of times (defaults to five). If our output |
|
|
31 | # is not a terminal, don't beep. If the EBEEP_IGNORE env var is set, |
|
|
32 | # don't beep. |
|
|
33 | # Bug 62950, Ciaran McCreesh <ciaranm@gentoo.org> (05 Sep 2004) |
|
|
34 | ebeep() { |
|
|
35 | local n |
|
|
36 | if [ -z "$EBEEP_IGNORE" ] && [ -t 1 ] ; then |
|
|
37 | for ((n=1 ; n <= ${1:-5} ; n++)) ; do |
|
|
38 | echo -ne "\a" |
|
|
39 | sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null |
|
|
40 | echo -ne "\a" |
|
|
41 | sleep 1 |
|
|
42 | done |
|
|
43 | fi |
|
|
44 | } |
| 18 | |
45 | |
| 19 | # This function simply returns the desired lib directory. With portage |
46 | # This function simply returns the desired lib directory. With portage |
| 20 | # 2.0.51, we now have support for installing libraries to lib32/lib64 |
47 | # 2.0.51, we now have support for installing libraries to lib32/lib64 |
| 21 | # to accomidate the needs of multilib systems. It's no longer a good idea |
48 | # to accomidate the needs of multilib systems. It's no longer a good idea |
| 22 | # to assume all libraries will end up in lib. Replace any (sane) instances |
49 | # to assume all libraries will end up in lib. Replace any (sane) instances |
| … | |
… | |
| 849 | Type=Application |
876 | Type=Application |
| 850 | Comment=${DESCRIPTION} |
877 | Comment=${DESCRIPTION} |
| 851 | Exec=${exec} |
878 | Exec=${exec} |
| 852 | Path=${path} |
879 | Path=${path} |
| 853 | Icon=${icon} |
880 | Icon=${icon} |
| 854 | Categories=Application;${type};" > ${desktop} |
881 | Categories=Application;${type};" > "${desktop}" |
| 855 | |
882 | |
| 856 | if [ -d "/usr/share/applications" ] |
883 | if [ -d "/usr/share/applications" ] |
| 857 | then |
884 | then |
| 858 | insinto /usr/share/applications |
885 | insinto /usr/share/applications |
| 859 | doins ${desktop} |
886 | doins "${desktop}" |
| 860 | fi |
887 | fi |
| 861 | |
888 | |
| 862 | #if [ -d "/usr/share/gnome/apps" ] |
889 | #if [ -d "/usr/share/gnome/apps" ] |
| 863 | #then |
890 | #then |
| 864 | # insinto /usr/share/gnome/apps/Games |
891 | # insinto /usr/share/gnome/apps/Games |
| … | |
… | |
| 875 | #fi |
902 | #fi |
| 876 | |
903 | |
| 877 | if [ -d "/usr/share/applnk" ] |
904 | if [ -d "/usr/share/applnk" ] |
| 878 | then |
905 | then |
| 879 | insinto /usr/share/applnk/${subdir} |
906 | insinto /usr/share/applnk/${subdir} |
| 880 | doins ${desktop} |
907 | doins "${desktop}" |
| 881 | fi |
908 | fi |
| 882 | |
909 | |
| 883 | return 0 |
910 | return 0 |
| 884 | } |
911 | } |
| 885 | |
912 | |