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