Commit 114814af authored by Mike Miller's avatar Mike Miller

d/cdargs.emacsen-{install,remove}: Update from emacsen-common sample scripts

Signed-off-by: Mike Miller's avatarMike Miller <mtmiller@debian.org>
parent 0f4e9e8f
#!/bin/sh -eu
#!/bin/sh
set -e
FLAVOR="$1"
echo "install/cdargs: Handling install of emacsen flavor $FLAVOR"
FLAVOR=$1
echo install/cdargs: Handling install of emacsen flavor ${FLAVOR}
byte_compile_options="-batch -f batch-byte-compile"
el_file="cdargs.el"
el_dir="/usr/share/emacs/site-lisp"
elc_dir="/usr/share/$FLAVOR/site-lisp"
elc_dir=/usr/share/${FLAVOR}/site-lisp/cdargs/
if [ "$FLAVOR" != emacs ]
then
echo "install/cdargs: byte-compiling for $FLAVOR"
echo install/cdargs: byte-compiling for ${FLAVOR}
# Create symlinks to the .el files (debian-emacs policy section 5E)
( cd "$elc_dir" && ln -sf "$el_dir/$el_file" "$el_file" )
[ -d ${elc_dir} ] || mkdir ${elc_dir}
# Byte compile them
"$FLAVOR" $byte_compile_options "$elc_dir/$el_file" > /dev/null 2>&1
fi
exit 0
# Create symlinks to the .el files (see section 6E in debian-emacs
# polcy). This makes complation easy, and also allows find-function
# and find-library to work properly.
(cd ${elc_dir} && cp -s ../../../emacs/site-lisp/cdargs/*.el .)
# Byte compile them
(cd ${elc_dir} && ${FLAVOR} ${byte_compile_options} *.el > /dev/null 2>&1)
exit 0;
#!/bin/sh -eu
#!/bin/sh
set -e
FLAVOR="$1"
echo "remove/cdargs: Handling removal of emacsen flavor $FLAVOR"
FLAVOR=$1
elc_dir=/usr/share/${FLAVOR}/site-lisp/cdargs/
if [ "$FLAVOR" != emacs ]
then
echo "remove/cdargs: purging byte-compiled files for ${FLAVOR}"
rm -f "/usr/share/$FLAVOR/site-lisp/cdargs.elc"
rm -f "/usr/share/$FLAVOR/site-lisp/cdargs.el"
echo remove/cdargs: Handling removal of emacsen flavor ${FLAVOR}
echo remove/cdargs: purging byte-compiled files for ${FLAVOR}
rm -f ${elc_dir}/*.elc
rm -f ${elc_dir}/*.el
if test -e ${elc_dir}; then
rmdir --ignore-fail-on-non-empty ${elc_dir}
fi
exit 0
exit 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment