Browse Source

add: js2-mode spec and files

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@741 ec354946-7b23-47d6-9f5a-488ba84defc7
iwaim 14 years ago
parent
commit
bf6ccee985

+ 16 - 0
j/js2-mode/js2-mode-init.el

@@ -0,0 +1,16 @@
+;;
+;; js2-mode-init.el
+;;
+;;      for Vine Linux with emacsen-common
+;;      IWAI, Masaharu <iwai@alib.jp>
+
+(defcustom vine-default-js2-mode t
+  "A boolean for vine-default-js2-mode"
+  :type 'boolean)
+
+(add-hook 'vine-default-setup-hook
+          (lambda()
+            (if vine-default-js2-mode
+                (require 'vine-default-js2-mode))))
+
+;;; end of file

+ 36 - 0
j/js2-mode/js2-mode-install.sh

@@ -0,0 +1,36 @@
+#! /bin/sh -e
+# /usr/lib/emacsen-common/packages/install/js2-mode
+
+FLAVOR=$1
+PACKAGE=js2-mode
+
+FLAGS="${SITEFLAG} -q -batch -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="js2.el"
+
+case "${FLAVOR}" in
+    emacs)
+	;;
+    xemacs*)
+	;;
+    *) 
+	install -m 755 -d ${ELCDIR}
+	cd ${ELDIR}
+	cp *.el ${ELCDIR}
+	FILES="${SOURCES}"
+	cd ${ELCDIR}
+	${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 ;

+ 34 - 0
j/js2-mode/js2-mode-remove.sh

@@ -0,0 +1,34 @@
+#!/bin/sh -e
+# /usr/lib/emacsen-common/packages/remove/js2-mode
+
+FLAVOR=$1
+PACKAGE=js2-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
+    emacs)
+	;;
+    xemacs*)
+	;;
+    *)
+	echo -n "remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR} ..."
+	rm -rf ${ELCDIR}
+	rm -f ${STARTDIR}/95${STARTFILE}*
+	echo " done."
+	;;
+esac
+
+exit 0

+ 118 - 0
j/js2-mode/js2-mode-vl.spec

@@ -0,0 +1,118 @@
+%define _noVersionedDependencies	1
+%define prereq_ge()  %(LC_ALL="C" rpm -q --queryformat 'PreReq:%%{NAME} >= %%{VERSION}' %1| grep -v "is not")
+%define emacsen_pkgdir /usr/lib/emacsen-common/packages
+%define	origname js2-mode
+%define origver  20090723b
+
+Summary:      An improved JavaScript mode for GNU Emacs
+Name:         %{origname}
+Version:      %{origver}
+Release:      1%{?_dist_release}
+
+Source0:      http://js2-mode.googlecode.com/files/js2-%{origver}.el
+Source1:      %{origname}-install.sh
+Source2:      %{origname}-remove.sh
+Source3:      vine-default-%{origname}.el
+Source4:      %{origname}-init.el
+
+License:      GPLv2
+Group:        Applications/Editors/Emacs
+URL:          http://code.google.com/p/js2-mode/
+BuildRoot:    %{_tmppath}/%{name}-%{version}-root
+BuildArch:    noarch
+
+Requires:     emacsen
+PreReq:       emacsen
+%prereq_ge    emacsen-common
+
+Distribution: Vine Linux
+Vendor:       Project Vine
+Packager:     iwaim
+
+%description
+An improved JavaScript mode for GNU Emacs.
+
+Features:
+
+    * variable (adjustable) indentation
+    * accurate syntax highlighting
+    * highlighting of syntactic errors and many semantic errors
+    * strict-mode warning reporting (such as duplicate var declaration)
+    * smart line-wrapping in comments and strings
+    * typing helpers (e.g. matching quotes/brackets)
+    * code-folding (collapse element as {...})
+    * supports JavaScript 1.5, 1.6 (including E4X), 1.7 and 1.8
+    * customizable colors, or use font-lock defaults
+    * many customization options 
+
+Note - this mode is for GNU Emacs, version 22 and higher. It does not support XEmacs.
+
+%prep
+
+%setup -q -T -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 %{SOURCE0} %{buildroot}%{_datadir}/emacs/site-lisp/%{origname}/js2.el
+cp -p %{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)
+%{_datadir}/emacs/site-lisp/%{origname}
+%{emacsen_pkgdir}/install/%{origname}
+%{emacsen_pkgdir}/remove/%{origname}
+
+%changelog
+* Sat Jan 16 2010 IWAI, Masaharu <iwai@alib.jp> 20090723b-1
+- first release for Vine Linux
+

+ 19 - 0
j/js2-mode/vine-default-js2-mode.el

@@ -0,0 +1,19 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  -*- coding: utf-8-unix -*-
+;;  FSF Emacs 23 用 Vine Linux js2-mode 設定
+;;    IWAI, Masaharu <iwai@alib.jp>
+;;      $Id$
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; js2-mode の設定
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(autoload 'js2-mode "js2" nil t)
+(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
+
+(provide 'vine-default-js2-mode)
+
+;; Local Variables:
+;; mode: emacs-lisp
+;; End: