| 1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 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.376 2011/12/17 06:13:50 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.377 2012/01/03 08:45:36 jlec 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 |
| … | |
… | |
| 607 | edos2unix() { |
607 | edos2unix() { |
| 608 | [[ $# -eq 0 ]] && return 0 |
608 | [[ $# -eq 0 ]] && return 0 |
| 609 | sed -i 's/\r$//' -- "$@" || die |
609 | sed -i 's/\r$//' -- "$@" || die |
| 610 | } |
610 | } |
| 611 | |
611 | |
| 612 | # Make a desktop file ! |
612 | # @FUNCTION: make_desktop_entry |
| 613 | # Great for making those icons in kde/gnome startmenu ! |
|
|
| 614 | # Amaze your friends ! Get the women ! Join today ! |
|
|
| 615 | # |
|
|
| 616 | # make_desktop_entry(<command>, [name], [icon], [type], [fields]) |
613 | # @USAGE: make_desktop_entry(<command>, [name], [icon], [type], [fields]) |
|
|
614 | # @DESCRIPTION: |
|
|
615 | # Make a .desktop file. |
| 617 | # |
616 | # |
|
|
617 | # @CODE |
| 618 | # binary: what command does the app run with ? |
618 | # binary: what command does the app run with ? |
| 619 | # name: the name that will show up in the menu |
619 | # name: the name that will show up in the menu |
| 620 | # icon: give your little like a pretty little icon ... |
620 | # icon: give your little like a pretty little icon ... |
| 621 | # this can be relative (to /usr/share/pixmaps) or |
621 | # this can be relative (to /usr/share/pixmaps) or |
| 622 | # a full path to an icon |
622 | # a full path to an icon |
| 623 | # type: what kind of application is this ? for categories: |
623 | # type: what kind of application is this? |
|
|
624 | # for categories: |
| 624 | # http://standards.freedesktop.org/menu-spec/latest/apa.html |
625 | # http://standards.freedesktop.org/menu-spec/latest/apa.html |
|
|
626 | # if unset, function tries to guess from package's category |
| 625 | # fields: extra fields to append to the desktop file; a printf string |
627 | # fields: extra fields to append to the desktop file; a printf string |
|
|
628 | # @CODE |
| 626 | make_desktop_entry() { |
629 | make_desktop_entry() { |
| 627 | [[ -z $1 ]] && die "make_desktop_entry: You must specify the executable" |
630 | [[ -z $1 ]] && die "make_desktop_entry: You must specify the executable" |
| 628 | |
631 | |
| 629 | local exec=${1} |
632 | local exec=${1} |
| 630 | local name=${2:-${PN}} |
633 | local name=${2:-${PN}} |