Commit | Line | Data |
---|---|---|
067d23c9 KY |
1 | #!/bin/sh |
2 | ### make-dist: create an Emacs distribution tar file from current srcdir | |
3 | ||
5122804a | 4 | ## Copyright (C) 1995, 1997-1998, 2000-2012 Free Software Foundation, Inc. |
067d23c9 KY |
5 | |
6 | ## This file is part of GNU Emacs. | |
7 | ||
8 | ## GNU Emacs is free software: you can redistribute it and/or modify | |
9 | ## it under the terms of the GNU General Public License as published by | |
10 | ## the Free Software Foundation, either version 3 of the License, or | |
11 | ## (at your option) any later version. | |
12 | ||
13 | ## GNU Emacs is distributed in the hope that it will be useful, | |
14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ## GNU General Public License for more details. | |
17 | ||
18 | ## You should have received a copy of the GNU General Public License | |
19 | ## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
20 | ||
21 | ### Commentary: | |
22 | ||
23 | ## This basically creates a duplicate directory structure, and then | |
24 | ## hard links into it only those files that should be distributed. | |
25 | ## This means that if you add a file with an odd name, you should make | |
26 | ## sure that this script will include it. | |
27 | ||
28 | ### Code: | |
29 | ||
30 | progname="$0" | |
31 | ||
32 | ### Exit if a command fails. | |
33 | #set -e | |
34 | ||
35 | ### Print out each line we read, for debugging's sake. | |
36 | #set -v | |
37 | ||
38 | LANGUAGE=C | |
39 | LC_ALL=C | |
40 | LC_MESSAGES= | |
41 | LANG= | |
42 | export LANGUAGE LC_ALL LC_MESSAGES LANG | |
43 | ||
44 | ## Don't restrict access to any files. | |
45 | umask 0 | |
46 | ||
47 | update=yes | |
48 | check=yes | |
49 | clean_up=no | |
50 | make_tar=no | |
51 | default_gzip=gzip | |
52 | newer="" | |
53 | ||
54 | while [ $# -gt 0 ]; do | |
55 | case "$1" in | |
56 | ## This option tells make-dist to delete the staging directory | |
57 | ## when done. It is useless to use this unless you make a tar file. | |
58 | "--clean-up" ) | |
59 | clean_up=yes | |
60 | ;; | |
61 | ## This option tells make-dist to make a tar file. | |
62 | "--tar" ) | |
63 | make_tar=yes | |
64 | ;; | |
65 | ## This option tells make-dist not to recompile or do analogous things. | |
66 | "--no-update" ) | |
67 | update=no | |
68 | ;; | |
69 | ## This option says don't check for bad file names, etc. | |
70 | "--no-check" ) | |
71 | check=no | |
72 | ;; | |
73 | ## This option tells make-dist to make the distribution normally, then | |
74 | ## remove all files older than the given timestamp file. This is useful | |
75 | ## for creating incremental or patch distributions. | |
76 | "--newer") | |
77 | newer="$2" | |
78 | new_extension=".new" | |
79 | shift | |
80 | ;; | |
81 | ## This option tells make-dist to use `bzip2' instead of gzip. | |
82 | "--bzip2") | |
83 | default_gzip="bzip2" | |
84 | ;; | |
85 | ## Same with lzma. | |
86 | "--lzma") | |
87 | default_gzip="lzma" | |
88 | ;; | |
89 | ||
90 | "--snapshot") | |
91 | clean_up=yes | |
92 | make_tar=yes | |
93 | update=no | |
94 | check=no | |
95 | ;; | |
96 | ||
97 | "--help") | |
98 | echo "Usage: ${progname} [options]" | |
99 | echo "" | |
100 | echo " --bzip2 use bzip2 instead of gzip" | |
101 | echo " --clean-up delete staging directories when done" | |
102 | echo " --lzma use lzma instead of gzip" | |
103 | echo " --newer=TIME don't include files older than TIME" | |
104 | echo " --no-check don't check for bad file names etc." | |
105 | echo " --no-update don't recompile or do analogous things" | |
106 | echo " --snapshot same as --clean-up --no-update --tar --no-check" | |
107 | echo " --tar make a tar file" | |
108 | echo "" | |
109 | exit 0 | |
110 | ;; | |
111 | ||
112 | * ) | |
113 | echo "${progname}: Unrecognized argument: $1" >&2 | |
114 | exit 1 | |
115 | ;; | |
116 | esac | |
117 | shift | |
118 | done | |
119 | ||
120 | ### Make sure we're running in the right place. | |
121 | if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/subr.el ]; then | |
122 | echo "${progname}: Can't find \`src/lisp.h' and \`lisp/subr.el'." >&2 | |
123 | echo "${progname} must be run in the top directory of the Emacs" >&2 | |
124 | echo "distribution tree. cd to that directory and try again." >&2 | |
125 | exit 1 | |
126 | fi | |
127 | ||
128 | ### Find where to run Emacs. | |
129 | ### (Accept only absolute file names.) | |
130 | if [ $update = yes ]; | |
131 | then | |
132 | if [ -f src/emacs ]; | |
133 | then | |
134 | EMACS=`pwd`/src/emacs | |
135 | else | |
136 | case $EMACS in | |
137 | /*) ;; | |
138 | *) | |
139 | if [ ! -f "$EMACS" ]; then | |
140 | echo "$0: You must set the EMACS environment variable " \ | |
141 | "to an absolute file name." 2>&1 | |
142 | exit 1 | |
143 | fi;; | |
144 | esac | |
145 | fi | |
146 | fi | |
147 | ||
148 | ### Find out which version of Emacs this is. | |
16fab143 PE |
149 | version=` |
150 | sed -n 's/^AC_INIT(emacs,[ ]*\([^ )]*\).*/\1/p' <configure.in | |
151 | ` || version= | |
067d23c9 KY |
152 | if [ ! "${version}" ]; then |
153 | echo "${progname}: can't find current Emacs version in \`./src/emacs.c'" >&2 | |
154 | exit 1 | |
155 | fi | |
156 | ||
157 | echo Version number is $version | |
158 | ||
159 | if [ $update = yes ]; then | |
160 | if ! grep -q "@set EMACSVER *${version}" doc/emacs/emacsver.texi || \ | |
161 | ! grep -q "tree holds version *${version}" README; then | |
162 | echo "WARNING: README and/or emacsver.texi have the wrong version number" | |
163 | echo "Consider running M-x set-version from admin/admin.el" | |
164 | sleep 5 | |
165 | fi | |
166 | fi | |
167 | ||
168 | ### Make sure we don't already have a directory emacs-${version}. | |
169 | ||
170 | emacsname="emacs-${version}${new_extension}" | |
171 | ||
172 | if [ -d ${emacsname} ] | |
173 | then | |
174 | echo Directory "${emacsname}" already exists >&2 | |
175 | exit 1 | |
176 | fi | |
177 | ||
178 | ### Make sure the subdirectory is available. | |
179 | tempparent="make-dist.tmp.$$" | |
180 | if [ -d ${tempparent} ]; then | |
181 | echo "${progname}: staging directory \`${tempparent}' already exists. | |
182 | Perhaps a previous invocation of \`${progname}' failed to clean up after | |
183 | itself. Check that directories whose names are of the form | |
184 | \`make-dist.tmp.NNNNN' don't contain any important information, remove | |
185 | them, and try again." >&2 | |
186 | exit 1 | |
187 | fi | |
188 | ||
189 | if [ $check = yes ]; then | |
190 | ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \ | |
191 | lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \ | |
192 | lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \ | |
193 | leim/[a-z]*/[a-z]*.el > /tmp/el | |
194 | ||
195 | ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \ | |
196 | lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc \ | |
197 | lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc \ | |
198 | leim/[a-z]*/[a-z]*.elc > /tmp/elc | |
199 | ||
200 | ## Check for .elc files with no corresponding .el file. | |
201 | sed 's/\.el$/.elc/' /tmp/el > /tmp/elelc | |
202 | ||
203 | bogosities="`comm -13 /tmp/elelc /tmp/elc`" | |
204 | if [ x"${bogosities}" != x"" ]; then | |
205 | echo "The following .elc files have no corresponding .el files:" | |
206 | echo "${bogosities}" | |
207 | fi | |
208 | ||
209 | ### Check for .el files with no corresponding .elc file. | |
210 | sed 's/\.elc$/.el/' /tmp/elc > /tmp/elcel | |
211 | losers="`comm -23 /tmp/el /tmp/elcel`" | |
212 | ||
213 | rm -f /tmp/el /tmp/elc /tmp/elcel /tmp/elelc | |
214 | ||
215 | bogosities= | |
216 | for file in $losers; do | |
217 | grep -q "no-byte-compile: t" $file && continue | |
218 | case $file in | |
219 | site-init.el | site-load.el | site-start.el | default.el) continue ;; | |
220 | esac | |
221 | ||
222 | bogosities="$file $bogosities" | |
223 | ||
224 | done | |
225 | if [ x"${bogosities}" != x"" ]; then | |
226 | echo "The following .el files have no corresponding .elc files:" | |
227 | echo "${bogosities}" | |
228 | fi | |
229 | fi | |
230 | ||
231 | if [ $update = yes ]; then | |
232 | ||
233 | ## Make sure configure is newer than configure.in. | |
234 | if [ "x`ls -t configure configure.in | sed q`" != "xconfigure" ]; then | |
235 | echo "\`./configure.in' is newer than \`./configure'" >&2 | |
236 | echo "Running autoconf" >&2 | |
237 | autoconf || { x=$?; echo Autoconf FAILED! >&2; exit $x; } | |
238 | fi | |
239 | ||
240 | ## Make sure src/stamp-h.in is newer than configure.in. | |
241 | if [ "x`ls -t src/stamp-h.in configure.in | sed q`" != "xsrc/stamp-h.in" ]; then | |
242 | echo "\`./configure.in' is newer than \`./src/stamp-h.in'" >&2 | |
243 | echo "Running autoheader" >&2 | |
244 | autoheader || { x=$?; echo Autoheader FAILED! >&2; exit $x; } | |
245 | rm -f src/stamp-h.in | |
246 | echo timestamp > src/stamp-h.in | |
247 | fi | |
248 | ||
249 | echo "Updating Info files" | |
250 | (cd doc/emacs; make info) | |
251 | (cd doc/misc; make info) | |
252 | (cd doc/lispref; make info) | |
253 | (cd doc/lispintro; make info) | |
254 | ||
255 | echo "Updating finder, custom and autoload data" | |
256 | (cd lisp; make updates EMACS="$EMACS") | |
257 | ||
258 | if test -f leim/leim-list.el; then | |
259 | echo "Updating leim-list.el" | |
260 | (cd leim; make leim-list.el EMACS="$EMACS") | |
261 | fi | |
262 | ||
263 | echo "Recompiling Lisp files" | |
264 | $EMACS -batch -f batch-byte-recompile-directory lisp leim | |
265 | fi # $update = yes | |
266 | ||
267 | echo "Creating staging directory: \`${tempparent}'" | |
268 | ||
269 | mkdir ${tempparent} | |
270 | tempdir="${tempparent}/${emacsname}" | |
271 | ||
272 | ### This trap ensures that the staging directory will be cleaned up even | |
273 | ### when the script is interrupted in mid-career. | |
274 | if [ "${clean_up}" = yes ]; then | |
275 | trap "echo 'Cleaning up the staging directory'; rm -rf ${tempparent}" EXIT | |
276 | fi | |
277 | ||
278 | echo "Creating top directory: \`${tempdir}'" | |
279 | mkdir ${tempdir} | |
280 | ||
281 | ### We copy in the top-level files before creating the subdirectories in | |
282 | ### hopes that this will make the top-level files appear first in the | |
283 | ### tar file; this means that people can start reading the INSTALL and | |
284 | ### README while the rest of the tar file is still unpacking. Whoopee. | |
285 | echo "Making links to top-level files" | |
24e0f6b1 | 286 | ln INSTALL README BUGS ${tempdir} |
067d23c9 KY |
287 | ln ChangeLog Makefile.in configure configure.in ${tempdir} |
288 | ln config.bat make-dist update-subdirs vpath.sed .dir-locals.el ${tempdir} | |
9a514d4a | 289 | ln aclocal.m4 ${tempdir} |
067d23c9 KY |
290 | |
291 | echo "Creating subdirectories" | |
292 | for subdir in site-lisp \ | |
293 | leim leim/CXTERM-DIC leim/MISC-DIC \ | |
294 | leim/SKK-DIC leim/ja-dic leim/quail \ | |
24e0f6b1 | 295 | build-aux build-aux/snippet \ |
9a514d4a | 296 | src src/m src/s src/bitmaps lib lib-src oldXMenu lwlib \ |
067d23c9 | 297 | nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \ |
6166381e | 298 | `find etc lisp admin -type d` \ |
067d23c9 | 299 | doc doc/emacs doc/misc doc/man doc/lispref doc/lispintro \ |
07f3add9 | 300 | info m4 msdos \ |
067d23c9 KY |
301 | nextstep nextstep/Cocoa nextstep/Cocoa/Emacs.base \ |
302 | nextstep/Cocoa/Emacs.base/Contents \ | |
303 | nextstep/Cocoa/Emacs.base/Contents/Resources \ | |
304 | nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj \ | |
067d23c9 KY |
305 | nextstep/GNUstep \ |
306 | nextstep/GNUstep/Emacs.base \ | |
307 | nextstep/GNUstep/Emacs.base/Resources | |
308 | do | |
309 | ## site-lisp for in-place installs (?). | |
310 | [ "$subdir" = "site-lisp" ] || [ -d "$subdir" ] || \ | |
311 | echo "WARNING: $subdir not found, making anyway" | |
312 | echo " ${tempdir}/${subdir}" | |
313 | mkdir ${tempdir}/${subdir} | |
314 | done | |
315 | ||
316 | echo "Making links to \`lisp' and its subdirectories" | |
317 | files=`find lisp \( -name '*.el' -o -name '*.elc' -o -name 'ChangeLog*' \ | |
318 | -o -name 'README*' \)` | |
319 | ||
320 | ### Don't distribute site-init.el, site-load.el, or default.el. | |
321 | for file in lisp/Makefile.in lisp/makefile.w32-in $files; do | |
322 | case $file in | |
323 | */site-init*|*/site-load*|*/default*) continue ;; | |
324 | esac | |
325 | ln $file $tempdir/$file | |
326 | done | |
327 | ||
328 | echo "Making links to \`leim' and its subdirectories" | |
329 | (cd leim | |
330 | ln makefile.w32-in ../${tempdir}/leim | |
331 | ln ChangeLog README ../${tempdir}/leim | |
332 | ln CXTERM-DIC/README CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC | |
333 | ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC | |
334 | ln MISC-DIC/README MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC | |
335 | ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic | |
336 | ln Makefile.in ../${tempdir}/leim/Makefile.in | |
337 | ln leim-ext.el ../${tempdir}/leim/leim-ext.el | |
338 | ## Lisp files that start with a capital (also 4Corner.el) are | |
339 | ## generated from TIT dictionaries so we don't distribute them. | |
340 | ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail | |
341 | rm -f ../${tempdir}/leim/quail/quick-b5.* | |
342 | rm -f ../${tempdir}/leim/quail/quick-cns.* | |
343 | rm -f ../${tempdir}/leim/quail/tsang-b5.* | |
344 | rm -f ../${tempdir}/leim/quail/tsang-cns.*) | |
345 | ||
24e0f6b1 PE |
346 | echo "Making links to \`build-aux'" |
347 | (cd build-aux | |
348 | ln compile config.guess config.sub depcomp ../${tempdir}/build-aux | |
349 | ln install-sh missing move-if-change ../${tempdir}/build-aux) | |
350 | ||
351 | echo "Making links to \`build-aux/snippet'" | |
352 | (cd build-aux/snippet | |
353 | ln *.h ../../${tempdir}/build-aux/snippet) | |
354 | ||
067d23c9 KY |
355 | echo "Making links to \`src'" |
356 | ### Don't distribute the configured versions of | |
357 | ### config.in, paths.in, buildobj.h, or Makefile.in. | |
358 | (cd src | |
359 | echo " (It is ok if ln fails in some cases.)" | |
360 | ln [a-zA-Z]*.[chm] ../${tempdir}/src | |
361 | ln [a-zA-Z]*.in ../${tempdir}/src | |
362 | ln [a-zA-Z]*.mk ../${tempdir}/src | |
363 | ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src | |
364 | ln makefile.w32-in ../${tempdir}/src | |
365 | ln .gdbinit .dbxinit ../${tempdir}/src | |
366 | cd ../${tempdir}/src | |
57e96f8e | 367 | rm -f globals.h config.h epaths.h Makefile buildobj.h) |
067d23c9 KY |
368 | |
369 | echo "Making links to \`src/bitmaps'" | |
370 | (cd src/bitmaps | |
371 | ln README *.xbm ../../${tempdir}/src/bitmaps) | |
372 | ||
373 | echo "Making links to \`src/m'" | |
374 | (cd src/m | |
375 | ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/m) | |
376 | ||
377 | echo "Making links to \`src/s'" | |
378 | (cd src/s | |
379 | ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s) | |
380 | ||
9a514d4a | 381 | echo "Making links to \`lib'" |
24e0f6b1 | 382 | (snippet_h=`(cd build-aux/snippet && ls *.h)` |
9a514d4a PE |
383 | cd lib |
384 | ln [a-zA-Z]*.[ch] ../${tempdir}/lib | |
6e99ef20 | 385 | ln gnulib.mk Makefile.am Makefile.in makefile.w32-in ../${tempdir}/lib |
9a514d4a | 386 | cd ../${tempdir}/lib |
24e0f6b1 PE |
387 | script='/[*]/d; s/\.in\.h$/.h/' |
388 | rm -f `(echo "$snippet_h"; ls *.in.h) | sed "$script"`) | |
9a514d4a | 389 | |
067d23c9 KY |
390 | echo "Making links to \`lib-src'" |
391 | (cd lib-src | |
392 | ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src | |
393 | ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src | |
394 | ln grep-changelog rcs2log rcs-checkin ../${tempdir}/lib-src | |
84bbb1ad | 395 | ln makefile.w32-in ../${tempdir}/lib-src) |
067d23c9 KY |
396 | |
397 | echo "Making links to \`m4'" | |
398 | (cd m4 | |
399 | ln *.m4 ../${tempdir}/m4) | |
400 | ||
067d23c9 KY |
401 | echo "Making links to \`nt'" |
402 | (cd nt | |
403 | ln emacs.manifest emacs.rc emacsclient.rc config.nt ../${tempdir}/nt | |
404 | ln emacs-src.tags nmake.defs gmake.defs subdirs.el ../${tempdir}/nt | |
405 | ln [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt | |
3e44c782 | 406 | ln ChangeLog INSTALL README README.W32 makefile.w32-in ../${tempdir}/nt) |
067d23c9 KY |
407 | |
408 | echo "Making links to \`nt/inc' and its subdirectories" | |
409 | for f in `find nt/inc -type f -name '[a-z]*.h'`; do | |
410 | ln $f $tempdir/$f | |
411 | done | |
412 | ||
413 | echo "Making links to \`nt/icons'" | |
414 | (cd nt/icons | |
415 | ln README [a-z]*.ico ../../${tempdir}/nt/icons | |
416 | ln [a-z]*.cur ../../${tempdir}/nt/icons) | |
417 | ||
418 | echo "Making links to \`msdos'" | |
419 | (cd msdos | |
420 | ln ChangeLog INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos | |
0bd3cb7b | 421 | ln depfiles.bat inttypes.h ../${tempdir}/msdos |
067d23c9 KY |
422 | ln is_exec.c sigaction.c mainmake.v2 sed*.inp ../${tempdir}/msdos) |
423 | ||
424 | echo "Making links to \`nextstep'" | |
425 | (cd nextstep | |
426 | ln ChangeLog README INSTALL ../${tempdir}/nextstep) | |
427 | ||
428 | echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents'" | |
429 | (cd nextstep/Cocoa/Emacs.base/Contents | |
430 | ln Info.plist PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents) | |
431 | ||
432 | echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources'" | |
433 | (cd nextstep/Cocoa/Emacs.base/Contents/Resources | |
434 | ln Credits.html *.icns ../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources) | |
435 | ||
436 | echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj'" | |
437 | (cd nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj | |
438 | ln InfoPlist.strings ../../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj) | |
439 | ||
067d23c9 KY |
440 | echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'" |
441 | (cd nextstep/GNUstep/Emacs.base/Resources | |
442 | ln Emacs.desktop Info-gnustep.plist README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources ) | |
443 | ||
444 | echo "Making links to \`oldXMenu'" | |
445 | (cd oldXMenu | |
446 | ln *.[ch] *.in ../${tempdir}/oldXMenu | |
447 | ln README ChangeLog ../${tempdir}/oldXMenu) | |
448 | ||
449 | echo "Making links to \`lwlib'" | |
450 | (cd lwlib | |
451 | ln *.[ch] *.in ../${tempdir}/lwlib | |
452 | ln README ChangeLog ../${tempdir}/lwlib) | |
453 | ||
6166381e CY |
454 | echo "Making links to \`admin' and its subdirectories" |
455 | for f in `find admin -type f`; do | |
456 | ln $f $tempdir/$f | |
457 | done | |
458 | ||
067d23c9 KY |
459 | echo "Making links to \`etc' and its subdirectories" |
460 | for f in `find etc -type f`; do | |
461 | case $f in | |
838db889 | 462 | etc/DOC*|etc/*.pyc) continue ;; |
067d23c9 KY |
463 | esac |
464 | ln $f $tempdir/$f | |
465 | done | |
466 | ||
467 | echo "Making links to \`info'" | |
468 | ln `find info -type f -print` ${tempdir}/info | |
469 | ||
470 | echo "Making links to \`doc/emacs'" | |
471 | (cd doc/emacs | |
472 | ln *.texi *.in makefile.w32-in ChangeLog* ../../${tempdir}/doc/emacs) | |
473 | ||
474 | echo "Making links to \`doc/misc'" | |
475 | (cd doc/misc | |
476 | ln *.texi *.tex *.in makefile.w32-in gnus-news.el ChangeLog* ../../${tempdir}/doc/misc) | |
477 | ||
478 | echo "Making links to \`doc/lispref'" | |
479 | (cd doc/lispref | |
480 | ln *.texi *.in makefile.w32-in README ChangeLog* ../../${tempdir}/doc/lispref | |
5122804a GM |
481 | ln spellfile ../../${tempdir}/doc/lispref |
482 | ln two-volume.make two-volume-cross-refs.txt ../../${tempdir}/doc/lispref) | |
067d23c9 KY |
483 | |
484 | echo "Making links to \`doc/lispintro'" | |
485 | (cd doc/lispintro | |
486 | ln *.texi *.in makefile.w32-in *.eps *.pdf ../../${tempdir}/doc/lispintro | |
487 | ln README ChangeLog* ../../${tempdir}/doc/lispintro | |
488 | cd ../../${tempdir}/doc/lispintro) | |
489 | ||
490 | echo "Making links to \`doc/man'" | |
491 | (cd doc/man | |
492 | ln ChangeLog* *.1 ../../${tempdir}/doc/man | |
493 | cd ../../${tempdir}/doc/man) | |
494 | ||
495 | ### It would be nice if they could all be symlinks to top-level copy, but | |
496 | ### you're not supposed to have any symlinks in distribution tar files. | |
497 | echo "Making sure copying notices are all copies of \`COPYING'" | |
9a514d4a | 498 | for subdir in . etc info leim lib lib-src lisp lwlib msdos nt src; do |
067d23c9 KY |
499 | rm -f ${tempdir}/${subdir}/COPYING |
500 | cp COPYING ${tempdir}/${subdir} | |
501 | done | |
502 | ||
503 | if [ "${newer}" ]; then | |
504 | echo "Removing files older than $newer" | |
505 | ## We remove .elc files unconditionally, on the theory that anyone picking | |
506 | ## up an incremental distribution already has a running Emacs to byte-compile | |
507 | ## them with. | |
508 | find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \; | |
509 | fi | |
510 | ||
511 | ## Don't distribute backups, autosaves, etc. | |
512 | echo "Removing unwanted files" | |
513 | find ${tempparent} \( -name '*~' -o -name '#*#' -o -name '.*ignore' -o -name '=*' -o -name 'TAGS' \) -exec rm -f {} \; | |
514 | ||
515 | if [ "${make_tar}" = yes ]; then | |
516 | echo "Looking for $default_gzip" | |
517 | found=0 | |
518 | temppath=`echo $PATH | sed -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \ | |
519 | -e 's/:/ /g'` | |
520 | for dir in ${temppath}; do | |
521 | [ -x ${dir}/$default_gzip ] || continue | |
522 | found=1; break | |
523 | done | |
524 | if [ "$found" = "0" ]; then | |
525 | echo "WARNING: \`$default_gzip' not found, will not compress" >&2 | |
526 | default_gzip=cat | |
527 | fi | |
528 | case "${default_gzip}" in | |
529 | bzip2) gzip_extension=.bz2 ;; | |
530 | lzma) gzip_extension=.lzma ;; | |
531 | gzip) gzip_extension=.gz ; default_gzip="gzip --best";; | |
532 | *) gzip_extension= ;; | |
533 | esac | |
534 | echo "Creating tar file" | |
535 | (cd ${tempparent} ; tar cvf - ${emacsname} ) \ | |
536 | | ${default_gzip} \ | |
537 | > ${emacsname}.tar${gzip_extension} | |
538 | fi | |
539 | ||
540 | if [ "${clean_up}" != yes ]; then | |
541 | (cd ${tempparent}; mv ${emacsname} ..) | |
542 | rm -rf ${tempparent} | |
543 | fi | |
544 | ||
545 | ### make-dist ends here |