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

Diff of /eclass/xemacs-elisp-common.eclass

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

Revision 1.5 Revision 1.6
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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/xemacs-elisp-common.eclass,v 1.5 2011/12/27 17:55:13 fauli Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp-common.eclass,v 1.6 2012/05/19 16:26:10 ulm Exp $
4# 4#
5# Copyright 2007-2011 Hans de Graaff <graaff@gentoo.org> 5# Copyright 2007-2011 Hans de Graaff <graaff@gentoo.org>
6# 6#
7# Based on elisp-common.eclass: 7# Based on elisp-common.eclass:
8# Copyright 2007 Christian Faulhammer <opfer@gentoo.org> 8# Copyright 2007 Christian Faulhammer <opfer@gentoo.org>
9# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> 9# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org>
10# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org> 10# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org>
11# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> 11# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
12# Copyright 2007 Ulrich Mueller <ulm@gentoo.org> 12# Copyright 2007 Ulrich MΓΌller <ulm@gentoo.org>
13# 13#
14# @ECLASS: xemacs-elisp-common.eclass 14# @ECLASS: xemacs-elisp-common.eclass
15# @MAINTAINER: 15# @MAINTAINER:
16# xemacs@gentoo.org 16# xemacs@gentoo.org
17# @BLURB: XEmacs-related installation utilities 17# @BLURB: XEmacs-related installation utilities
107# the extension will be stripped from the destination file's name. 107# the extension will be stripped from the destination file's name.
108# For example, a file "50${PN}-gentoo-${PV}.el" will be installed as 108# For example, a file "50${PN}-gentoo-${PV}.el" will be installed as
109# "50${PN}-gentoo.el". If your subdirectory is not named ${PN}, give 109# "50${PN}-gentoo.el". If your subdirectory is not named ${PN}, give
110# the differing name as second argument. 110# the differing name as second argument.
111 111
112# @ECLASS-VARIABLE: SITELISP 112# @ECLASS-VARIABLE: XEMACS_SITELISP
113# @DESCRIPTION: 113# @DESCRIPTION:
114# Directory where packages install indivivual XEmacs Lisp files. 114# Directory where packages install indivivual XEmacs Lisp files.
115SITELISP=/usr/share/xemacs/site-lisp 115XEMACS_SITELISP=/usr/share/xemacs/site-lisp
116 116
117# @ECLASS-VARIABLE: SITEPACKAGE 117# @ECLASS-VARIABLE: XEMACS_SITEPACKAGE
118# @DESCRIPTION: 118# @DESCRIPTION:
119# Directory where packages install XEmacs Lisp packages. 119# Directory where packages install XEmacs Lisp packages.
120SITEPACKAGE=/usr/share/xemacs/site-packages 120XEMACS_SITEPACKAGE=/usr/share/xemacs/site-packages
121 121
122# @ECLASS-VARIABLE: XEMACS 122# @ECLASS-VARIABLE: XEMACS
123# @DESCRIPTION: 123# @DESCRIPTION:
124# Path of XEmacs executable. 124# Path of XEmacs executable.
125XEMACS=/usr/bin/xemacs 125XEMACS=/usr/bin/xemacs
158 158
159xemacs-elisp-install () { 159xemacs-elisp-install () {
160 local subdir="$1" 160 local subdir="$1"
161 shift 161 shift
162 ( # use sub-shell to avoid possible environment polution 162 ( # use sub-shell to avoid possible environment polution
163 dodir "${SITEPACKAGE}"/lisp/"${subdir}" 163 dodir "${XEMACS_SITEPACKAGE}"/lisp/"${subdir}"
164 insinto "${SITEPACKAGE}"/lisp/"${subdir}" 164 insinto "${XEMACS_SITEPACKAGE}"/lisp/"${subdir}"
165 doins "$@" 165 doins "$@"
166 ) || die "Installing lisp files failed" 166 ) || die "Installing lisp files failed"
167} 167}
168 168
169# @FUNCTION: xemacs-elisp-comp 169# @FUNCTION: xemacs-elisp-comp
206} 206}
207 207
208# @FUNCTION: xemacs-elisp-site-file-install 208# @FUNCTION: xemacs-elisp-site-file-install
209# @USAGE: <site-init file> [subdirectory] 209# @USAGE: <site-init file> [subdirectory]
210# @DESCRIPTION: 210# @DESCRIPTION:
211# Install XEmacs site-init file in SITELISP directory. Automatically 211# Install XEmacs site-init file in XEMACS_SITELISP directory.
212# inserts a standard comment header with the name of the package (unless 212# Automatically inserts a standard comment header with the name of the
213# it is already present). Tokens @SITELISP@ is replaced by the path to 213# package (unless it is already present). Token @SITELISP@ is replaced
214# the package's subdirectory in SITELISP. 214# by the path to the package's subdirectory in XEMACS_SITELISP.
215 215
216xemacs-elisp-site-file-install() { 216xemacs-elisp-site-file-install() {
217 local sf="${1##*/}" my_pn="${2:-${PN}}" ret 217 local sf="${1##*/}" my_pn="${2:-${PN}}" ret
218 local header=";;; ${PN} site-lisp configuration" 218 local header=";;; ${PN} site-lisp configuration"
219 219
221 || ewarn "xemacs-elisp-site-file-install: bad name of site-init file" 221 || ewarn "xemacs-elisp-site-file-install: bad name of site-init file"
222 sf="${T}/${sf/%-gentoo*.el/-gentoo.el}" 222 sf="${T}/${sf/%-gentoo*.el/-gentoo.el}"
223 ebegin "Installing site initialisation file for XEmacs" 223 ebegin "Installing site initialisation file for XEmacs"
224 [[ $1 = "${sf}" ]] || cp "$1" "${sf}" 224 [[ $1 = "${sf}" ]] || cp "$1" "${sf}"
225 sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \ 225 sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \
226 -e "s:@SITELISP@:${EPREFIX}${SITELISP}/${my_pn}:g" "${sf}" 226 -e "s:@SITELISP@:${EPREFIX}${XEMACS_SITELISP}/${my_pn}:g" "${sf}"
227 ( # subshell to avoid pollution of calling environment 227 ( # subshell to avoid pollution of calling environment
228 insinto "${SITELISP}/site-gentoo.d" 228 insinto "${XEMACS_SITELISP}/site-gentoo.d"
229 doins "${sf}" 229 doins "${sf}"
230 ) 230 )
231 ret=$? 231 ret=$?
232 rm -f "${sf}" 232 rm -f "${sf}"
233 eend ${ret} "xemacs-elisp-site-file-install: doins failed" 233 eend ${ret} "xemacs-elisp-site-file-install: doins failed"
238# Regenerate the site-gentoo.el file, based on packages' site 238# Regenerate the site-gentoo.el file, based on packages' site
239# initialisation files in the /usr/share/xemacs/site-lisp/site-gentoo.d/ 239# initialisation files in the /usr/share/xemacs/site-lisp/site-gentoo.d/
240# directory. 240# directory.
241 241
242xemacs-elisp-site-regen() { 242xemacs-elisp-site-regen() {
243 local sitelisp=${ROOT}${EPREFIX}${SITELISP} 243 local sitelisp=${ROOT}${EPREFIX}${XEMACS_SITELISP}
244 local sf i line null="" page=$'\f' 244 local sf i line null="" page=$'\f'
245 local -a sflist 245 local -a sflist
246 246
247 if [ ! -d "${sitelisp}" ]; then 247 if [ ! -d "${sitelisp}" ]; then
248 eerror "xemacs-elisp-site-regen: Directory ${sitelisp} does not exist" 248 eerror "xemacs-elisp-site-regen: Directory ${sitelisp} does not exist"

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20