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