/[gentoo-x86]/eclass/elisp-common.eclass
Gentoo

Diff of /eclass/elisp-common.eclass

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

Revision 1.30 Revision 1.31
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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-common.eclass,v 1.30 2007/11/17 15:39:35 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.31 2007/12/01 15:35:02 ulm Exp $
4# 4#
5# Copyright 2007 Christian Faulhammer <opfer@gentoo.org> 5# Copyright 2007 Christian Faulhammer <opfer@gentoo.org>
6# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> 6# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org>
7# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org> 7# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org>
8# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> 8# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
127# 127#
128# elisp-emacs-version() outputs the version of the currently active Emacs. 128# elisp-emacs-version() outputs the version of the currently active Emacs.
129 129
130# @ECLASS-VARIABLE: SITELISP 130# @ECLASS-VARIABLE: SITELISP
131# @DESCRIPTION: 131# @DESCRIPTION:
132# Directory where Emacs Lisp files are installed. 132# Directory where packages install Emacs Lisp files.
133SITELISP=/usr/share/emacs/site-lisp 133SITELISP=/usr/share/emacs/site-lisp
134
135# Directory where packages install miscellaneous (not Lisp) files.
136SITEETC=/usr/share/emacs/etc
134 137
135# @ECLASS-VARIABLE: SITEFILE 138# @ECLASS-VARIABLE: SITEFILE
136# @DESCRIPTION: 139# @DESCRIPTION:
137# Name of package's site-init file. 140# Name of package's site-init file.
138SITEFILE=50${PN}-gentoo.el 141SITEFILE=50${PN}-gentoo.el
254 257
255elisp-site-file-install() { 258elisp-site-file-install() {
256 local sf="$1" my_pn="${2:-${PN}}" 259 local sf="$1" my_pn="${2:-${PN}}"
257 einfo "Installing site initialisation file for GNU Emacs ..." 260 einfo "Installing site initialisation file for GNU Emacs ..."
258 cp "${sf}" "${T}" 261 cp "${sf}" "${T}"
259 sed -i "s:@SITELISP@:${SITELISP}/${my_pn}:g" "${T}/$(basename "${sf}")" 262 sed -i -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \
263 -e "s:@SITEETC@:${SITEETC}/${my_pn}:g" "${T}/${sf##*/}"
260 ( # subshell to avoid pollution of calling environment 264 ( # subshell to avoid pollution of calling environment
261 insinto "${SITELISP}" 265 insinto "${SITELISP}"
262 doins "${T}/$(basename "${sf}")" 266 doins "${T}/${sf##*/}"
263 ) 267 )
264} 268}
265 269
266# @FUNCTION: elisp-site-regen 270# @FUNCTION: elisp-site-regen
267# @DESCRIPTION: 271# @DESCRIPTION:
301 EOF 305 EOF
302 306
303 for sf in "${ROOT}${SITELISP}"/[0-9][0-9]*-gentoo.el 307 for sf in "${ROOT}${SITELISP}"/[0-9][0-9]*-gentoo.el
304 do 308 do
305 [ -r "${sf}" ] || continue 309 [ -r "${sf}" ] || continue
306 sflist="${sflist} $(basename "${sf}")" 310 sflist="${sflist} ${sf##*/}"
307 cat "${sf}" >>"${T}"/site-gentoo.el 311 cat "${sf}" >>"${T}"/site-gentoo.el
308 done 312 done
309 313
310 cat <<-EOF >>"${T}"/site-gentoo.el 314 cat <<-EOF >>"${T}"/site-gentoo.el
311 315
333 done 337 done
334 while read line; do einfo "${line}"; done <<EOF 338 while read line; do einfo "${line}"; done <<EOF
335 339
336All site initialisation for Gentoo-installed packages is added to 340All site initialisation for Gentoo-installed packages is added to
337/usr/share/emacs/site-lisp/site-gentoo.el; site-start.el is no longer 341/usr/share/emacs/site-lisp/site-gentoo.el; site-start.el is no longer
338managed by Gentoo. You are responsible for all maintenance of 342managed by Gentoo. You are responsible for all maintenance of
339site-start.el if there is such a file. 343site-start.el if there is such a file.
340 344
341In order for this site initialisation to be loaded for all users 345In order for this site initialisation to be loaded for all users
342automatically, you can add a line like this: 346automatically, you can add a line like this:
343 347
344 (require 'site-gentoo) 348 (require 'site-gentoo)
345 349
346to /usr/share/emacs/site-lisp/site-start.el. Alternatively, that line 350to /usr/share/emacs/site-lisp/site-start.el. Alternatively, that line
347can be added by individual users to their initialisation files, or for 351can be added by individual users to their initialisation files, or,
348greater flexibility, users can select which of the package-specific 352for greater flexibility, users can load individual package-specific
349initialisation files in /usr/share/emacs/site-lisp/ to load. 353initialisation files from /usr/share/emacs/site-lisp/.
350EOF 354EOF
351 echo 355 echo
352 fi 356 fi
353} 357}

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20