summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-16 11:50:13 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-16 11:51:43 +0100
commitac2d3c9eb73a2d23848c55c3171d8ff6dd0feed9 (patch)
treeacfdd71ec5cbec4d54020eaec8c5fed0a04410ed
parent1dcd4bb96ca53d5059a5f112e6422fde7b323644 (diff)
downloadgolang-ac2d3c9eb73a2d23848c55c3171d8ff6dd0feed9.tar.gz
Build golang-mode package (Courtesy of Florian Weimer)
-rw-r--r--debian/control8
-rw-r--r--debian/golang-mode.emacsen-install34
-rw-r--r--debian/golang-mode.emacsen-remove9
-rw-r--r--debian/golang-mode.emacsen-startup7
-rw-r--r--debian/golang-mode.install1
5 files changed, 59 insertions, 0 deletions
diff --git a/debian/control b/debian/control
index f17e0749b..f6255bc9f 100644
--- a/debian/control
+++ b/debian/control
@@ -71,3 +71,11 @@ Description: Tools for Google's Go programming language
garbage collection and the power of run-time reflection. It's a
fast, statically typed, compiled language that feels like a
dynamically typed, interpreted language.
+
+Package: golang-mode
+Architecture: all
+Depends: emacs23 | emacsen
+Suggests: golang-go
+Description: Go mode for GNU Emacs
+ Provides a major mode for GNU Emacs to edit programs written in Google's
+ Go programming language.
diff --git a/debian/golang-mode.emacsen-install b/debian/golang-mode.emacsen-install
new file mode 100644
index 000000000..5521e515c
--- /dev/null
+++ b/debian/golang-mode.emacsen-install
@@ -0,0 +1,34 @@
+#!/bin/sh -e
+# /usr/lib/emacsen-common/packages/install/golang-mode
+
+FLAVOR=$1
+PACKAGE=golang-mode
+
+# Do nothing if generic flavor.
+if [ ${FLAVOR} = emacs ]; then
+ exit 0;
+fi
+
+echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
+
+# The byte-compiled files goes into the site-lisp directory.
+BCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+install -m 755 -d ${BCDIR}
+
+# The elisp source files are in the generic site-list directory.
+SRCDIR=/usr/share/emacs/site-lisp/${PACKAGE}
+SRC=`find ${SRCDIR} -name '*.el' -exec basename '{}' ';'`
+
+# Prepare for byte-compiling the source files.
+cd ${BCDIR}
+ln -sf ${SRCDIR}/*.el .
+cat << EOF > path.el
+(setq load-path (cons "." load-path) byte-compile-warnings nil)
+EOF
+
+# Byte-compile elisp files.
+FLAGS="--no-site-file --no-init-file --batch -l path.el -f batch-byte-compile"
+${FLAVOR} ${FLAGS} ${SRC}
+rm -f path.el
+
+exit 0
diff --git a/debian/golang-mode.emacsen-remove b/debian/golang-mode.emacsen-remove
new file mode 100644
index 000000000..a56922eb6
--- /dev/null
+++ b/debian/golang-mode.emacsen-remove
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+# /usr/lib/emacsen-common/packages/remove/golang-mode
+FLAVOR=$1
+PACKAGE=golang-mode
+if [ ${FLAVOR} != emacs ]; then
+ echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR}
+ rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+fi
+exit 0
diff --git a/debian/golang-mode.emacsen-startup b/debian/golang-mode.emacsen-startup
new file mode 100644
index 000000000..378f11f5f
--- /dev/null
+++ b/debian/golang-mode.emacsen-startup
@@ -0,0 +1,7 @@
+;; -*-emacs-lisp-*-
+
+(let ((path "/usr/share/emacs/site-lisp/golang-mode"))
+ (when (file-exists-p path)
+ (add-to-list 'load-path path t)
+ (require 'go-mode-load)))
+
diff --git a/debian/golang-mode.install b/debian/golang-mode.install
new file mode 100644
index 000000000..1453aa7b5
--- /dev/null
+++ b/debian/golang-mode.install
@@ -0,0 +1 @@
+misc/emacs/*.el usr/share/emacs/site-lisp/golang-mode/