--- sml-mode.orig/fink/sml-mode-install +++ sml-mode/fink/sml-mode-install @@ -0,0 +1,45 @@ +#! /bin/bash -e +# +# install script for sml-mode + +set -e + +FLAVOR=${1} + +INSTALL="install -o root -g admin -m 644" +INSTDIR="${INSTALL} -m 755 -d" +srcdir=@PREFIX@/share/emacs/site-lisp/sml-mode +elc_dir=@PREFIX@/share/${FLAVOR}/site-lisp/sml-mode +startupdir="@PREFIX@/etc/${FLAVOR}/site-start.d" +logfile=${elc_dir}/CompilationLog + +do_install () { + echo -n >&2 "install/sml-mode: Setting up for ${FLAVOR}... " \ + "(log file: ${logfile})... " + + ${INSTDIR} ${elc_dir} + umask 0022 + + # Copy the temp .el files + cp ${srcdir}/*.el ${srcdir}/Makefile ${srcdir}/makefile.pkg ${elc_dir}/ + + # Create sml-mode-startup.el and byte-compile the .el files + (cd ${elc_dir} && make -f Makefile EMACS=${FLAVOR} sml-mode-startup.el elcfiles) >${logfile} 2>&1 + (test -d ${startupdir} || ${INSTDIR} ${startupdir}) + mv ${elc_dir}/sml-mode-startup.el ${startupdir}/50sml-mode.el + + # Get rid of the temp .el files + rm ${elc_dir}/*.el ${elc_dir}/Makefile ${elc_dir}/makefile.pkg ${elc_dir}/*~ + + echo >&2 "done." + return 0 +} + +case "${FLAVOR}" in + (emacs) : ;; + (*) echo >&2 "install/sml-mode:" + do_install + ;; +esac + +exit 0 --- sml-mode.orig/fink/sml-mode-remove +++ sml-mode/fink/sml-mode-remove @@ -0,0 +1,29 @@ +#! /bin/bash -e +# +# remove script for sml-mode + +set -e + +FLAVOR=${1} +srcdir=@PREFIX@/share/emacs/site-lisp/sml-mode +elc_dir=@PREFIX@/share/${FLAVOR}/site-lisp/sml-mode +startupdir="@PREFIX@/etc/${FLAVOR}/site-start.d" + +undo_install () { + echo -n >&2 "remove/sml-mode: Removing for ${FLAVOR}... " + rm -f ${elc_dir}/*.elc ${elc_dir}/CompilationLog + ls ${elc_dir} + [ -d ${elc_dir} -a `ls -la ${elc_dir} | wc -l` -lt 4 ] && rmdir ${elc_dir} + rm $startupdir/50sml-mode.el + echo >&2 "done." + return 0 +} + +case "${FLAVOR}" in + (emacs) : ;; + (*) echo >&2 "remove/sml-mode:" + undo_install + ;; +esac + +exit 0