tm 6.92.
[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         ((string-match "September Gnus" gnus-version)
24          (byte-compile-file "tm-sgnus.el")
25          ))
26   (byte-compile-file "tm-gnus.el")
27   )
28
29 (defconst el-file-mode (+ (* 64 6)(* 8 4) 4))
30
31 (defun install-el (path file)
32   (let ((full-path (expand-file-name file path)))
33     (if (file-exists-p full-path)
34         (set-file-modes full-path el-file-mode)
35       )
36     (copy-file file full-path t t)
37     (princ (format "%s -> %s\n" file path))
38     ))
39
40 (defun install-el-files (path &rest files)
41   (mapcar (function (lambda (file)
42                       (if (file-exists-p file)
43                           (install-el path file)
44                         )))
45           files))
46
47 (defun install-elc (path file)
48   (let ((full-path (expand-file-name file path)))
49     (copy-file file full-path t t)
50     (delete-file file)
51     (princ (format "%s -> %s\n" file path))
52     ))
53
54 (defun install-elc-files (path &rest files)
55   (mapcar (function (lambda (file)
56                       (if (file-exists-p file)
57                           (install-elc path file)
58                         )))
59           files))
60
61 (defun install-tm-gnus ()
62   (let ((path (car command-line-args-left)))
63     (princ (format "%s\n" emacs-version))
64     (if (not (file-exists-p path))
65         (make-directory path t)
66       )
67     (if (< (string-to-int emacs-version) 19)
68         (progn
69           (install-el-files path
70                             "tm-gnus.el" "tm-ognus.el"
71                             "tm-gnus3.el" "tm-gnus4.el")
72           (install-elc-files path
73                              "tm-gnus.elc"
74                              "tm-gnus3.elc" "tm-gnus4.elc")
75           )
76       (progn
77         (install-el-files path
78                           "tm-gnus.el" "tm-sgnus.el"
79                           "tm-gnus5.el" "tm-dgnus.el"
80                           "tm-ognus.el" "tm-gnus4.el")
81         (install-elc-files path
82                            "tm-gnus.elc" "tm-sgnus.elc"
83                            "tm-gnus5.elc" "tm-dgnus.elc"
84                            "tm-gnus4.elc")
85         ))))