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