Browse Source

NEW: added lua-mode

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@3458 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 13 years ago
parent
commit
0c2281bec6

+ 17 - 0
l/lua-mode/lua-mode-init.el

@@ -0,0 +1,17 @@
+;;
+;; lua-mode-init.el
+;;
+;;      for Vine Linux with emacsen-common
+;;      Munehiro Yamamoto <munepi@vinelinux.org>
+
+(defcustom vine-default-lua-mode t
+  "A boolean for vine-default-lua-mode"
+  :type 'boolean)
+
+(add-hook 'vine-default-setup-hook
+          (lambda()
+            (when vine-default-lua-mode
+                (message "Loading vine-default-lua-mode ...")
+                (require 'vine-default-lua-mode))))
+
+;;; end of file

+ 34 - 0
l/lua-mode/lua-mode-install.sh

@@ -0,0 +1,34 @@
+#! /bin/sh -e
+# /usr/lib/emacsen-common/packages/install/lua-mode
+
+FLAVOR=$1
+PACKAGE=lua-mode
+
+FLAGS="--no-site-file -q -batch -l ./lua-mode.el -f batch-byte-compile"
+
+ELDIR="/usr/share/emacs/site-lisp/${PACKAGE}"
+ELCDIR="/usr/share/${FLAVOR}/site-lisp/${PACKAGE}"
+STARTDIR=/etc/${FLAVOR}/site-start.d
+STARTFILE="${PACKAGE}-init.el"
+
+SOURCES="lua-mode.el"
+
+case "${FLAVOR}" in
+    *) 
+    echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
+    install -m 755 -d ${ELCDIR}
+    cd ${ELDIR}
+    cp *.el ${ELCDIR}
+    FILES="${SOURCES}"
+    cd ${ELCDIR}
+    ## do not byte-compile lua-mode.el
+    ${FLAVOR} ${FLAGS} ${FILES} > ${ELCDIR}/CompilationLog 2>&1
+    rm -f ${SOURCES}
+    gzip -9 ${ELCDIR}/CompilationLog
+
+    ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/95${STARTFILE};
+    echo " done."
+    ;;
+esac
+
+exit 0 ;

+ 30 - 0
l/lua-mode/lua-mode-remove.sh

@@ -0,0 +1,30 @@
+#!/bin/sh -e
+# /usr/lib/emacsen-common/packages/remove/lua-mode
+
+FLAVOR=$1
+PACKAGE=lua-mode
+STARTDIR=/etc/${FLAVOR}/site-start.d
+STARTFILE="${PACKAGE}-init.el"
+
+if [ "X${FLAVOR}" = "X" ]; then
+    echo Need argument to determin FLAVOR of emacs;
+    exit 1
+fi
+
+if [ "X${PACKAGE}" = "X" ]; then
+    echo Internal error: need package name;
+    exit 1;
+fi
+
+ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+
+case "${FLAVOR}" in
+    *)
+    echo -n "remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR} ..."
+    rm -rf ${ELCDIR}
+    rm -f ${STARTDIR}/95${STARTFILE}*
+    echo " done."
+    ;;
+esac
+
+exit 0

+ 108 - 0
l/lua-mode/lua-mode-vl.spec

@@ -0,0 +1,108 @@
+%define _noVersionedDependencies	1
+%define prereq_ge()  %(LC_ALL="C" rpm -q --queryformat 'Requires(post):%%{NAME} >= %%{VERSION}' %1| grep -v "is not")
+%define	origname lua-mode
+%define origver  20110324
+
+Summary:      Emacs major mode for editing Lua code
+Summary(ja):  Lua コード編集用 Emacs メジャーモード
+Name:         %{origname}
+Version:      %{origver}
+Release:      1%{?_dist_release}
+
+Source0:      lua-mode-%{version}.zip
+Source1:      %{origname}-install.sh
+Source2:      %{origname}-remove.sh
+Source3:      vine-default-%{origname}.el
+Source4:      %{origname}-init.el
+
+License:      GPL
+Group:        Applications/Editors/Emacs
+URL:          http://luaforge.net/projects/lua-mode/
+BuildRoot:    %{_tmppath}/%{name}-%{version}-root
+BuildArch:    noarch
+
+BuildRequires:     unzip
+
+Requires:     emacsen
+Requires(post):       emacsen
+%prereq_ge    emacsen-common
+
+Distribution: Vine Linux
+Vendor:       Project Vine
+Packager:     munepi
+
+%description
+lua-mode is an Emacs major mode for editing Lua files. 
+
+%description -l ja
+lua-mode は Lua ファイルを編集するための Emacs メジャーモードです。
+
+%prep
+
+%setup -q -c %{origname}-%{origver}
+
+%build
+
+%install
+[ "%{buildroot}" != "/" ] && %__rm -rf %{buildroot}
+[ "%{buildroot}" != "/" ] && %__mkdir_p %{buildroot}
+
+%__mkdir_p %{buildroot}%{_datadir}/emacs/site-lisp/%{origname}/packages
+%__mkdir_p %{buildroot}%{emacsen_pkgdir}/install
+%__mkdir_p %{buildroot}%{emacsen_pkgdir}/remove
+
+#
+# install el files
+#
+
+%__cp -p *.el %{SOURCE3} %{SOURCE4} %{buildroot}%{_datadir}/emacs/site-lisp/%{origname}
+
+
+#
+# install script (bytecompile el and install elc , remove)
+#
+
+%_installemacsenscript %{origname} %{SOURCE1}
+
+%_removeemacsenscript  %{origname} %{SOURCE2}
+
+
+%clean
+[ "%{buildroot}" != "/" ] && %__rm -rf %{buildroot}
+
+%post
+#
+# bytecompile and install
+#
+if [ "$1" = 2 ]; then
+
+%_emacsenPackageRemove %{origname}
+
+fi
+
+%_addemacsenlist %{origname}
+
+%_emacsenPackageInstall %{origname}
+
+
+%preun
+if [ "$1" = 0 ]; then
+
+%_emacsenPackageRemove %{origname}
+
+%_removeemacsenlist %{origname}
+
+fi
+
+
+%files
+%defattr(-,root,root)
+%doc README README.md TODO
+%{_datadir}/emacs/site-lisp/%{origname}
+%{emacsen_pkgdir}/install/%{origname}
+%{emacsen_pkgdir}/remove/%{origname}
+
+
+%changelog
+* Thu Apr 14 2011 Munehiro Yamamoto <munepi@vinelinux.org> 20110324-1
+- first release for Vine Linux

+ 21 - 0
l/lua-mode/vine-default-lua-mode.el

@@ -0,0 +1,21 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  -*- coding: utf-8-unix -*-
+;;  FSF Emacs 23 用 Vine Linux lua-mode 設定
+;;    Munehiro Yamamoto <munepi@vinelinux.org>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; lua-mode の設定
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
+(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
+(add-to-list 'interpreter-mode-alist '("lua" . lua-mode))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(provide 'vine-default-lua-mode)
+
+;; Local Variables:
+;; mode: emacs-lisp
+;; End: