tm 7.67.
[elisp/tm.git] / gnus / mk-tgnus
1 ;;; -*-Emacs-Lisp-*-
2 ;;;
3 ;;; $Id: mk-tgnus,v 3.0 1996/05/07 17:38:25 morioka Exp $
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          )
28         ((string-match "Gnus v5\\|September Gnus" gnus-version)
29          (require 'tm-gnus)
30          (byte-compile-file "tm-gnus4.el")
31          )
32         ((string-match "GNUS 4" gnus-version)
33          (require 'tm-gnus)
34          (byte-compile-file "tm-gnus4.el")
35          )
36         ((string-match "GNUS 3" gnus-version)
37          (require 'tm-gnus)
38          (byte-compile-file "tm-gnus3.el")
39          ))
40   ;;(byte-compile-file "tm-gnus.el")
41   )
42
43 (defconst el-file-mode (+ (* 64 6)(* 8 4) 4))
44
45 (defun install-el (path file)
46   (let ((full-path (expand-file-name file path)))
47     (if (file-exists-p full-path)
48         (set-file-modes full-path el-file-mode)
49       )
50     (copy-file file full-path t t)
51     (princ (format "%s -> %s\n" file path))
52     ))
53
54 (defun install-el-files (path &rest files)
55   (mapcar (function (lambda (file)
56                       (if (file-exists-p file)
57                           (install-el path file)
58                         )))
59           files))
60
61 (defun install-elc (path file)
62   (let ((full-path (expand-file-name file path)))
63     (copy-file file full-path t t)
64     (delete-file file)
65     (princ (format "%s -> %s\n" file path))
66     ))
67
68 (defun install-elc-files (path &rest files)
69   (mapcar (function (lambda (file)
70                       (if (file-exists-p file)
71                           (install-elc path file)
72                         )))
73           files))
74
75 (defun install-tm-gnus ()
76   (let ((path (car command-line-args-left)))
77     (princ (format "%s\n" emacs-version))
78     (if (not (file-exists-p path))
79         (make-directory path t)
80       )
81     (cond (running-emacs-18
82            (install-el-files path
83                              "tm-gnus.el"
84                              "tm-gnus3.el" "tm-gnus4.el"
85                              "tm-gd3.el")
86            (install-elc-files path
87                               ;;"tm-gnus.elc"
88                               "tm-gnus3.elc" "tm-gnus4.elc")
89            )
90           ((or (and running-emacs-19
91                     (<= emacs-minor-version 29))
92                (and running-xemacs-19
93                     (<= emacs-minor-version 13))
94                )
95            (install-el-files path
96                              "tm-gnus.el"
97                              "tm-sgnus.el" "tm-gnus4.el"
98                              "tm-gd3.el")
99            (install-elc-files path
100                               ;;"tm-gnus.elc"
101                               "tm-sgnus.elc" "tm-gnus4.elc")
102            )
103           (t
104            (install-el-files path
105                              "tm-gnus.el"
106                              "tm-sgnus.el" "tm-gnus4.el")
107            (install-elc-files path
108                               ;;"tm-gnus.elc"
109                               "tm-sgnus.elc" "tm-gnus4.elc")
110            ))
111     (setq command-line-args-left (cdr command-line-args-left))
112     ))