2 ### make-manuals - create the Emacs manuals to upload to the gnu.org website
4 ## Copyright 2018-2024 Free Software Foundation, Inc.
6 ## Author: Glenn Morris <rgm@gnu.org>
7 ## Maintainer: emacs-devel@gnu.org
9 ## This file is part of GNU Emacs.
11 ## GNU Emacs is free software: you can redistribute it and/or modify
12 ## it under the terms of the GNU General Public License as published by
13 ## the Free Software Foundation, either version 3 of the License, or
14 ## (at your option) any later version.
16 ## GNU Emacs is distributed in the hope that it will be useful,
17 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ## GNU General Public License for more details.
21 ## You should have received a copy of the GNU General Public License
22 ## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
26 ## This is a helper script to create the Emacs manuals as used on the
27 ## gnu.org website. After this, use upload-manuals to upload them.
30 ## Call from the top-level directory of an Emacs source tree.
31 ## This should normally be a release.
32 ## The info files should exist.
36 source "${0%/*}/emacs-shell-lib"
41 Usage: ${PN} [-c] [-e emacs]
42 Create the Emacs manuals for the gnu.org website.
43 Call this script from the top-level of the Emacs source tree that
44 contains the manuals you want to use (normally a release).
45 The admin/ directory is required.
47 -c: do not delete any pre-existing $outdir/ directory
48 -e: Emacs executable to use (default $emacs)
60 gzip="gzip --best --no-name"
61 tar="tar --numeric-owner --owner=0 --group=0 --mode=go+u,go-w"
62 ## Requires GNU tar >= 1.28 so that the tarballs are more reproducible.
63 ## (Personally I think this is way OOT. I'm not even sure if anyone
64 ## uses these tarfiles, let alone cares whether they are reproducible.)
65 tar --help |
grep -- '--sort.*name' >& /dev
/null
&& tar="$tar --sort=name"
67 while getopts ":hce:" option
; do
75 (\?) die
"Bad option -$OPTARG" ;;
77 (:) die
"Option -$OPTARG requires an argument" ;;
79 (*) die
"getopts error" ;;
88 [ -e admin
/admin.el
] || die
"admin/admin.el not found"
91 tempfile
="$(emacs_mktemp)"
94 [ "$continue" ] ||
rm -rf $outdir
96 if [ -e $outdir ]; then
97 ## Speed up repeat invocation.
98 echo "Re-using existing $outdir/ directory"
102 ## This creates the manuals in a manual/ directory.
103 ## Note makeinfo >= 5 is much slower than makeinfo 4.
104 echo "Making manuals (slow)..."
105 $emacs --batch -Q -l admin
/admin.el
-f make-manuals \
106 >|
$tempfile 2>&1 ||
{
109 die
"error running make-manuals"
113 find $outdir -name '*~' -exec rm {} +
116 echo "Adding compressed html files..."
117 for f
in emacs elisp
; do
118 $tar -C $outdir/html_node
-cf - $f |
$gzip \
119 > $outdir/$f.html_node.
tar.gz || die
"error for $f"
123 echo "Making manual tarfiles..."
124 $emacs --batch -Q -l admin
/admin.el
-f make-manuals-dist \
129 die
"error running make-manuals-dist"
135 for f
in $outdir/*.
tar; do
138 of
=${of%%-[0-9]*}.texi.
tar
139 of
=${of/lispintro/eintr}
140 of
=${of/lispref/elisp}
141 of
=${of/manual/emacs}
144 $gzip $of || die
"error compressing $f"
148 echo "Making refcards..."
149 make -C etc
/refcards dist
>|
$tempfile 2>&1 ||
{
151 die
"failed make dist"
154 ## This may hang if eg german.sty is missing.
155 make -k -C etc
/refcards pdf
>|
$tempfile 2>&1 ||
{
157 echo "Warning: ignored failure(s) from make pdf"
160 ## Newer Texlive only provide mex (used by pl refcards) for pdf, AFAICS.
161 make -k -C etc
/refcards ps
>|
$tempfile 2>&1 ||
{
163 echo "Warning: ignored failure(s) from make ps"
166 ## Note that in the website, refcards/ is not a subdirectory of manual/.
167 refdir
=$outdir/refcards
171 mv etc
/refcards
/emacs-refcards.
tar $refdir
172 $gzip $refdir/emacs-refcards.
tar
174 for fmt in pdf ps
; do
181 cp etc
/refcards
/*.
$fmt $o
186 for f
in etc
/refcards
/*.
$fmt; do
187 $gzip < $f > $o/${f##*/}.gz
191 make -C etc
/refcards extraclean
> /dev
/null
194 echo "Adding compressed info files..."
199 for f
in eintr.info elisp.info emacs.info
; do
201 $gzip < info
/$f > $o/$f.gz || die
"error for $f"
205 echo "Finished OK, you might want to run upload-manuals now"