fixing startup and install scripts of ocaml-mode
authorHendrik Tews <hendrik@askra.de>
Fri, 11 May 2012 11:41:03 +0000 (13:41 +0200)
committerHendrik Tews <hendrik@askra.de>
Fri, 11 May 2012 11:41:03 +0000 (13:41 +0200)
debian/changelog
debian/control
debian/ocaml-mode.emacsen-install
debian/ocaml-mode.emacsen-startup

index adde36f361118ddf11ca3aaf7d3e1a4a1f8bd996..d7fb55a4d1b5bb2f083c00286393b981d09f76fa 100644 (file)
@@ -1,3 +1,14 @@
+ocaml (3.12.1-3) UNRELEASED; urgency=low
+
+  * Fixes in startup and install files of ocaml-mode:
+    - symlink *el files into elc dir (Closes: #452340)
+    - use debian-pkg-add-load-path-item in emacsen-startup and emacsen-install
+      (Closes: 671559)
+    - compile el files with site-file enabled
+    - use debian-emacs-flavor in emacsen-startup (see #662163)
+
+ -- Hendrik Tews <hendrik@askra.de>  Fri, 11 May 2012 00:00:35 +0200
+
 ocaml (3.12.1-2) unstable; urgency=low
 
   * Fix compilation on kfreebsd-any: do not add -R$dir in X11 link options
index cf7add4a52704988f9a6802aea1dc9f81aeb6dbe..9cdfca9ff6f2a2638839466123db33647ac339b4 100644 (file)
@@ -263,6 +263,8 @@ Description: OCaml interpreter and standard libraries
 
 Package: ocaml-mode
 Architecture: all
+Pre-Depends:
+ emacsen-common (>= 1.4.14)
 Depends:
  emacs23 | emacsen,
  ${shlibs:Depends},
index a23b15953ae5d6d5512d183fbe8ea982cde0b426..8aa5eb0e19a22ffff542045919b0e1594d6831ff 100644 (file)
@@ -12,16 +12,17 @@ if [ ${FLAVOR} = emacs ]; then exit 0; fi
 
 echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
 
-FLAVORTEST=`echo $FLAVOR | cut -c-6`
-if [ ${FLAVORTEST} = xemacs ] ; then
-    SITEFLAG="-no-site-file"
-else
-    SITEFLAG="--no-site-file"
-fi
+FLAVORTEST=`echo $FLAVOR | cut -c-6`
+if [ ${FLAVORTEST} = xemacs ] ; then
+    SITEFLAG="-no-site-file"
+else
+    SITEFLAG="--no-site-file"
+fi
 FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"
 
 ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
 ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+RELELDIR=../../../emacs/site-lisp/${PACKAGE}
 
 # Install-info-altdir does not actually exist. 
 # Maybe somebody will write it.
@@ -43,13 +44,17 @@ case "${FLAVOR}" in
        ;;
 
 esac
-cp ${FILES} ${ELCDIR}
+
 cd ${ELCDIR}
+for f in ${FILES} ; do
+    ln -sf ${RELELDIR}/$f .
+done
 
 cat << EOF > path.el
-(setq load-path (cons "." load-path) byte-compile-warnings nil)
+(debian-pkg-add-load-path-item ".")
+(setq byte-compile-warnings nil)
 EOF
 ${FLAVOR} ${FLAGS} ${FILES}
-rm -f *.el path.el
+rm -f path.el
 
 exit 0
index ca3f43e5c7b93800fd284f1442a184587321bd5f..e6f01bad61c643f4de90415bf6a09cf84cea92a4 100644 (file)
 ;; xemacs19, emacs20, xemacs20...).  The compiled code is then
 ;; installed in a subdirectory of the respective site-lisp directory.
 ;; We have to add this to the load-path:
-(setq load-path
-      (nconc load-path
-            (list (concat "/usr/share/"
-                          (symbol-name flavor)
-                          "/site-lisp/ocaml-mode"))))
-(setq auto-mode-alist
+(let ((package-dir (concat "/usr/share/"
+                           (symbol-name debian-emacs-flavor)
+                           "/site-lisp/ocaml-mode")))
+;; If package-dir does not exist, the #PACKAGE# package must have
+;; removed but not purged, and we should skip the setup.
+  (when (file-directory-p package-dir)
+    (debian-pkg-add-load-path-item package-dir)
+    (setq auto-mode-alist
           (cons '("\\.ml[iylp]?\\'" . caml-mode) auto-mode-alist))
-(autoload 'caml-mode "caml" "Major mode for editing Caml code." t)
-(autoload 'run-caml "inf-caml" "Run an inferior Caml process." t)
+    (autoload 'caml-mode "caml" "Major mode for editing Caml code." t)
+    (autoload 'run-caml "inf-caml" "Run an inferior Caml process." t)))