Browse Source

text-translator 0.7.1-1

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

+ 16 - 0
t/text-translator/text-translator-init.el

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

+ 35 - 0
t/text-translator/text-translator-install.sh

@@ -0,0 +1,35 @@
+#! /bin/sh -e
+# /usr/lib/emacsen-common/packages/install/text-translator
+
+FLAVOR=$1
+PACKAGE=text-translator
+
+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="text-translator.el text-translator-vars.el text-translator-load.el"
+
+case "${FLAVOR}" in
+    emacs)
+    ;;
+    *) 
+    echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
+    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 ;

+ 32 - 0
t/text-translator/text-translator-remove.sh

@@ -0,0 +1,32 @@
+#!/bin/sh -e
+# /usr/lib/emacsen-common/packages/remove/text-translator
+
+FLAVOR=$1
+PACKAGE=text-translator
+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)
+    ;;
+    *)
+    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
t/text-translator/text-translator-vl.spec

@@ -0,0 +1,108 @@
+%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 text-translator
+%define origver  0.7.1
+
+Summary:      translates the character string on Emacs
+Name:         %{origname}
+Version:      %{origver}
+Release:      1%{?_dist_release}
+
+Source0:      text-translator.el
+Source1:      text-translator-vars.el
+Source2:      text-translator-load.el
+Source3:      http://www.gnu.org/licenses/gpl-2.0.txt
+
+Source11:     %{origname}-install.sh
+Source12:     %{origname}-remove.sh
+Source13:     vine-default-%{origname}.el
+Source14:     %{origname}-init.el
+
+License:      GPLv2+
+Group:        Applications/Editors/Emacs
+URL:          http://www.emacswiki.org/emacs/TextTranslator
+BuildRoot:    %{_tmppath}/%{name}-%{version}-root
+BuildArch:    noarch
+
+Requires:     emacsen
+PreReq:       emacsen
+%prereq_ge    emacsen-common
+
+Distribution: Vine Linux
+Vendor:       Project Vine
+Packager:     iwaim
+
+%description
+translates the character string on Emacs. this packages use the text 
+translation service that exists on the Internet.
+
+%prep
+
+%setup -T -c %{origname}-%{origver}
+%{__cp} %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} .
+
+%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 %{SOURCE13} %{SOURCE14} %{buildroot}%{_datadir}/emacs/site-lisp/%{origname}
+
+
+#
+# install script (bytecompile el and install elc , remove)
+#
+
+%_installemacsenscript %{origname} %{SOURCE11}
+
+%_removeemacsenscript  %{origname} %{SOURCE12}
+
+
+%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 gpl-2.0.txt
+%{_datadir}/emacs/site-lisp/%{origname}
+%{emacsen_pkgdir}/install/%{origname}
+%{emacsen_pkgdir}/remove/%{origname}
+
+%changelog
+* Sun Mar 07 2010 IWAI, Masaharu <iwai@alib.jp> 0.7.1-1
+- first release for Vine Linux

+ 34 - 0
t/text-translator/vine-default-text-translator.el

@@ -0,0 +1,34 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  -*- coding: utf-8-unix -*-
+;;  FSF Emacs 23 用 Vine Linux text-translator 設定
+;;    IWAI, Masaharu <iwai@alib.jp>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; text-translator の設定
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(require 'text-translator)
+(global-set-key "\C-x\M-t" 'text-translator)
+
+;;  ;; set prefix-key to M-n
+;; (setq text-translator-prefix-key "\M-n")
+
+;; use translation type auto selection (english/japanese only)
+;; set function that use auto selection
+(setq text-translator-auto-selection-func
+      'text-translator-translate-by-auto-selection-enja)
+
+;; set global-key
+(global-set-key "\C-xt" 'text-translator-translate-by-auto-selection)
+
+;; ;; if you are setting environment variables HTTP_PROXY,
+;; ;; you have not to set this.
+;; (setq text-translator-proxy-server "proxy.example.com")
+;; (setq text-translator-proxy-port   8080)
+
+(provide 'vine-default-text-translator)
+
+;; Local Variables:
+;; mode: emacs-lisp
+;; End: