tm 7.41.2.
[elisp/tm.git] / gnus / mk-tgnus
1 ;;; -*-Emacs-Lisp-*-
2 ;;;
3 ;;; $Id: mk-tgnus,v 2.0 1995/12/25 05:47:03 morioka Exp morioka $
4 ;;;
5
6 (setq load-path
7       (append
8        (mapcar (function
9                 (lambda (path)
10                   (expand-file-name path (getenv "PWD"))
11                   ))
12                '("." ".." "../../tl/" "../../mel/"))
13        load-path))
14
15 (require 'emu)
16
17 (defun compile-tm-gnus ()
18   (load "gnus.el")
19   (require 'nntp)
20   (require 'tm-view)
21   (require 'tm-partial)
22   (require 'tm-edit)
23   (princ (format "%s\n" gnus-version))
24   (cond ((boundp 'gnus-original-article-buffer)
25          (require 'tm-gnus)
26          (byte-compile-file "tm-sgnus.el")
27          (byte-compile-file "tm-gd5.el")
28          )
29         ((string-match "Gnus v5\\|September Gnus" gnus-version)
30          (require 'tm-gnus)
31          (byte-compile-file "tm-gnus4.el")
32          (byte-compile-file "tm-gd5.el")
33          )
34         ((string-match "GNUS 4" gnus-version)
35          (require 'tm-gnus)
36          (byte-compile-file "tm-gnus4.el")
37          )
38         ((string-match "GNUS 3" gnus-version)
39          (require 'tm-gnus)
40          (byte-compile-file "tm-gnus3.el")
41          ))
42   ;;(byte-compile-file "tm-gnus.el")
43   )
44
45 (defconst el-file-mode (+ (* 64 6)(* 8 4) 4))
46
47 (defun install-el (path file)
48   (let ((full-path (expand-file-name file path)))
49     (if (file-exists-p full-path)
50         (set-file-modes full-path el-file-mode)
51       )
52     (copy-file file full-path t t)
53     (princ (format "%s -> %s\n" file path))
54     ))
55
56 (defun install-el-files (path &rest files)
57   (mapcar (function (lambda (file)
58                       (if (file-exists-p file)
59                           (install-el path file)
60                         )))
61           files))
62
63 (defun install-elc (path file)
64   (let ((full-path (expand-file-name file path)))
65     (copy-file file full-path t t)
66     (delete-file file)
67     (princ (format "%s -> %s\n" file path))
68     ))
69
70 (defun install-elc-files (path &rest files)
71   (mapcar (function (lambda (file)
72                       (if (file-exists-p file)
73                           (install-elc path file)
74                         )))
75           files))
76
77 (defun install-tm-gnus ()
78   (let ((path (car command-line-args-left)))
79     (princ (format "%s\n" emacs-version))
80     (if (not (file-exists-p path))
81         (make-directory path t)
82       )
83     (cond ((< (string-to-int emacs-version) 19)
84            (install-el-files path
85                              "tm-gnus.el"
86                              "tm-gnus3.el" "tm-gnus4.el"
87                              "tm-gd3.el")
88            (install-elc-files path
89                               ;;"tm-gnus.elc"
90                               "tm-gnus3.elc" "tm-gnus4.elc")
91            )
92           ((<= emacs-minor-version 29)
93            (install-el-files path
94                              "tm-gnus.el"
95                              "tm-sgnus.el" "tm-gnus4.el"
96                              "tm-gd5.el" "tm-gd3.el")
97            (install-elc-files path
98                               ;;"tm-gnus.elc"
99                               "tm-sgnus.elc" "tm-gnus4.elc"
100                               "tm-gd5.elc")
101            )
102           (t
103            (install-el-files path
104                              "tm-gnus.el"
105                              "tm-sgnus.el" "tm-gnus4.el"
106                              "tm-gd5.el")
107            (install-elc-files path
108                               ;;"tm-gnus.elc"
109                               "tm-sgnus.elc" "tm-gnus4.elc"
110                               "tm-gd5.elc")
111            ))
112     (setq command-line-args-left (cdr command-line-args-left))
113     ))