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