| 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/elisp.eclass,v 1.41 2009/03/29 20:27:19 ulm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.42 2009/08/25 12:53:55 ulm Exp $ |
| 4 | # |
4 | # |
| 5 | # Copyright 2002-2003 Matthew Kennedy <mkennedy@gentoo.org> |
5 | # Copyright 2002-2003 Matthew Kennedy <mkennedy@gentoo.org> |
| 6 | # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
6 | # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
| 7 | # Copyright 2007-2009 Christian Faulhammer <fauli@gentoo.org> |
7 | # Copyright 2007-2009 Christian Faulhammer <fauli@gentoo.org> |
| 8 | # Copyright 2007-2009 Ulrich Müller <ulm@gentoo.org> |
8 | # Copyright 2007-2009 Ulrich Müller <ulm@gentoo.org> |
| … | |
… | |
| 48 | # Name of package's site-init file. The filename must match the shell |
48 | # Name of package's site-init file. The filename must match the shell |
| 49 | # pattern "[1-8][0-9]*-gentoo.el"; numbers below 10 and above 89 are |
49 | # pattern "[1-8][0-9]*-gentoo.el"; numbers below 10 and above 89 are |
| 50 | # reserved for internal use. "50${PN}-gentoo.el" is a reasonable choice |
50 | # reserved for internal use. "50${PN}-gentoo.el" is a reasonable choice |
| 51 | # in most cases. |
51 | # in most cases. |
| 52 | |
52 | |
| 53 | inherit elisp-common eutils versionator |
53 | inherit elisp-common eutils |
| 54 | |
54 | |
| 55 | case "${EAPI:-0}" in |
55 | case "${EAPI:-0}" in |
| 56 | 0|1) EXPORT_FUNCTIONS src_{unpack,compile,install} \ |
56 | 0|1) EXPORT_FUNCTIONS src_{unpack,compile,install} \ |
| 57 | pkg_{setup,postinst,postrm} ;; |
57 | pkg_{setup,postinst,postrm} ;; |
| 58 | *) EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ |
58 | *) EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ |
| … | |
… | |
| 64 | IUSE="" |
64 | IUSE="" |
| 65 | |
65 | |
| 66 | elisp_pkg_setup() { |
66 | elisp_pkg_setup() { |
| 67 | local need_emacs=${NEED_EMACS:-21} |
67 | local need_emacs=${NEED_EMACS:-21} |
| 68 | local have_emacs=$(elisp-emacs-version) |
68 | local have_emacs=$(elisp-emacs-version) |
| 69 | if ! version_is_at_least "${need_emacs}" "${have_emacs}"; then |
69 | if [ "${have_emacs%%.*}" -lt "${need_emacs%%.*}" ]; then |
| 70 | eerror "This package needs at least Emacs ${need_emacs}." |
70 | eerror "This package needs at least Emacs ${need_emacs%%.*}." |
| 71 | eerror "Use \"eselect emacs\" to select the active version." |
71 | eerror "Use \"eselect emacs\" to select the active version." |
| 72 | die "Emacs version ${have_emacs} is too low." |
72 | die "Emacs version ${have_emacs} is too low." |
| 73 | fi |
73 | fi |
| 74 | einfo "Emacs version: ${have_emacs}" |
74 | einfo "Emacs version: ${have_emacs}" |
| 75 | } |
75 | } |