| 1 |
# Copyright 1999-2007 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: $ |
| 4 |
# |
| 5 |
# Copyright 2007 Christian Faulhammer <opfer@gentoo.org> |
| 6 |
# Copyright 2002-2007 Matthew Kennedy <mkennedy@gentoo.org> |
| 7 |
# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
| 8 |
# |
| 9 |
# This eclass sets the site-lisp directory for emacs-related packages. |
| 10 |
# |
| 11 |
# Emacs support for other than pure elisp packages is handled by |
| 12 |
# elisp-common.eclass where you won't have a dependency on Emacs |
| 13 |
# itself. All elisp-* functions are documented there. |
| 14 |
# |
| 15 |
# Setting SIMPLE_ELISP=t in an ebuild means, that the package's source |
| 16 |
# is a single (in whatever way) compressed elisp file with the file name |
| 17 |
# ${PN}-${PV}. The consequences: |
| 18 |
# |
| 19 |
# 1.) ${S} is redefined |
| 20 |
# 2.) ${PN}-${PV}.el is moved to ${PN} in the system. |
| 21 |
# |
| 22 |
|
| 23 |
inherit elisp-common |
| 24 |
|
| 25 |
# SRC_URI should be set to wherever the primary app-emacs/ maintainer |
| 26 |
# keeps the local elisp mirror, since most app-emacs packages are |
| 27 |
# upstream as a single .el file. |
| 28 |
|
| 29 |
if [ "${SIMPLE_ELISP}" = 't' ]; then |
| 30 |
S="${WORKDIR}/" |
| 31 |
fi |
| 32 |
|
| 33 |
DEPEND="virtual/emacs" |
| 34 |
IUSE="" |
| 35 |
|
| 36 |
elisp_src_unpack() { |
| 37 |
unpack ${A} |
| 38 |
if [ "${SIMPLE_ELISP}" = 't' ] |
| 39 |
then |
| 40 |
cd "${S}" && mv ${P}.el ${PN}.el |
| 41 |
fi |
| 42 |
} |
| 43 |
|
| 44 |
elisp_src_compile() { |
| 45 |
elisp-compile *.el || die |
| 46 |
} |
| 47 |
|
| 48 |
elisp_src_install() { |
| 49 |
elisp-install ${PN} *.el *.elc |
| 50 |
elisp-site-file-install "${FILESDIR}/${SITEFILE}" |
| 51 |
} |
| 52 |
|
| 53 |
elisp_pkg_postinst() { |
| 54 |
elisp-site-regen |
| 55 |
} |
| 56 |
|
| 57 |
elisp_pkg_postrm() { |
| 58 |
elisp-site-regen |
| 59 |
} |
| 60 |
|
| 61 |
EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm |