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