diff options
| author | Glenn Morris | 2014-11-08 18:02:51 -0800 |
|---|---|---|
| committer | Glenn Morris | 2014-11-08 18:02:51 -0800 |
| commit | e4ed201ff9e089d8a074523ca7de02c1b84bece2 (patch) | |
| tree | c93609d8639a0cfa5310f9867a98a2dcaab24bf9 /admin | |
| parent | d1036d288de1e047f7f6043188a1063f0d6b044d (diff) | |
| download | emacs-e4ed201ff9e089d8a074523ca7de02c1b84bece2.tar.gz emacs-e4ed201ff9e089d8a074523ca7de02c1b84bece2.zip | |
Replace doc/*/Makefile.in dist rules with code in admin/admin.el
* admin/admin.el (make-manuals-dist-output-variables)
(make-manuals-dist--1, make-manuals-dist): New.
Replaces doc/*/Makefile.in `dist' rules.
* doc/emacs/Makefile.in (version): Remove variable.
(clean): No longer delete dist tarfile.
(dist): Remove rule; replace with code in admin.el.
* doc/lispintro/Makefile.in (version): Remove variable.
(clean): No longer delete dist tarfile.
(dist): Remove rule; replace with code in admin.el.
* doc/lispref/Makefile.in (version): Remove variable.
(clean): No longer delete dist tarfile.
(dist): Remove rule; replace with code in admin.el.
* doc/misc/Makefile.in (version): Remove variable.
(clean): No longer delete dist tarfile.
(dist): Remove rule; replace with code in admin.el.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/ChangeLog | 6 | ||||
| -rw-r--r-- | admin/admin.el | 81 |
2 files changed, 87 insertions, 0 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index 4fb8d47579b..7a86773c04f 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-11-09 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * admin.el (make-manuals-dist-output-variables) | ||
| 4 | (make-manuals-dist--1, make-manuals-dist): New. | ||
| 5 | Replaces doc/*/Makefile.in `dist' rules. | ||
| 6 | |||
| 1 | 2014-10-31 Eli Zaretskii <eliz@gnu.org> | 7 | 2014-10-31 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * notes/repo (Notes): Reword the stylistic guidance for commit log | 9 | * notes/repo (Notes): Reword the stylistic guidance for commit log |
diff --git a/admin/admin.el b/admin/admin.el index 7af9ffa4177..48e083d7789 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -610,6 +610,87 @@ style=\"text-align:left\">") | |||
| 610 | (forward-line 1))))) | 610 | (forward-line 1))))) |
| 611 | 611 | ||
| 612 | 612 | ||
| 613 | (defconst make-manuals-dist-output-variables | ||
| 614 | `(("@srcdir@" . ".") | ||
| 615 | ("^\\(\\(?:texinfo\\|buildinfo\\|emacs\\)dir *=\\).*" . "\\1 .") | ||
| 616 | ("^\\(clean:.*\\)" . "\\1 infoclean") | ||
| 617 | ("@MAKEINFO@" . "makeinfo") | ||
| 618 | ("@MKDIR_P@" . "mkdir -p") | ||
| 619 | ("@INFO_EXT@" . ".info") | ||
| 620 | ("@INFO_OPTS@" . "") | ||
| 621 | ("@SHELL@" . "/bin/bash") | ||
| 622 | ("@prefix@" . "/usr/local") | ||
| 623 | ("@datarootdir@" . "${prefix}/share") | ||
| 624 | ("@datadir@" . "${datarootdir}") | ||
| 625 | ("@PACKAGE_TARNAME@" . "emacs") | ||
| 626 | ("@docdir@" . "${datarootdir}/doc/${PACKAGE_TARNAME}") | ||
| 627 | ("@\\(dvi\\|html\\|pdf\\|ps\\)dir@" . "${docdir}") | ||
| 628 | ("@GZIP_PROG@" . "gzip") | ||
| 629 | ("@INSTALL@" . "install -c") | ||
| 630 | ("@INSTALL_DATA@" . "${INSTALL} -m 644") | ||
| 631 | ("@configure_input@" . "")) | ||
| 632 | "Alist of (REGEXP . REPLACEMENT) pairs for `make-manuals-dist'.") | ||
| 633 | |||
| 634 | (defun make-manuals-dist--1 (root type) | ||
| 635 | "Subroutine of `make-manuals-dist'." | ||
| 636 | (let* ((dest (expand-file-name "manual" root)) | ||
| 637 | (default-directory (progn (make-directory dest t) | ||
| 638 | (file-name-as-directory dest))) | ||
| 639 | (version (with-temp-buffer | ||
| 640 | (insert-file-contents "../doc/emacs/emacsver.texi") | ||
| 641 | (re-search-forward "@set EMACSVER \\([0-9.]+\\)") | ||
| 642 | (match-string 1))) | ||
| 643 | (stem (format "emacs-%s-%s" (if (equal type "emacs") "manual" type) | ||
| 644 | version)) | ||
| 645 | (tarfile (format "%s.tar" stem))) | ||
| 646 | (message "Doing %s..." type) | ||
| 647 | (if (file-directory-p stem) | ||
| 648 | (delete-directory stem t)) | ||
| 649 | (make-directory stem) | ||
| 650 | (copy-file "../doc/misc/texinfo.tex" stem) | ||
| 651 | (or (equal type "emacs") (copy-file "../doc/emacs/emacsver.texi" stem)) | ||
| 652 | (dolist (file (directory-files (format "../doc/%s" type) t)) | ||
| 653 | (if (or (string-match-p "\\(\\.texi\\'\\|/ChangeLog\\|/README\\'\\)" file) | ||
| 654 | (and (equal type "lispintro") | ||
| 655 | (string-match-p "\\.\\(eps\\|pdf\\)\\'" file))) | ||
| 656 | (copy-file file stem))) | ||
| 657 | (with-temp-buffer | ||
| 658 | (insert-file-contents (format "../doc/%s/Makefile.in" type)) | ||
| 659 | (dolist (cons make-manuals-dist-output-variables) | ||
| 660 | (while (re-search-forward (car cons) nil t) | ||
| 661 | (replace-match (cdr cons) t)) | ||
| 662 | (goto-char (point-min))) | ||
| 663 | (let (ats) | ||
| 664 | (while (re-search-forward "@[a-zA-Z_]+@" nil t) | ||
| 665 | (setq ats t) | ||
| 666 | (message "Unexpanded: %s" (match-string 0))) | ||
| 667 | (if ats (error "Unexpanded configure variables in Makefile?"))) | ||
| 668 | (write-region nil nil (expand-file-name (format "%s/Makefile" stem)) | ||
| 669 | nil 'silent)) | ||
| 670 | (call-process "tar" nil nil nil "-cf" tarfile stem) | ||
| 671 | (delete-directory stem t) | ||
| 672 | (message "...created %s" tarfile))) | ||
| 673 | |||
| 674 | ;; Does anyone actually use these tarfiles? | ||
| 675 | (defun make-manuals-dist (root &optional type) | ||
| 676 | "Make the standalone manual source tarfiles for the Emacs webpage. | ||
| 677 | ROOT should be the root of an Emacs source tree. | ||
| 678 | Interactively with a prefix argument, prompt for TYPE. | ||
| 679 | Optional argument TYPE is type of output (nil means all)." | ||
| 680 | (interactive (let ((root (read-directory-name "Emacs root directory: " | ||
| 681 | source-directory nil t))) | ||
| 682 | (list root | ||
| 683 | (if current-prefix-arg | ||
| 684 | (completing-read | ||
| 685 | "Type: " | ||
| 686 | '("emacs" "lispref" "lispintro" "misc")))))) | ||
| 687 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | ||
| 688 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) | ||
| 689 | (dolist (m '("emacs" "lispref" "lispintro" "misc")) | ||
| 690 | (if (member type (list nil m)) | ||
| 691 | (make-manuals-dist--1 root m)))) | ||
| 692 | |||
| 693 | |||
| 613 | ;; Stuff to check new `defcustom's got :version tags. | 694 | ;; Stuff to check new `defcustom's got :version tags. |
| 614 | ;; Adapted from check-declare.el. | 695 | ;; Adapted from check-declare.el. |
| 615 | 696 | ||