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