tm 6.78.1.
[elisp/tm.git] / gnus / mk-tgnus
1 ;;; -*-Emacs-Lisp-*-
2
3 (require 'emu)
4
5 (defun compile-tm-gnus ()
6   (require 'gnus)
7   (require 'tm-view)
8   (princ (format "%s\n" gnus-version))
9   (cond ((string-match "GNUS 3" gnus-version)
10          (byte-compile-file "tm-gnus3.el")
11          )
12         ((string-match "GNUS 4" gnus-version)
13          (byte-compile-file "tm-gnus4.el")
14          )
15         ((string-match "(ding)" gnus-version)
16          (require 'tm-dgnus)
17          (byte-compile-file "tm-dgnus.el")
18          (byte-compile-file "tm-gnus5.el")
19          )
20         ((string-match "Gnus v5" gnus-version)
21          (byte-compile-file "tm-gnus5.el")
22          ))
23   (byte-compile-file "tm-gnus.el")
24   )
25
26 (defconst el-file-mode (+ (* 64 6)(* 8 4) 4))
27
28 (defun install-el (path file)
29   (let ((full-path (expand-file-name file path)))
30     (if (file-exists-p full-path)
31         (set-file-modes full-path el-file-mode)
32       )
33     (copy-file file full-path t t)
34     (princ (format "%s -> %s\n" file path))
35     ))
36
37 (defun install-el-files (path &rest files)
38   (mapcar (function (lambda (file)
39                       (if (file-exists-p file)
40                           (install-el path file)
41                         )))
42           files))
43
44 (defun install-elc (path file)
45   (let ((full-path (expand-file-name file path)))
46     (copy-file file full-path t t)
47     (delete-file file)
48     (princ (format "%s -> %s\n" file path))
49     ))
50
51 (defun install-elc-files (path &rest files)
52   (mapcar (function (lambda (file)
53                       (if (file-exists-p file)
54                           (install-elc path file)
55                         )))
56           files))
57
58 (defun install-tm-gnus ()
59   (let ((path (car command-line-args-left)))
60     (princ (format "%s\n" emacs-version))
61     (if (not (file-exists-p path))
62         (make-directory path t)
63       )
64     (if (< (string-to-int emacs-version) 19)
65         (progn
66           (install-el-files path
67                             "tm-gnus.el" "tm-ognus.el"
68                             "tm-gnus3.el" "tm-gnus4.el")
69           (install-elc-files path
70                              "tm-gnus.elc"
71                              "tm-gnus3.elc" "tm-gnus4.elc")
72           )
73       (progn
74         (install-el-files path
75                           "tm-gnus.el" "tm-gnus5.el"
76                           "tm-dgnus.el"
77                           "tm-ognus.el" "tm-gnus4.el")
78         (install-elc-files path
79                            "tm-gnus.elc" "tm-gnus5.elc"
80                            "tm-dgnus.elc"
81                            "tm-gnus4.elc")
82         ))))