Merge from emacs--rel--22
[emacs.git] / make-dist
blob6d91e7cf56dbee372be53bf93a9291f5ec1d63ce
1 #!/bin/sh
3 #### make-dist: create an Emacs distribution tar file from the current
4 #### source tree. This basically creates a duplicate directory
5 #### structure, and then hard links into it only those files that should
6 #### be distributed. This means that if you add a file with an odd name,
7 #### you should make sure that this script will include it.
9 # Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
10 # 2006, 2007, 2008 Free Software Foundation, Inc.
12 # This file is part of GNU Emacs.
14 # GNU Emacs is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 3, or (at your option)
17 # any later version.
19 # GNU Emacs is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with GNU Emacs; see the file COPYING. If not, write to the
26 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27 # Boston, MA 02110-1301, USA.
29 progname="$0"
31 ### Exit if a command fails.
32 #set -e
34 ### Print out each line we read, for debugging's sake.
35 #set -v
37 LANGUAGE=C
38 LC_ALL=C
39 LC_MESSAGES=
40 LANG=
41 export LANGUAGE LC_ALL LC_MESSAGES LANG
43 ## Don't restrict access to any files.
44 umask 0
46 update=yes
47 check=yes
48 clean_up=no
49 make_tar=no
50 newer=""
52 while [ $# -gt 0 ]; do
53 case "$1" in
54 ## This option tells make-dist to delete the staging directory
55 ## when done. It is useless to use this unless you make a tar file.
56 "--clean-up" )
57 clean_up=yes
59 ## This option tells make-dist to make a tar file.
60 "--tar" )
61 make_tar=yes
63 ## This option tells make-dist not to recompile or do analogous things.
64 "--no-update" )
65 update=no
67 ## This option says don't check for bad file names, etc.
68 "--no-check" )
69 check=no
71 ## This option tells make-dist to make the distribution normally, then
72 ## remove all files older than the given timestamp file. This is useful
73 ## for creating incremental or patch distributions.
74 "--newer")
75 newer="$2"
76 new_extension=".new"
77 shift
79 ## This option tells make-dist to use `compress' instead of gzip.
80 ## Normally, make-dist uses gzip whenever it is present.
81 "--compress")
82 default_gzip="compress"
84 ## Same with bzip2.
85 "--bzip2")
86 default_gzip="bzip2"
88 ## Same with lzma.
89 "--lzma")
90 default_gzip="lzma"
93 "--snapshot")
94 clean_up=yes
95 make_tar=yes
96 update=no
97 check=no
100 "--help")
101 echo "Usage: ${progname} [options]"
102 echo ""
103 echo " --bzip2 use bzip2 instead of gzip"
104 echo " --clean-up delete staging directories when done"
105 echo " --compress use compress instead of gzip"
106 echo " --lzma use lzma instead of gzip"
107 echo " --newer=TIME don't include files older than TIME"
108 echo " --no-check don't check for bad file names etc."
109 echo " --no-update don't recompile or do analogous things"
110 echo " --snapshot same as --clean-up --no-update --tar --no-check"
111 echo " --tar make a tar file"
112 echo ""
113 exit 0
117 echo "${progname}: Unrecognized argument: $1" >&2
118 exit 1
120 esac
121 shift
122 done
124 ### Make sure we're running in the right place.
125 if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then
126 echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2
127 echo "${progname} must be run in the top directory of the Emacs" >&2
128 echo "distribution tree. cd to that directory and try again." >&2
129 exit 1
132 ### Find where to run Emacs.
133 ### (Accept only absolute file names.)
134 if [ $update = yes ];
135 then
136 unset EMACS_UNIBYTE
137 if [ -f src/emacs ];
138 then
139 EMACS=`pwd`/src/emacs
140 else
141 case $EMACS in
142 /*) ;;
144 if [ ! -f "$EMACS" ]; then
145 echo "$0: You must specify the EMACS environment variable " \
146 "to an absolute file name." 2>&1
147 exit 1
148 fi;;
149 esac
153 ### Find out which version of Emacs this is.
154 shortversion=`grep 'defconst[ ]*emacs-version' lisp/version.el \
155 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
156 version=`grep 'defconst[ ]*emacs-version' lisp/version.el \
157 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
158 if [ ! "${version}" ]; then
159 echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2
160 exit 1
163 echo Version numbers are $version and $shortversion
165 if [ $update = yes ];
166 then
167 if grep -s "@set EMACSVER *${shortversion}" ./doc/emacs/emacs.texi > /dev/null; then
168 true
169 else
170 echo "You must update the version number in \`./doc/emacs/emacs.texi'"
171 sleep 5
175 ### Make sure we don't already have a directory emacs-${version}.
177 emacsname="emacs-${version}${new_extension}"
179 if [ -d ${emacsname} ]
180 then
181 echo Directory "${emacsname}" already exists >&2
182 exit 1
185 ### Make sure the subdirectory is available.
186 tempparent="make-dist.tmp.$$"
187 if [ -d ${tempparent} ]; then
188 echo "${progname}: staging directory \`${tempparent}' already exists.
189 Perhaps a previous invocation of \`${progname}' failed to clean up after
190 itself. Check that directories whose names are of the form
191 \`make-dist.tmp.NNNNN' don't contain any important information, remove
192 them, and try again." >&2
193 exit 1
196 ### Find where to run Emacs.
197 if [ $check = yes ];
198 then
199 ### Check for .elc files with no corresponding .el file.
200 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
201 leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el
202 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
203 leim/[a-z]*/[a-z]*.elc > /tmp/elc
204 bogosities="`comm -13 /tmp/el /tmp/elc`"
205 if [ "${bogosities}" != "" ]; then
206 echo "The following .elc files have no corresponding .el files:"
207 echo "${bogosities}"
209 rm -f /tmp/el /tmp/elc
211 ### Check for .el files with no corresponding .elc file.
212 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
213 leim/[a-z]*/[a-z]*.el > /tmp/el
214 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
215 leim/[a-z]*/[a-z]*.elc | sed 's/\.elc$/.el/' > /tmp/elc
216 losers="`comm -23 /tmp/el /tmp/elc`"
217 bogosities=
218 for file in $losers; do
219 if ! grep -q "no-byte-compile: t" $file; then
220 case $file in
221 site-init.el | site-load.el | site-start.el | default.el)
224 bogosities="$file $bogosities"
226 esac
228 done
229 if [ x"${bogosities}" != x"" ]; then
230 echo "The following .el files have no corresponding .elc files:"
231 echo "${bogosities}"
233 rm -f /tmp/el /tmp/elc
236 ### Make sure configure is newer than configure.in.
237 if [ "x`ls -t configure configure.in | sed q`" != "xconfigure" ]; then
238 echo "\`./configure.in' is newer than \`./configure'" >&2
239 echo "Running autoconf" >&2
240 autoconf || { x=$?; echo Autoconf FAILED! >&2; exit $x; }
243 ### Make sure src/config-in.stamp is newer than configure.in.
244 if [ "x`ls -t src/stamp-h.in configure.in | sed q`" != "xsrc/stamp-h.in" ]; then
245 echo "\`./configure.in' is newer than \`./src/stamp-h.in'" >&2
246 echo "Running autoheader" >&2
247 autoheader || { x=$?; echo Autoheader FAILED! >&2; exit $x; }
248 rm -f src/stamp-h.in
249 echo timestamp > src/stamp-h.in
252 if [ $update = yes ];
253 then
254 echo "Updating Info files"
255 (cd doc/emacs; make -f Makefile.in srcdir=. info)
256 (cd doc/misc; make -f Makefile.in srcdir=. info)
257 (cd doc/lispref; make -f Makefile.in srcdir=. info)
258 (cd doc/lispintro; make -f Makefile.in SHELL=/bin/sh srcdir=. info VPATH=.)
260 echo "Updating finder, custom and autoload data"
261 (cd lisp; make updates EMACS="$EMACS")
263 if test -f leim/leim-list.el; then
264 echo "Updating leim-list.el"
265 (cd leim; make leim-list.el EMACS="$EMACS")
268 echo "Recompiling Lisp files"
269 $EMACS -batch -f batch-byte-recompile-directory lisp leim
272 echo "Making lisp/MANIFEST"
274 (cd lisp;
275 files=`echo [!=]*.el | sed -e 's/ subdirs.el / /' -e 's/ default.el / /'`
276 for dir in [!=]*; do
277 if [ -d $dir ] && [ $dir != term ] && [ $dir != CVS ] && [ $dir != RCS ]
278 then
279 echo $dir
280 thisdir=`echo $dir/[!=]*.el | sed -e 's/ subdirs.el / /'`
281 files="$files $thisdir"
283 done
284 for file in $files
285 do sed -n 's/^;;; //p; q' $file
286 done | sort > MANIFEST)
288 echo "Creating staging directory: \`${tempparent}'"
290 mkdir ${tempparent}
291 tempdir="${tempparent}/${emacsname}"
293 ### This trap ensures that the staging directory will be cleaned up even
294 ### when the script is interrupted in mid-career.
295 if [ "${clean_up}" = yes ]; then
296 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15
299 echo "Creating top directory: \`${tempdir}'"
300 mkdir ${tempdir}
302 ### We copy in the top-level files before creating the subdirectories in
303 ### hopes that this will make the top-level files appear first in the
304 ### tar file; this means that people can start reading the INSTALL and
305 ### README while the rest of the tar file is still unpacking. Whoopee.
306 echo "Making links to top-level files"
307 ln INSTALL README BUGS move-if-change ${tempdir}
308 ln ChangeLog Makefile.in configure configure.in ${tempdir}
309 ln config.bat make-dist update-subdirs vpath.sed ${tempdir}
310 ### Copy these files; they're cross-filesystem symlinks.
311 cp mkinstalldirs ${tempdir}
312 cp config.sub ${tempdir}
313 cp config.guess ${tempdir}
314 cp install-sh ${tempdir}
316 echo "Updating version number in README"
317 (cd ${tempdir}
318 awk \
319 '$1 " " $2 " " $3 " " $4 " " $5 == "This directory tree holds version" { $6 = version; print $0 }
320 $1 " " $2 " " $3 " " $4 " " $5 != "This directory tree holds version"' \
321 version=${version} README > tmp.README
322 mv -f tmp.README README)
325 echo "Creating subdirectories"
326 for subdir in lisp site-lisp \
327 leim leim/CXTERM-DIC leim/MISC-DIC \
328 leim/SKK-DIC leim/ja-dic leim/quail \
329 src src/m src/s src/bitmaps lib-src oldXMenu lwlib \
330 nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \
331 etc etc/e etc/gnus etc/nxml \
332 etc/images etc/images/ezimage etc/images/gnus etc/images/gud \
333 etc/images/icons etc/images/icons/hicolor \
334 etc/images/icons/hicolor/*x* etc/images/icons/hicolor/*x*/apps \
335 etc/images/low-color etc/images/mail \
336 etc/images/smilies etc/images/smilies/grayscale \
337 etc/images/smilies/medium etc/images/tree-widget \
338 etc/images/tree-widget/default etc/images/tree-widget/folder \
339 etc/refcards etc/schema etc/tutorials info doc doc/emacs \
340 doc/misc doc/man doc/lispref doc/lispintro m4 msdos vms mac \
341 mac/inc mac/inc/sys mac/src mac/Emacs.app mac/Emacs.app/Contents \
342 mac/Emacs.app/Contents/MacOS mac/Emacs.app/Contents/Resources \
343 mac/Emacs.app/Contents/Resources/English.lproj
345 echo " ${tempdir}/${subdir}"
346 mkdir ${tempdir}/${subdir}
347 done
349 echo "Making links to \`lisp' and its subdirectories"
350 ### Don't distribute TAGS, =*.el files, site-init.el, site-load.el, or default.el.
351 (cd lisp
352 ln [a-zA-Z]*.el ../${tempdir}/lisp
353 ln [a-zA-Z]*.elc ../${tempdir}/lisp
354 ln [a-zA-Z]*.dat ../${tempdir}/lisp
355 for img in [a-zA-Z]*.xpm [a-zA-Z]*.xbm [a-zA-Z]*.pbm; do
356 # If there are no images, the shell won't expand the pattern.
357 if [ -f $img ]; then
358 ln $img ../${tempdir}/lisp
360 done
361 ## simula.el doesn't keep abbreviations in simula.defns any more.
362 ## ln [a-zA-Z]*.defns ../${tempdir}/lisp
363 ln ChangeLog ChangeLog.*[0-9] ../${tempdir}/lisp
364 ln Makefile.in makefile.w32-in ../${tempdir}/lisp
365 test -f README && ln README ../${tempdir}/lisp
366 (cd ../${tempdir}/lisp
367 rm -f TAGS =*
368 rm -f site-init site-init.el site-init.elc
369 rm -f site-load site-load.el site-load.elc
370 rm -f site-start site-start.el site-start.elc
371 rm -f default default.el default.elc
374 ## Find all subdirs of lisp dir
375 for file in `find . -type d -print`; do
376 case $file in
377 . | .. | */Old | */CVS | */RCS | */=*)
380 if [ -d $file ]; then
381 subdirs="$file $subdirs"
384 esac
385 done
387 for file in $subdirs; do
388 echo " lisp/$file"
389 mkdir -p ../${tempdir}/lisp/$file
390 ln $file/[a-zA-Z0-9]*.el ../${tempdir}/lisp/$file
391 ln $file/[a-zA-Z0-9]*.elc ../${tempdir}/lisp/$file
392 for img in $file/[a-zA-Z]*.xpm $file/[a-zA-Z]*.xbm $file/[a-zA-Z]*.pbm; do
393 if [ -f $img ]; then
394 ln $img ../${tempdir}/lisp/$file
396 done
397 if [ -f $file/README ]; then
398 ln $file/README ../${tempdir}/lisp/$file
401 if [ -f $file/ChangeLog ]; then
402 ln $file/ChangeLog ../${tempdir}/lisp/$file
403 for f in $file/ChangeLog.*[0-9]; do
404 if [ -f $f ]; then
405 ln $f ../${tempdir}/lisp/$file
407 done
409 done )
411 echo "Making links to \`leim' and its subdirectories"
412 ### Don't distribute TAGS, or =*.el files.
413 (cd leim
414 ln makefile.w32-in ../${tempdir}/leim
415 ln ChangeLog README ../${tempdir}/leim
417 ln CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC
418 ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC
419 ln MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC
420 ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic
421 ln Makefile.in ../${tempdir}/leim/Makefile.in
422 ln leim-ext.el ../${tempdir}/leim/leim-ext.el
423 ## Lisp files that start with a capital are generated from TIT
424 ## dictionaries so we don't distribute them.
425 ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail
426 rm -f ../${tempdir}/leim/quail/quick-b5.*
427 rm -f ../${tempdir}/leim/quail/quick-cns.*
428 rm -f ../${tempdir}/leim/quail/tsang-b5.*
429 rm -f ../${tempdir}/leim/quail/tsang-cns.*
431 cd ../${tempdir}/leim
432 rm -f TAGS =* */=*)
434 echo "Making links to \`src'"
435 ### Don't distribute =*.[ch] files, or the configured versions of
436 ### config.in, paths.in, or Makefile.in, or TAGS.
437 (cd src
438 echo " (It is ok if ln fails in some cases.)"
439 ln [a-zA-Z]*.c ../${tempdir}/src
440 ln [a-zA-Z]*.h ../${tempdir}/src
441 ln [a-zA-Z]*.s ../${tempdir}/src
442 ln [a-zA-Z]*.in ../${tempdir}/src
443 ln [a-zA-Z]*.opt ../${tempdir}/src
444 ## If we ended up with a symlink, or if we did not get anything
445 ## due to a cross-device symlink, copy the file.
446 for file in [a-zA-Z]*.[hcs] [a-zA-Z]*.in [a-zA-Z]*.opt; do
447 if test -f ../${tempdir}/src/$file; then
448 # test -f appears to succeed for a symlink
449 if test -L ../${tempdir}/src/$file; then
450 rm ../${tempdir}/src/$file
451 cp -p $file ../${tempdir}/src
452 chmod a-w ../${tempdir}/src/$file
454 else
455 rm ../${tempdir}/src/$file
456 cp -p $file ../${tempdir}/src
457 chmod a-w ../${tempdir}/src/$file
459 done
460 ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src
461 ln makefile.w32-in ../${tempdir}/src
462 ln .gdbinit .dbxinit ../${tempdir}/src
463 cd ../${tempdir}/src
464 rm -f config.h epaths.h Makefile Makefile.c
465 rm -f =* TAGS)
467 echo "Making links to \`src/bitmaps'"
468 (cd src/bitmaps
469 ln README *.xbm ../../${tempdir}/src/bitmaps)
471 echo "Making links to \`src/m'"
472 (cd src/m
473 # We call files for miscellaneous input (to linker etc) .inp.
474 ln README [a-zA-Z0-9]*.h *.inp ../../${tempdir}/src/m)
476 echo "Making links to \`src/s'"
477 (cd src/s
478 ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s)
480 echo "Making links to \`lib-src'"
481 (cd lib-src
482 ln [a-zA-Z]*.[chy] ../${tempdir}/lib-src
483 ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src
484 ln grep-changelog rcs2log rcs-checkin ../${tempdir}/lib-src
485 ln makefile.w32-in ../${tempdir}/lib-src
486 ## If we ended up with a symlink, or if we did not get anything
487 ## due to a cross-device symlink, copy the file.
488 for file in [a-zA-Z]*.[chy]; do
489 if test -f ../${tempdir}/lib-src/$file; then
490 # test -f appears to succeed for a symlink
491 if test -L ../${tempdir}/lib-src/$file; then
492 rm ../${tempdir}/lib-src/$file
493 cp $file ../${tempdir}/lib-src
494 chmod a-w ../${tempdir}/lib-src/$file
496 else
497 rm ../${tempdir}/lib-src/$file
498 cp $file ../${tempdir}/lib-src
499 chmod a-w ../${tempdir}/lib-src/$file
501 done
502 cd ../${tempdir}/lib-src
503 rm -f Makefile.c
504 rm -f getopt.h
505 rm -f =* TAGS)
507 echo "Making links to \`m4'"
508 (cd m4
509 ln *.m4 ../${tempdir}/m4)
511 echo "Making links to \`nt'"
512 (cd nt
513 ln emacs.manifest emacs.rc config.nt [a-z]*.c ../${tempdir}/nt
514 ln nmake.defs gmake.defs subdirs.el ../${tempdir}/nt
515 ln [a-z]*.bat [a-z]*.h ../${tempdir}/nt
516 ln ChangeLog INSTALL README makefile.w32-in ../${tempdir}/nt)
518 echo "Making links to \`nt/inc'"
519 (cd nt/inc
520 ln [a-z]*.h ../../${tempdir}/nt/inc)
522 echo "Making links to \`nt/inc/sys'"
523 (cd nt/inc/sys
524 ln [a-z]*.h ../../../${tempdir}/nt/inc/sys)
526 echo "Making links to \`nt/inc/arpa'"
527 (cd nt/inc/arpa
528 ln [a-z]*.h ../../../${tempdir}/nt/inc/arpa)
530 echo "Making links to \`nt/inc/netinet'"
531 (cd nt/inc/netinet
532 ln [a-z]*.h ../../../${tempdir}/nt/inc/netinet)
534 echo "Making links to \`nt/icons'"
535 (cd nt/icons
536 ln [a-z]*.ico ../../${tempdir}/nt/icons
537 ln [a-z]*.cur ../../${tempdir}/nt/icons)
539 echo "Making links to \`mac'"
540 (cd mac
541 ln ChangeLog INSTALL README make-package *.xml *.MPW ../${tempdir}/mac)
543 echo "Making links to \`mac/inc'"
544 (cd mac/inc
545 ln [a-z]*.h ../../${tempdir}/mac/inc)
547 echo "Making links to \`mac/inc/sys'"
548 (cd mac/inc/sys
549 ln [a-z]*.h ../../../${tempdir}/mac/inc/sys)
551 echo "Making links to \`mac/src'"
552 (cd mac/src
553 ln [a-z]*.c *.r ../../${tempdir}/mac/src)
555 echo "Making links to \`mac/Emacs.app/Contents'"
556 (cd mac/Emacs.app/Contents
557 ln Info.plist PkgInfo ../../../${tempdir}/mac/Emacs.app/Contents)
559 echo "Making links to \`mac/Emacs.app/Contents/Resources'"
560 (cd mac/Emacs.app/Contents/Resources
561 ln Emacs.icns ../../../../${tempdir}/mac/Emacs.app/Contents/Resources)
563 echo "Making links to \`mac/Emacs.app/Contents/Resources/English.lproj'"
564 (cd mac/Emacs.app/Contents/Resources/English.lproj
565 ln InfoPlist.strings ../../../../../${tempdir}/mac/Emacs.app/Contents/Resources/English.lproj)
567 echo "Making links to \`msdos'"
568 (cd msdos
569 ln ChangeLog emacs.ico emacs.pif ../${tempdir}/msdos
570 ln is_exec.c sigaction.c mainmake mainmake.v2 sed*.inp ../${tempdir}/msdos
571 cd ../${tempdir}/msdos
572 rm -f =*)
574 echo "Making links to \`oldXMenu'"
575 (cd oldXMenu
576 ln *.c *.h *.in ../${tempdir}/oldXMenu
577 ln README ChangeLog ../${tempdir}/oldXMenu
578 ln compile.com descrip.mms ../${tempdir}/oldXMenu)
580 echo "Making links to \`lwlib'"
581 (cd lwlib
582 ln *.c *.h *.in ../${tempdir}/lwlib
583 ln README ChangeLog ../${tempdir}/lwlib)
585 echo "Making links to \`etc'"
586 ### Don't distribute = files, TAGS, DOC files, backups, autosaves, or
587 ### tex litter.
588 (cd etc
589 files=`ls -d * | grep -v CVS | grep -v RCS | grep -v 'Old' | grep -v '^e$' \
590 | grep -v '^gnus$' | grep -v '^images$' | grep -v '^nxml$' \
591 | grep -v '^refcards$' | grep -v '^tutorials$'| grep -v '^schema$'`
592 ln $files ../${tempdir}/etc
593 ## If we ended up with a symlink, or if we did not get anything
594 ## due to a cross-device symlink, copy the file.
595 for file in $files; do
596 if test -f ../${tempdir}/etc/$file; then
597 # test -f appears to succeed for a symlink
598 if test -L ../${tempdir}/etc/$file; then
599 rm ../${tempdir}/etc/$file
600 cp $file ../${tempdir}/etc
601 chmod a-w ../${tempdir}/etc/$file
603 else
604 rm ../${tempdir}/etc/$file
605 cp $file ../${tempdir}/etc
606 chmod a-w ../${tempdir}/etc/$file
608 done
609 cd ../${tempdir}/etc
610 rm -f fns*.el
611 rm -f DOC* *~ \#*\# *.dvi *.log *.orig *.rej *,v =* core
612 rm -f TAGS)
614 for dir in etc/e etc/gnus etc/nxml etc/tutorials etc/refcards etc/schema ; do
615 echo "Making links to \`${dir}'"
616 (cd ${dir}
617 ln `ls -d * | grep -v CVS | grep -v RCS` ../../${tempdir}/${dir}
618 cd ../../${tempdir}/${dir}
619 rm -f *~ \#*\# *,v =* core)
620 done
622 echo "Making links to \`etc/images'"
623 (cd etc/images
624 for img in README [a-zA-Z]*.xpm [a-zA-Z]*.xbm [a-zA-Z]*.pbm; do
625 if [ -f $img ]; then
626 ln $img ../../${tempdir}/etc/images
628 done)
630 for dir in etc/images/ezimage etc/images/gnus etc/images/gud etc/images/icons \
631 etc/images/low-color etc/images/mail etc/images/smilies ; do
632 echo "Making links to \`${dir}'"
633 (cd ${dir}
634 ln `ls -d * | grep -v CVS | grep -v RCS` ../../../${tempdir}/${dir}
635 cd ../../../${tempdir}/${dir}
636 rm -f *~ \#*\# *,v =* core)
637 done
639 for dir in etc/images/tree-widget/default etc/images/tree-widget/folder \
640 etc/images/smilies/grayscale etc/images/smilies/medium; do
641 echo "Making links to \`${dir}'"
642 (cd ${dir}
643 ln `ls -d * | grep -v CVS | grep -v RCS` ../../../../${tempdir}/${dir}
644 cd ../../../../${tempdir}/${dir}
645 rm -f *~ \#*\# *,v =* core)
646 done
648 for dir in etc/images/icons/hicolor/*x*/apps ; do
649 echo "Making links to \`${dir}'"
650 (cd ${dir}
651 ln `ls -d * | grep -v CVS | grep -v RCS` ../../../../../../${tempdir}/${dir}
652 cd ../../../../../../${tempdir}/${dir}
653 rm -f *~ \#*\# *,v =* core)
654 done
656 echo "Making links to \`info'"
657 # Don't distribute backups or autosaves.
658 (cd info
659 ln `find . -type f -print | grep -v CVS | grep -v RCS | grep -v cvsignore` ../${tempdir}/info
660 #ln [a-zA-Z]* ../${tempdir}/info
661 cd ../${tempdir}/info
662 # Avoid an error when expanding the wildcards later.
663 ln emacs dummy~ ; ln emacs \#dummy\#
664 rm -f *~ \#*\# core)
666 echo "Making links to \`doc/emacs'"
667 (cd doc/emacs
668 ln *.texi *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/emacs
669 ln makefile.w32-in ../../${tempdir}/doc/emacs
670 test -f README && ln README ../../${tempdir}/doc/emacs
671 test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/emacs
672 ln ChangeLog ../../${tempdir}/doc/emacs
673 cp texinfo.tex ../../${tempdir}/doc/emacs
674 cd ../../${tempdir}/doc/emacs
675 rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail
676 rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux)
678 echo "Making links to \`doc/misc'"
679 (cd doc/misc
680 ln *.texi *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/misc
681 ln makefile.w32-in ../../${tempdir}/doc/misc
682 test -f README && ln README ../../${tempdir}/doc/misc
683 test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/misc
684 ln ChangeLog ../../${tempdir}/doc/misc
685 cp texinfo.tex ../../${tempdir}/doc/misc
686 cd ../../${tempdir}/doc/misc
687 rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail
688 rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux)
690 echo "Making links to \`doc/lispref'"
691 (cd doc/lispref
692 ln `ls -1 *.texi` ../../${tempdir}/doc/lispref
693 ln *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/lispref
694 ln *.txt *.el spellfile tindex.pl ../../${tempdir}/doc/lispref
695 ln makefile.w32-in ../../${tempdir}/doc/lispref
696 test -f README && ln README ../../${tempdir}/doc/lispref
697 test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/lispref
698 ln ChangeLog ../../${tempdir}/doc/lispref
699 cd ../../${tempdir}/doc/lispref
700 rm -f \#*\# =* *~ core elisp-index* *.Z *.z xmail
701 rm -f elisp.?? *.log *.toc *.dvi *.oaux)
703 echo "Making links to \`doc/lispintro'"
704 (cd doc/lispintro
705 ln *.texi *.aux *.cps *.fns *.kys *.vrs *.eps ../../${tempdir}/doc/lispintro
706 ln makefile.w32-in ../../${tempdir}/doc/lispintro
707 test -f texinfo.tex && ln texinfo.tex ../../${tempdir}/doc/lispintro
708 test -f README && ln README ../../${tempdir}/doc/lispintro
709 test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/lispintro
710 ln ChangeLog ../../${tempdir}/doc/lispintro
711 cd ../../${tempdir}/doc/lispintro
712 rm -f \#*\# =* *~ core *.Z *.z xmail
713 rm -f emacs-lisp-intro.?? *.log *.toc *.dvi *.oaux)
715 echo "Making links to \`doc/man'"
716 (cd doc/man
717 ln *.1 ../../${tempdir}/doc/man)
719 echo "Making links to \`vms'"
720 (cd vms
721 test -f README && ln README ../${tempdir}/vms
722 cd ../${tempdir}/vms
723 rm -f *~)
725 ### It would be nice if they could all be symlinks to top-level copy, but
726 ### you're not supposed to have any symlinks in distribution tar files.
727 echo "Making sure copying notices are all copies of \`COPYING'"
728 for subdir in . etc info leim lib-src lisp lwlib mac msdos nt src; do
729 rm -f ${tempdir}/${subdir}/COPYING
730 cp COPYING ${tempdir}/${subdir}
731 done
733 if [ "${newer}" ]; then
734 echo "Removing files older than $newer"
735 ## We remove .elc files unconditionally, on the theory that anyone picking
736 ## up an incremental distribution already has a running Emacs to byte-compile
737 ## them with.
738 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \;
741 if [ "${make_tar}" = yes ]; then
742 if [ "${default_gzip}" = "" ]; then
743 echo "Looking for gzip"
744 temppath=`echo $PATH | sed 's/^:/.:/
745 s/::/:.:/g
746 s/:$/:./
747 s/:/ /g'`
748 default_gzip=`(
749 for dir in ${temppath}; do
750 if [ -f ${dir}/gzip ]; then echo 'gzip --best'; exit 0; fi
751 done
752 echo compress
755 case "${default_gzip}" in
756 bzip2) gzip_extension=.bz2 ;;
757 compress* ) gzip_extension=.Z ;;
758 lzma) gzip_extension=.lzma ;;
759 * ) gzip_extension=.gz ;;
760 esac
761 echo "Creating tar file"
762 (cd ${tempparent} ; tar cvf - ${emacsname} ) \
763 | ${default_gzip} \
764 > ${emacsname}.tar${gzip_extension}
767 if [ "${clean_up}" = yes ]; then
768 echo "Cleaning up the staging directory"
769 rm -rf ${tempparent}
770 else
771 (cd ${tempparent}; mv ${emacsname} ..)
772 rm -rf ${tempparent}
775 # arch-tag: 26e3eb50-a394-4ab2-82b2-d8e5af500de7
776 ### make-dist ends here