make-dist 17 KB

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