Browse Source

new: rpm-spec-mode

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

+ 16 - 0
r/rpm-spec-mode/rpm-spec-mode-init.el

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

+ 35 - 0
r/rpm-spec-mode/rpm-spec-mode-install.sh

@@ -0,0 +1,35 @@
+#! /bin/sh -e
+# /usr/lib/emacsen-common/packages/install/rpm-spec-mode
+
+FLAVOR=$1
+PACKAGE=rpm-spec-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="rpm-spec-mode.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
r/rpm-spec-mode/rpm-spec-mode-remove.sh

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

+ 100 - 0
r/rpm-spec-mode/rpm-spec-mode-vl.spec

@@ -0,0 +1,100 @@
+%define _noVersionedDependencies	1
+%define prereq_ge()  %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} >= %%{VERSION}' %1| grep -v "is not")
+%define	origname rpm-spec-mode
+%define origver  0.12
+
+Summary:      RPM spec file editing commands for Emacs/XEmacs
+Name:         %{origname}
+Version:      %{origver}
+Release:      1%{?_dist_release}
+
+Source0:      http://www.tihlde.org/~stigb/rpm-spec-mode.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://www.emacswiki.org/emacs/RpmSpecMode
+BuildRoot:    %{_tmppath}/%{name}-%{version}-root
+BuildArch:    noarch
+
+Requires:     emacsen
+%prereq_ge    emacsen-common
+
+Distribution: Vine Linux
+Vendor:       Project Vine
+Packager:     iwaim
+
+%description
+RPM spec file editing commands for Emacs/XEmacs
+
+%prep
+
+%setup -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} %{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
+* Thu Sep 02 2010 IWAI, Masaharu <iwai@alib.jp> 0.12-1
+- first release for Vine Linux

+ 28 - 0
r/rpm-spec-mode/vine-default-rpm-spec-mode.el

@@ -0,0 +1,28 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  -*- coding: utf-8-unix -*-
+;;  FSF Emacs 23 用 Vine Linux rpm-spec-mode 設定
+;;    IWAI, Masaharu <iwai@alib.jp>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; rpm-spec-mode の設定
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; ad-hoc: defined rpm-spec-*
+(if
+    (> (length user-mail-address) 1)
+    (setq rpm-spec-user-mail-address user-mail-address))
+(if
+    (> (length user-full-name) 1)
+    (setq rpm-spec-user-full-name user-full-name))
+
+;; autoload
+(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode." t)
+(setq auto-mode-alist (append '(("\\.spec" . rpm-spec-mode))
+			      auto-mode-alist))
+
+(provide 'vine-default-rpm-spec-mode)
+
+;; Local Variables:
+;; mode: emacs-lisp
+;; End: