616
|
1 #!/bin/sh
|
|
2 #
|
|
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.
|
|
8
|
|
9 progname="$0"
|
|
10
|
|
11 # Exit if a command fails.
|
|
12 set -e
|
|
13
|
|
14 # Print out each line we read, for debugging's sake.
|
|
15 # set -v
|
|
16
|
|
17 cleanup=yes
|
|
18
|
|
19 while [ $# -gt 0 ]; do
|
|
20 case "$1" in
|
|
21 "--no-cleanup" )
|
|
22 cleanup=no
|
|
23 ;;
|
|
24 * )
|
|
25 echo "${progname}: Unrecognized argument: $1" >&2
|
|
26 exit 1
|
|
27 ;;
|
|
28 esac
|
|
29 shift
|
|
30 done
|
|
31
|
|
32 # Make sure we're running in the right place.
|
|
33 if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then
|
|
34 echo "${progname}: must run in the top directory of the Emacs" >&2
|
|
35 echo "distribution tree. Cd to that directory and try again." >&2
|
|
36 exit 1
|
|
37 fi
|
|
38
|
|
39 # Find out which version of Emacs this is.
|
|
40 version=`grep 'defconst[ ]*emacs-version' lisp/version.el \
|
|
41 | sed -e 's/^.*"\([0-9]+\.[0-9]+\)\..*$/\1/'`
|
|
42 if [ ! "${version}" ]; then
|
|
43 echo "${progname}: can't find current emacs version in ./lisp/version.el." >&2
|
|
44 exit 1
|
|
45 fi
|
|
46
|
|
47 # Make sure the subdirectory is available.
|
|
48 tempparent="make-dist.$$"
|
|
49 if [ -d ${tempparent} ]; then
|
|
50 echo "${progname}: staging directory ${tempparent} already exists.
|
|
51 Perhaps a previous invocation of ${progname} failed to clean up
|
|
52 after itself. Check that directories whose names are of the form
|
|
53 make-dist.NNNNN don't contain any important information, remove them,
|
|
54 and try again." >&2
|
|
55 exit 1
|
|
56 fi
|
|
57
|
|
58 echo "Creating staging directory: ${tempparent}"
|
|
59 mkdir ${tempparent}
|
|
60 emacsname="emacs-${version}"
|
|
61 tempdir="${tempparent}/${emacsname}"
|
|
62
|
|
63 echo "Creating top directory: ${tempdir}"
|
|
64 mkdir ${tempdir}
|
|
65
|
|
66 # We copy in the top-level files before creating the subdirectories in
|
|
67 # hopes that this will make the top-level files appear first in the
|
|
68 # tar file.
|
|
69 echo "Copying top-level files."
|
|
70 ln INSTALL PROBLEMS README ${tempdir}
|
|
71 ln ChangeLog Makefile.in build-install.in configure make-dist ${tempdir}
|
|
72
|
|
73 echo "Creating subdirectories."
|
|
74 for subdir in lisp lisp/term src src/m src/s lib-src oldXMenu \
|
|
75 etc lock local-lisp arch-lib cpp info man shortnames; do
|
|
76 mkdir ${tempdir}/${subdir}
|
|
77 done
|
|
78
|
|
79 echo "Copying lisp."
|
|
80 # Don't distribute =*.el files, site-init.el, or site-load.el.
|
|
81 (cd lisp
|
|
82 ln [a-zA-Z]*.el ../${tempdir}/lisp
|
|
83 ln [a-zA-Z]*.elc ../${tempdir}/lisp
|
|
84 ln [a-zA-Z]*.defns ../${tempdir}/lisp
|
|
85 ln ChangeLog README ../${tempdir}/lisp
|
|
86 cd ../${tempdir}/lisp
|
|
87 rm -f site-init site-init.el site-init.elc
|
|
88 rm -f site-load site-load.el site-load.elc)
|
|
89
|
|
90 echo "Copying lisp/term."
|
|
91 # Don't distribute =*.el files.
|
|
92 (cd lisp/term
|
|
93 ln [a-zA-Z]*.el ../../${tempdir}/lisp/term
|
|
94 ln [a-zA-Z]*.elc ../../${tempdir}/lisp/term
|
|
95 ln README ../../${tempdir}/lisp/term)
|
|
96
|
|
97 echo "Copying src."
|
|
98 # Don't distribute =*.[ch] files, or the configured versions of
|
|
99 # config.h.in, paths.h.in, or Makefile.in.
|
|
100 (cd src
|
|
101 ln [a-zA-Z]*.c ../${tempdir}/src
|
|
102 ln [a-zA-Z]*.h ../${tempdir}/src
|
|
103 ln [a-zA-Z]*.s ../${tempdir}/src
|
|
104 ln README Makefile.in ymakefile ChangeLog config.h.in paths.h.in \
|
|
105 ../${tempdir}/src
|
|
106 ln .gdbinit .dbxinit ../${tempdir}/src
|
|
107 ln *.com *.opt vms-pp.trans vmsbuild ../${tempdir}/src
|
|
108 cd ../${tempdir}/src
|
|
109 etags *.h *.c ../lisp/*.el)
|
|
110
|
|
111 echo "Copying src/m."
|
|
112 (cd src/m
|
|
113 ln README *.h ../../${tempdir}/src/m)
|
|
114
|
|
115 echo "Copying src/s."
|
|
116 (cd src/s
|
|
117 ln README *.h ../../${tempdir}/src/s)
|
|
118
|
|
119 echo "Copying lib-src."
|
|
120 (cd lib-src
|
|
121 ln [a-zA-Z]*.c [a-zA-Z]*.h [a-zA-Z]*.y [a-zA-Z]*.lex ../${tempdir}/lib-src
|
|
122 ln ChangeLog Makefile.in README testfile ../${tempdir}/lib-src)
|
|
123
|
|
124 echo "Copying oldXMenu."
|
|
125 (cd oldXMenu
|
|
126 ln *.c *.h ../${tempdir}/oldXMenu
|
|
127 ln README Makefile Imakefile ChangeLog ../${tempdir}/oldXMenu)
|
|
128
|
|
129 echo "Copying etc."
|
|
130 # Don't distribute DOC files, backups, autosaves, or tex litter.
|
|
131 (cd etc
|
|
132 ln [0-9a-zA-Z]* ../${tempdir}/etc
|
|
133 cd ../${tempdir}/etc
|
|
134 # Avoid an error when expanding the wildcards later.
|
|
135 for dummy in DOC-dummy dummy~ \#dummy\# dummy.dvi dummy.log; do
|
|
136 ln MACHINES ${dummy}
|
|
137 done
|
|
138 rm -f DOC* *~ \#*\# *.dvi *.log core)
|
|
139
|
|
140 # For now, we comment these out, since I'm not changing them any.
|
|
141 #!! echo "Copying cpp."
|
|
142 #!! (cd cpp
|
|
143 #!! ln cccp.c cexp.y Makefile README ../${tempdir}/cpp)
|
|
144 #!!
|
|
145 #!! echo "Copying info."
|
|
146 #!! # Don't distribute backups or autosaves.
|
|
147 #!! (cd info
|
|
148 #!! ln [a-zA-Z]* ../${tempdir}/info
|
|
149 #!! cd ../${tempdir}/info
|
|
150 #!! # Avoid an error when expanding the wildcards later.
|
|
151 #!! ln emacs dummy~ ; ln emacs \#dummy\#
|
|
152 #!! rm -f *~ \#*\# core)
|
|
153 #!!
|
|
154 #!! echo "Copying man."
|
|
155 #!! (cd man
|
|
156 #!! ln *.tex *.texinfo *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man
|
|
157 #!! ln *.c ../${tempdir}/man
|
|
158 #!! ln ChangeLog Makefile README split-man ../${tempdir}/man)
|
|
159
|
|
160 echo "Copying shortnames."
|
|
161 (cd shortnames
|
|
162 ln *.c ../${tempdir}/shortnames
|
|
163 ln Makefile reserved special ../${tempdir}/shortnames)
|
|
164
|
|
165 echo "Making sure copying notices are symlinks."
|
|
166 if [ -f ${tempdir}/etc/COPYING ]; then
|
|
167 rm ${tempdir}/etc/COPYING
|
|
168 ln etc/COPYING ${tempdir}/etc/COPYING
|
|
169 fi
|
|
170 for subdir in lisp src lib-src info shortnames; do
|
|
171 if [ -f ${tempdir}/${subdir}/COPYING ]; then
|
|
172 rm ${tempdir}/${subdir}/COPYING
|
|
173 fi
|
|
174 ln -s ../etc/COPYING ${tempdir}/${subdir}
|
|
175 done
|
|
176
|
|
177 echo "Creating tar file."
|
|
178 (cd ${tempparent}; tar cvf - ${emacsname}) | compress > ${emacsname}.tar.Z
|
|
179
|
|
180 if [ "${cleanup}" = yes ]; then
|
|
181 echo "Cleaning up the staging directory."
|
|
182 rm -rf ${tempparent}
|
|
183 fi
|