/[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.58 Revision 1.59
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-common.eclass,v 1.58 2009/03/26 14:14:22 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.59 2009/04/08 10:47:42 ulm Exp $
4# 4#
5# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> 5# Copyright 2002-2004 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 2004-2005 Mamoru Komachi <usata@gentoo.org> 7# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org>
8# Copyright 2007-2008 Christian Faulhammer <fauli@gentoo.org> 8# Copyright 2007-2008 Christian Faulhammer <fauli@gentoo.org>
84# many Emacs support files, users may be annoyed by the start-up time. 84# many Emacs support files, users may be annoyed by the start-up time.
85# Also avoid keybindings as they might interfere with the user's 85# Also avoid keybindings as they might interfere with the user's
86# settings. Give a hint in pkg_postinst(), which should be enough. 86# settings. Give a hint in pkg_postinst(), which should be enough.
87# 87#
88# The naming scheme for this site-init file matches the shell pattern 88# The naming scheme for this site-init file matches the shell pattern
89# "[1-8][0-9]*-gentoo.el", where the two digits at the beginning define 89# "[1-8][0-9]*-gentoo*.el", where the two digits at the beginning define
90# the loading order (numbers below 10 or above 89 are reserved for 90# the loading order (numbers below 10 or above 89 are reserved for
91# internal use). So if your initialisation depends on another Emacs 91# internal use). So if your initialisation depends on another Emacs
92# package, your site file's number must be higher! 92# package, your site file's number must be higher!
93# 93#
94# Best practice is to define a SITEFILE variable in the global scope of 94# Best practice is to define a SITEFILE variable in the global scope of
98# 98#
99# Which is then installed by 99# Which is then installed by
100# 100#
101# elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die 101# elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
102# 102#
103# in src_install(). Any characters after the "-gentoo" part and before
104# the extension will be stripped from the destination file's name.
105# For example, a file "50${PN}-gentoo-${PV}.el" will be installed as
103# in src_install(). If your subdirectory is not named ${PN}, give the 106# "50${PN}-gentoo.el". If your subdirectory is not named ${PN}, give
104# differing name as second argument. 107# the differing name as second argument.
105# 108#
106# .SS 109# .SS
107# pkg_postinst() / pkg_postrm() usage: 110# pkg_postinst() / pkg_postrm() usage:
108# 111#
109# After that you need to recreate the start-up file of Emacs after 112# After that you need to recreate the start-up file of Emacs after
241} 244}
242 245
243# @FUNCTION: elisp-site-file-install 246# @FUNCTION: elisp-site-file-install
244# @USAGE: <site-init file> [subdirectory] 247# @USAGE: <site-init file> [subdirectory]
245# @DESCRIPTION: 248# @DESCRIPTION:
246# Install Emacs site-init file in SITELISP directory. 249# Install Emacs site-init file in SITELISP directory. Automatically
250# inserts a standard comment header with the name of the package (unless
251# it is already present). Tokens @SITELISP@ and @SITEETC@ are replaced
252# by the path to the package's subdirectory in SITELISP and SITEETC,
253# respectively.
247 254
248elisp-site-file-install() { 255elisp-site-file-install() {
249 local sf="${T}/${1##*/}" my_pn="${2:-${PN}}" ret 256 local sf="${1##*/}" my_pn="${2:-${PN}}" ret
257 local header=";;; ${PN} site-lisp configuration"
258
259 [[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \
260 || ewarn "elisp-site-file-install: bad name of site-init file"
261 sf="${T}/${sf/%-gentoo*.el/-gentoo.el}"
250 ebegin "Installing site initialisation file for GNU Emacs" 262 ebegin "Installing site initialisation file for GNU Emacs"
251 cp "$1" "${sf}" 263 cp "$1" "${sf}"
264 sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \
252 sed -i -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \ 265 -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \
253 -e "s:@SITEETC@:${SITEETC}/${my_pn}:g;\$q" "${sf}" 266 -e "s:@SITEETC@:${SITEETC}/${my_pn}:g;\$q" "${sf}"
254 ( # subshell to avoid pollution of calling environment 267 ( # subshell to avoid pollution of calling environment
255 insinto "${SITELISP}/site-gentoo.d" 268 insinto "${SITELISP}/site-gentoo.d"
256 doins "${sf}" 269 doins "${sf}"
257 ) 270 )

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59

  ViewVC Help
Powered by ViewVC 1.1.20