From: yamaoka Date: Thu, 2 Nov 2000 11:08:06 +0000 (+0000) Subject: * Makefile.in (install-package-ja): Compile and install lisp files first. X-Git-Tag: t-gnus-6_14-quimby-before-installer-changed-~22 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=305c0e5a4dcc0685370b317b7bc17080eb4e48b5;p=elisp%2Fgnus.git- * Makefile.in (install-package-ja): Compile and install lisp files first. (install-package): Ditto. (compose-package, install-package-info-ja, install-package-info, install-package-lick): New sub targets. * lisp/Makefile.in (install-package-info-ja, install-package-info, install-package-lick): New targets. (compose-package): Rename from `package'. (install-package): Remove. * lisp/dgnushack.el (dgnushack-install-package-info-ja, dgnushack-install-package-info, dgnushack-install-package-lick, dgnushack-install-package-pkginfo, dgnushack-install-package-info-files, dgnushack-make-manifest, dgnushack-gnus-product-name, dgnushack-examine-package-dir, dgnushack-make-autoloads): New functions. (dgnushack-install-package): Remove. (dgnushack-compose-package): Rename from `dgnushack-make-package'. (dgnushack-info-file-regexp-ja, dgnushack-info-file-regexp): Split from `dgnushack-info-file-regexp'. (dgnushack-texi-file-regexp): Remove. --- diff --git a/ChangeLog b/ChangeLog index 9053ed4..d242e80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2000-11-02 Katsumi Yamaoka + + * Makefile.in (install-package-ja): Compile and install lisp files + first. + (install-package): Ditto. + (compose-package, install-package-info-ja, install-package-info, + install-package-lick): New sub targets. + + * lisp/Makefile.in (install-package-info-ja, install-package-info, + install-package-lick): New targets. + (compose-package): Rename from `package'. + (install-package): Remove. + + * lisp/dgnushack.el (dgnushack-install-package-info-ja, + dgnushack-install-package-info, dgnushack-install-package-lick, + dgnushack-install-package-pkginfo, + dgnushack-install-package-info-files, dgnushack-make-manifest, + dgnushack-gnus-product-name, dgnushack-examine-package-dir, + dgnushack-make-autoloads): New functions. + (dgnushack-install-package): Remove. + (dgnushack-compose-package): Rename from `dgnushack-make-package'. + (dgnushack-info-file-regexp-ja, dgnushack-info-file-regexp): Split + from `dgnushack-info-file-regexp'. + (dgnushack-texi-file-regexp): Remove. + 2000-11-01 Katsumi Yamaoka * lisp/dgnushack.el (dgnushack-texi-format): Remove @ignore'd areas diff --git a/Makefile.in b/Makefile.in index a71fdaa..f0c8650 100644 --- a/Makefile.in +++ b/Makefile.in @@ -17,7 +17,7 @@ lick: install: install-lisp install-info -install-ja: install-lisp install-info install-info-ja +install-ja: install install-info-ja install-lisp: cd lisp && $(MAKE) EMACS="$(EMACS)" lispdir="$(lispdir)" install @@ -28,20 +28,31 @@ install-info: install-info-ja: cd texi && $(MAKE) EMACS="$(EMACS)" install-ja -# Rule for XEmacs package. -package: xlick xinfo - cd lisp && $(MAKE) EMACS="$(XEMACS)" package +## Rule for XEmacs package. +install-package: xlick install-package-lick xinfo install-package-info -install-package: xinfo +install-package-ja: install-package xinfo-ja install-package-info-ja + +package: xlick xinfo compose-package + +package-ja: xlick xinfo xinfo-ja compose-package + +# Sub-rule for XEmacs package. +install-package-lick: cd lisp && $(MAKE) EMACS="$(XEMACS)" PACKAGEDIR="$(PACKAGEDIR)" \ - install-package + install-package-lick -package-ja: xlick xinfo xinfo-ja - cd lisp && $(MAKE) EMACS="$(XEMACS)" package +install-package-info: + cd lisp && $(MAKE) EMACS="$(XEMACS)" PACKAGEDIR="$(PACKAGEDIR)" \ + install-package-info -install-package-ja: xinfo xinfo-ja +install-package-info-ja: cd lisp && $(MAKE) EMACS="$(XEMACS)" PACKAGEDIR="$(PACKAGEDIR)" \ - install-package + install-package-info-ja + +compose-package: + cd lisp && $(MAKE) EMACS="$(XEMACS)" compose-package +## xlick: cd lisp && $(MAKE) EMACS="$(XEMACS)" lispdir="$(lispdir)" all diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 845fec3..b717e0f 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -42,12 +42,22 @@ install: clever fi; \ done -package: - srcdir=$(srcdir) $(EMACS) $(FLAGS) -f dgnushack-make-package +# Rule for XEmacs package. +install-package-lick: + srcdir=$(srcdir) $(EMACS) $(FLAGS) \ + -f dgnushack-install-package-lick $(PACKAGEDIR) -install-package: clever - srcdir=$(srcdir) $(EMACS) $(FLAGS) -f dgnushack-make-package \ - -f dgnushack-install-package $(PACKAGEDIR) +install-package-info: + srcdir=$(srcdir) $(EMACS) $(FLAGS) \ + -f dgnushack-install-package-info $(PACKAGEDIR) + +install-package-info-ja: + srcdir=$(srcdir) $(EMACS) $(FLAGS) \ + -f dgnushack-install-package-info-ja $(PACKAGEDIR) + +compose-package: + srcdir=$(srcdir) $(EMACS) $(FLAGS) -f dgnushack-compose-package +# tags: etags *.el diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 706c24a..c50cb42 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -240,124 +240,6 @@ Modify to suit your needs.")) (byte-recompile-directory "." 0)) -(defconst dgnushack-info-file-regexp - (concat "^\\(gnus\\|message\\|emacs-mime\\|gnus-ja\\|message-ja\\)" - "\\.info\\(-[0-9]+\\)?$")) - -(defconst dgnushack-texi-file-regexp - "^\\(gnus\\|message\\|emacs-mime\\|gnus-ja\\|message-ja\\)\\.texi$") - -(defun dgnushack-make-package () - (let (make-backup-files) - (message "Updating autoloads for directory %s..." default-directory) - (let ((generated-autoload-file "auto-autoloads.el") - noninteractive - (omsg (symbol-function 'message))) - (defun message (fmt &rest args) - (cond ((and (string-equal "Generating autoloads for %s..." fmt) - (file-exists-p (file-name-nondirectory (car args)))) - (funcall omsg fmt (file-name-nondirectory (car args)))) - ((string-equal "No autoloads found in %s" fmt)) - ((string-equal "Generating autoloads for %s...done" fmt)) - (t (apply omsg fmt args)))) - (unwind-protect - (update-autoloads-from-directory default-directory) - (fset 'message omsg))) - (byte-compile-file "auto-autoloads.el") - - (with-temp-buffer - (let ((standard-output (current-buffer))) - (Custom-make-dependencies ".")) - (message "%s" (buffer-string))) - (require 'cus-load) - (byte-compile-file "custom-load.el") - - (require 'gnus) - (let ((product-name (downcase gnus-product-name))) - (message "Generating MANIFEST.%s for the package..." product-name) - (with-temp-buffer - (insert "pkginfo/MANIFEST." product-name "\n") - (let ((lisp-dir (concat "lisp/" product-name "/")) - (files (sort (directory-files "." nil "\\.elc?$") 'string-lessp)) - file) - (while (setq file (pop files)) - (unless (member file dgnushack-unexported-files) - (insert lisp-dir file "\n"))) - (setq files (sort (directory-files "../texi/" nil - dgnushack-info-file-regexp) - 'string-lessp)) - (while (setq file (pop files)) - (insert lisp-dir file "\n"))) - (write-file (concat "../MANIFEST." product-name)))))) - -(defun dgnushack-install-package () - (let ((package-dir (car command-line-args-left)) - (product-name (progn (require 'gnus) (downcase gnus-product-name)))) - - ;; Examine PACKAGEDIR. - (unless package-dir - (let (dirs) - (when (boundp 'early-packages) - (setq dirs (delq nil (append (when early-package-load-path - early-packages) - (when late-package-load-path - late-packages) - (when last-package-load-path - last-packages)))) - (while (and dirs (not package-dir)) - (when (file-directory-p (car dirs)) - (setq package-dir (car dirs) - dirs (cdr dirs))))))) - (unless package-dir - (error "%s" " -You must specify the name of the package path as follows: - -% make install-package PACKAGEDIR=/usr/local/lib/xemacs/xemacs-packages/")) - - ;; Install lisp files. - (let ((lisp-dir (expand-file-name (concat "lisp/" product-name "/") - package-dir)) - (files (sort (directory-files "." nil "\\.elc?$") 'string-lessp))) - (unless (file-directory-p lisp-dir) - (make-directory lisp-dir t)) - (dolist (file dgnushack-unexported-files) - (setq files (delete file files))) - ;; Remove extra files. - (dolist (file (directory-files lisp-dir nil nil nil t)) - (unless (or (member file files) - (not (string-match "\\.elc?$" file))) - (setq file (expand-file-name file lisp-dir)) - (message "Removing %s..." file) - (condition-case nil - (delete-file file) - (error nil)))) - (while (setq file (pop files)) - (message "Copying %s to %s..." file lisp-dir) - (copy-file file (expand-file-name file lisp-dir) t t))) - - ;; Install info files. - (let ((files (sort (directory-files "../texi/" nil - dgnushack-info-file-regexp) - 'string-lessp)) - (info-dir (expand-file-name "info/" package-dir))) - (unless (file-directory-p info-dir) - (make-directory info-dir)) - (while (setq file (pop files)) - (message "Copying ../texi/%s to %s..." file info-dir) - (copy-file (expand-file-name file "../texi/") - (expand-file-name file info-dir) - t t))) - - ;; Install pkginfo. - (let ((manifest (concat "MANIFEST." product-name)) - (pkginfo-dir (expand-file-name "pkginfo/" package-dir))) - (unless (file-directory-p pkginfo-dir) - (make-directory pkginfo-dir)) - (message "Copying ../%s to %s..." manifest pkginfo-dir) - (copy-file (expand-file-name manifest "../") - (expand-file-name manifest pkginfo-dir) t t)) - (message "Done"))) - (defun dgnushack-texi-add-suffix-and-format () (dgnushack-texi-format t)) @@ -467,4 +349,170 @@ You must specify the name of the package path as follows: (setq error 1)))) (kill-emacs error)))) + +(defconst dgnushack-info-file-regexp-en + (let ((names '("gnus" "message" "emacs-mime")) + regexp name) + (while (setq name (pop names)) + (setq regexp (concat regexp "^" name "\\.info\\(-[0-9]+\\)?$" + (when names "\\|")))) + regexp) + "Regexp matching English info files.") + +(defconst dgnushack-info-file-regexp-ja + (let ((names '("gnus-ja" "message-ja")) + regexp name) + (while (setq name (pop names)) + (setq regexp (concat regexp "^" name "\\.info\\(-[0-9]+\\)?$" + (when names "\\|")))) + regexp) + "Regexp matching Japanese info files.") + +(defun dgnushack-make-autoloads () + "Make auto-autoloads.el, custom-load.el and then compile them." + (let (make-backup-files) + (message "Updating autoloads for directory %s..." default-directory) + (let ((generated-autoload-file "auto-autoloads.el") + (si:message (symbol-function 'message)) + noninteractive) + (defun message (fmt &rest args) + (cond ((and (string-equal "Generating autoloads for %s..." fmt) + (file-exists-p (file-name-nondirectory (car args)))) + (funcall si:message fmt (file-name-nondirectory (car args)))) + ((string-equal "No autoloads found in %s" fmt)) + ((string-equal "Generating autoloads for %s...done" fmt)) + (t (apply si:message fmt args)))) + (unwind-protect + (update-autoloads-from-directory default-directory) + (fset 'message si:message))) + (byte-compile-file "auto-autoloads.el") + (with-temp-buffer + (let ((standard-output (current-buffer))) + (Custom-make-dependencies ".")) + (message "%s" (buffer-string))) + (require 'cus-load) + (byte-compile-file "custom-load.el"))) + +(defun dgnushack-examine-package-dir () + "Examine PACKAGEDIR." + (let ((package-dir (car command-line-args-left))) + (unless package-dir + (let (dirs) + (when (boundp 'early-packages) + (setq dirs (delq nil (append (when early-package-load-path + early-packages) + (when late-package-load-path + late-packages) + (when last-package-load-path + last-packages)))) + (while (and dirs (not package-dir)) + (when (file-directory-p (car dirs)) + (setq package-dir (car dirs) + dirs (cdr dirs))))))) + (or package-dir + (error "%s" " +You must specify the name of the package path as follows: + +% make install-package PACKAGEDIR=/usr/local/lib/xemacs/xemacs-packages/")))) + +(defun dgnushack-gnus-product-name () + "Return a product name of this gnus." + (require 'gnus) + (downcase gnus-product-name)) + +(defun dgnushack-make-manifest (product-name) + "Make MANIFEST file for XEmacs package." + (let (make-backup-files) + (message "Generating MANIFEST.%s for the package..." product-name) + (with-temp-file (concat "../MANIFEST." product-name) + (insert "pkginfo/MANIFEST." product-name "\n") + (let ((lisp-dir (concat "lisp/" product-name "/")) + (files (sort (directory-files "." nil "\\.elc?$") 'string-lessp)) + file) + (while (setq file (pop files)) + (unless (member file dgnushack-unexported-files) + (insert lisp-dir file "\n"))) + (setq files + (sort (directory-files "../texi/" nil + (concat dgnushack-info-file-regexp-en + "\\|" + dgnushack-info-file-regexp-ja)) + 'string-lessp)) + (while (setq file (pop files)) + (insert lisp-dir file "\n")))))) + +(defun dgnushack-install-package-info-files (package-dir regexp) + "Install info files as an XEmacs package." + (let ((files (sort (directory-files "../texi/" nil regexp) 'string-lessp)) + (info-dir (expand-file-name "info/" package-dir)) + file) + (unless (file-directory-p info-dir) + (make-directory info-dir)) + (while (setq file (pop files)) + (message "Copying ../texi/%s to %s..." file info-dir) + (copy-file (expand-file-name file "../texi/") + (expand-file-name file info-dir) + t t)))) + +(defun dgnushack-install-package-pkginfo (package-dir product-name) + "Install MANIFEST file." + (let ((manifest (concat "MANIFEST." product-name)) + (pkginfo-dir (expand-file-name "pkginfo/" package-dir))) + (unless (file-directory-p pkginfo-dir) + (make-directory pkginfo-dir)) + (message "Copying ../%s to %s..." manifest pkginfo-dir) + (copy-file (expand-file-name manifest "../") + (expand-file-name manifest pkginfo-dir) t t))) + +(defun dgnushack-install-package-lick () + "Install lisp files and MANIFEST file as an XEmacs package." + (dgnushack-make-autoloads) + (let ((package-dir (dgnushack-examine-package-dir)) + (product-name (dgnushack-gnus-product-name))) + (dgnushack-make-manifest product-name) + ;; Install lisp files. + (let ((lisp-dir (expand-file-name (concat "lisp/" product-name "/") + package-dir)) + (files (sort (directory-files "." nil "\\.elc?$") 'string-lessp))) + (unless (file-directory-p lisp-dir) + (make-directory lisp-dir t)) + (dolist (file dgnushack-unexported-files) + (setq files (delete file files))) + ;; Remove extra files. + (dolist (file (directory-files lisp-dir nil nil nil t)) + (unless (or (member file files) + (not (string-match "\\.elc?$" file))) + (setq file (expand-file-name file lisp-dir)) + (message "Removing %s..." file) + (condition-case nil + (delete-file file) + (error nil)))) + (while (setq file (pop files)) + (message "Copying %s to %s..." file lisp-dir) + (copy-file file (expand-file-name file lisp-dir) t t))) + (dgnushack-install-package-pkginfo package-dir product-name))) + +(defun dgnushack-install-package-info () + "Install English info files and MANIFEST file as an XEmacs package." + (let ((package-dir (dgnushack-examine-package-dir)) + (product-name (dgnushack-gnus-product-name))) + (dgnushack-make-manifest product-name) + (dgnushack-install-package-info-files package-dir + dgnushack-info-file-regexp-en) + (dgnushack-install-package-pkginfo package-dir product-name))) + +(defun dgnushack-install-package-info-ja () + "Install Japanese info files and MANIFEST file as an XEmacs package." + (let ((package-dir (dgnushack-examine-package-dir)) + (product-name (dgnushack-gnus-product-name))) + (dgnushack-make-manifest product-name) + (dgnushack-install-package-info-files package-dir + dgnushack-info-file-regexp-ja) + (dgnushack-install-package-pkginfo package-dir product-name))) + +(defun dgnushack-compose-package () + "Make auto-autoloads.el(c), custom-load.el(c) and MANIFEST file." + (dgnushack-make-autoloads) + (dgnushack-make-manifest (dgnushack-gnus-product-name))) + ;;; dgnushack.el ends here