Browse Source

update: navi2ch 2.0.0-2

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

+ 22 - 0
n/navi2ch/navi2ch-1.7.5-emacs22.patch

@@ -0,0 +1,22 @@
+--- navi2ch-1.7.5/navi2ch-net.el.emacs22	2005-09-20 02:47:30.000000000 +0900
++++ navi2ch-1.7.5/navi2ch-net.el	2005-09-20 02:47:56.000000000 +0900
+@@ -281,7 +281,7 @@
+ 	     (while (re-search-forward "^\\([^\r\n:]+\\): \\(.+\\)\r\n" end t)
+ 	       (setq list (cons (cons (match-string 1) (match-string 2))
+ 				list)))
+-	     (let ((date (assoc-ignore-case "Date" list)))
++	     (let ((date (assoc-string "Date" list t)))
+ 	       (when (and date (stringp (cdr date)))
+ 		 (setq navi2ch-net-last-date (cdr date))))
+ 	     (setq navi2ch-net-header (nreverse list))))))))
+--- navi2ch-1.7.5/navi2ch-util.el.emacs22	2005-09-20 02:47:40.000000000 +0900
++++ navi2ch-1.7.5/navi2ch-util.el	2005-09-20 02:48:12.000000000 +0900
+@@ -369,7 +369,7 @@
+ (defsubst navi2ch-replace-html-tag-to-string (str)
+   (let ((ret
+ 	 (or (cdr (if case-fold-search
+-		      (assoc-ignore-case str navi2ch-replace-html-tag-alist)
++		      (assoc-string str navi2ch-replace-html-tag-alist t)
+ 		    (assoc str navi2ch-replace-html-tag-alist)))
+ 	     (save-match-data
+ 	       (let ((alist navi2ch-replace-html-tag-regexp-alist)

+ 16 - 0
n/navi2ch/navi2ch-init.el

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

+ 97 - 0
n/navi2ch/navi2ch-install.sh

@@ -0,0 +1,97 @@
+#! /bin/sh -e
+#  /usr/lib/emacsen-common/packages/install/navi2ch
+# [ This particular script hasn't been tested, so be careful. ]
+
+set -e
+
+FLAVOR=$1
+PACKAGE="navi2ch"
+VERSION="2.0.0"
+
+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
+
+ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
+ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+
+STARTDIR=/etc/${FLAVOR}/site-start.d
+STARTFILE="${PACKAGE}-init.el";
+
+SITELISP=/usr/share/${FLAVOR}/site-lisp
+
+STAMP=${ELCDIR}/compile-stamp
+
+compile() {
+
+    echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
+    
+    if [ -e ${STAMP} ]; then
+	if [ "${VERSION}" = "`cat ${STAMP}`" ]; then
+	    echo " exited. (already compiled)" 
+	    exit
+	fi
+    fi
+    
+    rm -rf ${ELCDIR}
+    install -m 755 -d ${ELCDIR}
+    
+    cd ${ELDIR}
+    #rm -f config.*
+    ./configure --with-lispdir=${ELCDIR} > ${ELCDIR}/CompilationLog 2>&1
+    ## Unrecognized options: --with-xemacs, --with-emacs in ./configure
+    make clean >> ${ELCDIR}/CompilationLog 2>&1
+    make EMACS=${FLAVOR} >> ${ELCDIR}/CompilationLog 2>&1
+    #make EMACS=${FLAVOR} -C contrib >> ${ELCDIR}/CompilationLog 2>&1
+    make INSTALLPATH=${ELCDIR} install >> ${ELCDIR}/CompilationLog 2>&1
+    #make INSTALLPATH=${ELCDIR} install -C contrib >> ${ELCDIR}/CompilationLog 2>&1
+    make clean >> ${ELCDIR}/CompilationLog 2>&1
+    #rm -f config.*
+    rm ${ELCDIR}/*.el
+    
+    #if [ -e /usr/share/info/navi2ch.info.gz ]; then
+    #   rm -f /usr/share/info/navi2ch.info*.gz
+    #fi
+
+    gzip -9 ${ELCDIR}/CompilationLog
+    #gzip -9 /usr/share/info/navi2ch.info
+    echo ${VERSION} > ${STAMP}
+    
+    install -p -m644 ${ELDIR}/vine-default-${PACKAGE}.el ${ELCDIR}
+    ln -f -s ${ELDIR}/${STARTFILE} ${STARTDIR}/90${STARTFILE};
+    echo " done."
+}
+
+case "${FLAVOR}" in
+
+    emacs-20*)
+	echo "Not Support"
+	;;
+
+    emacs-21*)
+	compile
+	;;
+
+    emacs-22*)
+	compile
+	;;
+
+    xemacs-*)
+	compile
+	;;
+
+    emacs-23*)
+	compile
+	;;
+    
+    *)
+	;;
+esac
+
+exit 0;

+ 94 - 0
n/navi2ch/navi2ch-machibbs.el-r1.32.patch

@@ -0,0 +1,94 @@
+diff -uNr navi2ch.orig/navi2ch-machibbs.el navi2ch/navi2ch-machibbs.el
+--- navi2ch.orig/navi2ch-machibbs.el	2008-08-26 23:01:44.000000000 +0900
++++ navi2ch/navi2ch-machibbs.el	2009-12-20 17:43:40.000000000 +0900
+@@ -1,6 +1,6 @@
+ ;;; navi2ch-machibbs.el --- View machiBBS module for Navi2ch. -*- coding: iso-2022-7bit; -*-
+ 
+-;; Copyright (C) 2002, 2003, 2004 by Navi2ch Project
++;; Copyright (C) 2002, 2003, 2004, 2009 by Navi2ch Project
+ 
+ ;; Author:
+ ;; Part5 $B%9%l$N(B 509 $B$NL>L5$7$5$s(B
+@@ -30,7 +30,7 @@
+ ;;; Code:
+ (provide 'navi2ch-machibbs)
+ (defconst navi2ch-machibbs-ident
+-  "$Id: navi2ch-machibbs.el,v 1.30 2008/08/26 14:01:44 nawota Exp $")
++  "$Id: navi2ch-machibbs.el,v 1.32 2009/02/25 16:55:10 nawota Exp $")
+ 
+ (eval-when-compile (require 'cl))
+ (require 'navi2ch-multibbs)
+@@ -76,8 +76,8 @@
+ (navi2ch-multibbs-defcallback navi2ch-machibbs-subject-callback (machibbs)
+   "subject.txt $B$r<hF@$9$k$H$-(B navi2ch-net-update-file
+ $B$G;H$o$l$k%3!<%k%P%C%/4X?t(B"
+-  (while (re-search-forward "\\([0-9]+\\.\\)cgi\\([^\n]+\n\\)" nil t)
+-    (replace-match "\\1dat\\2")))
++  (while (re-search-forward "[0-9]+<>\\([0-9]+\\)<>\\([^\n]+\n\\)" nil t)
++    (replace-match "\\1.dat<>\\2")))
+ 
+ (defun navi2ch-machibbs-article-update (board article start)
+   "BOARD ARTICLE $B$N5-;v$r99?7$9$k!#(B
+@@ -88,26 +88,26 @@
+ 	(url  (navi2ch-machibbs-article-to-url board article start nil start))
+ 	(func (if start 'navi2ch-machibbs-article-callback-diff
+ 		'navi2ch-machibbs-article-callback)))
++    (message "URL %s" url)
+     (navi2ch-net-update-file url file time func nil start)))
+ 
+ (defun navi2ch-machibbs-article-to-url (board article &optional start end nofirst)
+   "BOARD, ARTICLE $B$+$i(B url $B$KJQ49!#(B
+-START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B" ; $B8z$+$J$+$C$?$i65$($F$/$@$5$$!#(B
+-  (let ((uri   (cdr (assq 'uri board)))
+-	(artid (cdr (assq 'artid article))))
+-    (string-match "\\(.*\\)\\/\\([^/]*\\)\\/" uri) ; \\/ --> / ?
+-    (concat
+-     (format "%s/bbs/read.pl?BBS=%s&KEY=%s"
+-	     (match-string 1 uri) (match-string 2 uri) artid)
+-     (if (and (stringp start)
+-	      (string-match "l\\([0-9]+\\)" start))
+-	 (format "&LAST=%s" (match-string 1 start))
+-       (concat
+-	(and start (format "&START=%d" start))
+-	(and end (format "&END=%d" end))))
+-     (and nofirst
+-	  (not (eq start 1))
+-	  "&NOFIRST=TRUE"))))
++START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B"
++  (let ((uri (navi2ch-board-get-uri board))
++	(start (if (numberp start)
++		   (number-to-string start)
++		 start))
++	(end (if (numberp end)
++		 (number-to-string end)
++	       end)))
++    (if (string-match "\\(.+\\)/\\([^/]+\\)/$" uri)
++	(format "%s/bbs/read.cgi/%s/%s/%s"
++		(match-string 1 uri) (match-string 2 uri)
++		(cdr (assq 'artid article))
++		(if (equal start end)
++		    (or start "")
++		  (concat start (and (or start end) "-") end))))))
+ 
+ (defun navi2ch-machibbs-url-to-board (url)
+   "url $B$+$i(B BOARD $B$KJQ49!#(B"
+@@ -228,10 +228,14 @@
+   (navi2ch-machibbs-article-callback t))
+ 
+ (defun navi2ch-machibbs-board-update (board)
+-  (let ((url (navi2ch-board-get-url board))
+-	(file (navi2ch-board-get-file-name board))
+-	(time (cdr (assq 'time board)))
+-	(func (navi2ch-multibbs-subject-callback board)))
+-    (navi2ch-net-update-file url file time func)))
++  (let ((uri (navi2ch-board-get-uri board)))
++    (when (string-match "\\(.+\\)/\\([^/]+\\)/$" uri)
++      (let ((url (format "%s/bbs/offlaw.cgi/%s/"
++			 (match-string 1 uri)
++			 (cdr (assq 'id board))))
++	    (file (navi2ch-board-get-file-name board))
++	    (time (cdr (assq 'time board)))
++	    (func (navi2ch-multibbs-subject-callback board)))
++	(navi2ch-net-update-file url file time func)))))
+ 
+ ;;; navi2ch-machibbs.el ends here

+ 38 - 0
n/navi2ch/navi2ch-remove.sh

@@ -0,0 +1,38 @@
+#!/bin/sh
+# /usr/lib/emacsen-common/packages/remove/navi2vh
+# [ This particular script hasn't been tested either, so be careful. ]
+set -e
+
+FLAVOR=$1
+PACKAGE="navi2ch"
+
+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
+
+ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
+ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+STARTDIR=/etc/${FLAVOR}/site-start.d
+STARTFILE="${PACKAGE}-init.el";
+
+SITELISP=/usr/share/${FLAVOR}/site-lisp
+
+
+case "${FLAVOR}" in
+	emacs)
+	;;
+	*)
+	echo -n "remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR} ..."
+	rm -rf ${ELCDIR}
+	rm -f ${STARTDIR}/90${STARTFILE}*;
+	echo " done."
+	;;
+esac
+
+exit 0;

+ 14 - 13
n/navi2ch/navi2ch-vl.spec

@@ -11,14 +11,16 @@ Summary:	2ch client on Emacsen
 Summary(ja):	(X)Emacsで動く2ちゃんねるクライアントです
 Name:		%{Name}
 Version:	%{Version}
-Release:	1%{?_dist_release}
+Release:	2%{?_dist_release}
 License:	GPL
 Group:		Applications/Editors/Emacs
 #Source:	http://prdownloads.sourceforge.net/%{Name}/%{Name}-%{Version}.tar.gz
 Source:		http://prdownloads.sourceforge.net/%{Name}/%{Name}-20080929.tar.gz
 Source1:	navi2ch-install.sh
 Source2:	navi2ch-remove.sh
-Source3:	navi2ch-init.el
+Source3:	vine-default-navi2ch.el
+Source4:	navi2ch-init.el
+Patch1:		navi2ch-machibbs.el-r1.32.patch
 Patch10:	navi2ch-1.7.5-emacs22.patch
 BuildRoot:	%{_tmppath}/%{Name}-%{Version}-root
 URL:		http://navi2ch.sourceforge.net/
@@ -41,16 +43,6 @@ navi2chの特徴
 
 キーバインドについては、info を参照して下さい。
 
-
-Emacs/XEmacs 起動時に以下の設定ファイルを読み込みます。
-M-x navi2ch で起動します。
-
-/etc/emacs-??.?/site-start.d/90navi2ch-init.el
-/etc/xemacs-??.?.??/site-start.d/90navi2ch-init.e
-
-ユーザー単位で設定ファイルに変更を加えたい場合は、上記設定ファイルを
-~/ へコピーして ~/.emacs.my.el から読み込む等してください。
-
 monafont を使いたい場合は、~/.navi2ch/init.el に、
 (setq navi2ch-mona-enable t)
 を記述して下さい。
@@ -58,6 +50,7 @@ monafont を使いたい場合は、~/.navi2ch/init.el に、
 %prep
 #%setup -q -n %{Name}-%{Version}
 %setup -q -n %{Name}
+%patch1 -p1
 #%patch10 -p1
 
 %build
@@ -78,7 +71,7 @@ mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/emacsen-common/packages/remove
 #
 
 #cp Makefile *.el ${RPM_BUILD_ROOT}/usr/share/emacs/site-lisp/%{origname}
-cp -a * %{SOURCE3} ${RPM_BUILD_ROOT}/usr/share/emacs/site-lisp/%{origname}
+cp -a * %{SOURCE3} %{SOURCE4} ${RPM_BUILD_ROOT}/usr/share/emacs/site-lisp/%{origname}
 
 #
 # install  script( bytecompile el and install elc , remove )
@@ -153,6 +146,14 @@ rm -rf ${RPM_BUILD_DIR}/%{Name}-%{Version}
 
 
 %changelog
+* Mon Dec 21 2009 IWAI, Masaharu <iwai@alib.jp> 2.0.0-2
+- apply vine-default
+  - rename navi2ch-init.el to vine-default-navi2ch.el (Source3)
+  - add navi2ch-init.el (Source4)
+  - update nav2ch-install.sh
+- add navi2ch-machibbs.el-r1.32.patch (Patch1) :fixed <BTS:VineLinux:860>
+- refactoring for nav2ch-install.sh
+
 * Tue Sep 29 2008 Hiroaki Irokawa <irorinrin @ terra.dti.ne.jp> 2.0.0-1vl5
 - Sync with cvs trunk(20080929)
 

+ 22 - 0
n/navi2ch/vine-default-navi2ch.el

@@ -0,0 +1,22 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  -*- coding: utf-8-unix -*-
+;;  FSF Emacs 23 用 Vine Linux Navi2ch 設定
+;;    Hiroaki Irokawa <irorin@terra.dti.ne.jp> (created base)
+;;    IWAI, Masaharu <iwai@alib.jp>
+;;      $Id$
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; navi の設定
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(autoload 'navi2ch "navi2ch" "Navigator for 2ch for Emacs" t)
+(setq navi2ch-icon-directory "/usr/share/emacs/site-lisp/navi2ch/icons")
+;(setq navi2ch-list-bbstable-url "http://azlucky.s25.xrea.com/2chboard/bbsmenu.html")
+(setq navi2ch-article-auto-range nil) ;スレを全部表示
+
+(provide 'vine-default-navi2ch)
+
+;; Local Variables:
+;; mode: emacs-lisp
+;; End: