46177
|
1 #!/bin/sh
|
|
2
|
|
3 #### make-package: create a Mac OS X package for use by the installer.
|
|
4 #### The installer will place the Emacs OSX application in
|
|
5 #### /Application/Emacs and the rest of emacs in the usual unix places
|
|
6 #### under /usr/local or some other location if specified as the first
|
|
7 #### argument. The disc image will be in the file EmacsInstaller.dmg.
|
|
8 ####
|
|
9 #### Upon installation, this will leave two versions of emacs on the
|
|
10 #### computer, 20.7 and 21.1.
|
|
11 ####
|
|
12 #### Examples:
|
|
13 #### ./make-package
|
|
14 #### Will create an installer that will place the emacs support
|
|
15 #### files inside /usr/local.
|
|
16 #### ./make-package /usr
|
|
17 #### Will create an installer that will place the emacs support
|
|
18 #### files inside /usr. This will replace the default version of
|
|
19 #### emacs included with Mac OS X.
|
|
20
|
75348
|
21 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
46177
|
22 #
|
|
23 # This file is part of GNU Emacs.
|
|
24 #
|
|
25 # GNU Emacs is free software; you can redistribute it and/or modify
|
|
26 # it under the terms of the GNU General Public License as published by
|
78252
|
27 # the Free Software Foundation; either version 3, or (at your option)
|
46177
|
28 # any later version.
|
|
29 #
|
|
30 # GNU Emacs is distributed in the hope that it will be useful,
|
|
31 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
32 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
33 # GNU General Public License for more details.
|
|
34 #
|
|
35 # You should have received a copy of the GNU General Public License
|
|
36 # along with GNU Emacs; see the file COPYING. If not, write to the
|
64083
|
37 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
38 # Boston, MA 02110-1301, USA.
|
46177
|
39 #
|
|
40 # Contributed by Steven Tamm (steventamm@mac.com).
|
|
41
|
|
42 progname="$0"
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
43
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
44 srcdir="`pwd`/.."
|
48990
|
45 builddir=${srcdir}
|
46183
|
46
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
47 ## Default location to place it is /usr/local
|
46177
|
48 prefix=/usr/local
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
49 appsdir=/Applications
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
50 emapp=Emacs.app
|
46183
|
51 with_config=yes
|
47808
|
52 with_app=yes
|
|
53 with_x=no
|
49005
|
54 comp_diskimage=no
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
55 self_contained=no
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
56 app_symlink=no
|
48616
|
57 full_dist=yes
|
66246
|
58 compressed_dist=no
|
48990
|
59 build_in_place=no
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
60 keep_directory=no
|
46183
|
61
|
|
62 ac_prev=
|
|
63 display_usage=false;
|
47808
|
64 config_options=;
|
46183
|
65 while test $# != 0
|
|
66 do
|
|
67 if test -n "$ac_prev"; then
|
|
68 eval "$ac_prev=\$1"
|
|
69 ac_prev=
|
|
70 continue
|
|
71 fi
|
|
72 case $1 in
|
|
73 -help | --help | --hel | --he | -h)
|
|
74 display_usage=yes ;;
|
|
75 -p | -prefix | --p | --prefix)
|
|
76 ac_prev=prefix ;;
|
|
77 -p=* | -prefix=* | --p=* | --prefix=*)
|
|
78 prefix=`expr "x$1" : 'x[^=]*=\(.*\)'` ;;
|
48990
|
79 --build-in-place | --build-in-place )
|
|
80 build_in_place=yes ;;
|
|
81 --build-dir | -build-dir | --builddir | -build-dir)
|
|
82 build_in_place=no
|
|
83 ac_prev=builddir;;
|
|
84 --build-dir=* | -build-dir=* | -builddir=* | --builddir=*)
|
|
85 build_in_place=no
|
|
86 builddir=`expr "x$1" : 'x[^=]*=\(.*\)'`;;
|
47782
de56ca3f523d
make-package: Now calls make bootstrap if .elc files are missing
Steven Tamm <steventamm@mac.com>
diff
changeset
|
87 -no-configure | -no-conf | --no-configure | --no-conf | --without-config)
|
46183
|
88 with_config=no ;;
|
47808
|
89 -no-app | --no-app | -without-app | --without-app)
|
|
90 with_app=no ;;
|
|
91 -without-x | --without-x)
|
|
92 with_x=no ;;
|
46183
|
93 -with-x | --with-x)
|
47808
|
94 with_x=yes
|
|
95 with_app=no ;;
|
48616
|
96 --without-full-dist | -without-full-dist | -no-full-dist | -no-full)
|
|
97 full_dist=no ;;
|
66246
|
98 --compressed-dist)
|
|
99 compressed_dist=yes ;;
|
48749
|
100 --self-contained | -self-contained | --with-self-contained-app | -sc)
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
101 self_contained=yes ;;
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
102 -app-symlink | --app-symlink | -symlink | --symlink | --asl)
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
103 app_symlink=yes ;;
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
104 --keep-dir)
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
105 keep_directory=yes ;;
|
47808
|
106 -C,* | -c,*)
|
|
107 config_options="$config_options `expr "x$1" : 'x[^,]*,\(.*\)'`" ;;
|
|
108 -M,* | -m,*)
|
|
109 make_options="$make_options `expr "x$1" : 'x[^,]*,\(.*\)'`" ;;
|
48749
|
110 *)
|
|
111 display_usage=yes ;;
|
46183
|
112 esac
|
|
113 shift
|
|
114 done
|
|
115
|
47808
|
116 if test "$with_x" = "no"; then
|
|
117 config_options="--without-x $config_options"
|
|
118 fi
|
|
119
|
46183
|
120 if test "$display_usage" = "yes"; then
|
|
121 cat <<EOF
|
49600
|
122 \`make-package' generates a Mac OS X installer package from an Emacs
|
|
123 distribution. By default, this first runs ./configure on the emacs
|
|
124 directory. Then make install to create the emacs distribution.
|
|
125 Then some mac-specific commands to generate the required information
|
47808
|
126 for the mac package. The installer will, by default, create a
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
127 Carbon application called Emacs in the ${appsdir} directory, with the
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
128 shared emacs files in /usr/local
|
46183
|
129
|
|
130 Usage: $0 [OPTION]
|
|
131
|
|
132 Options:
|
|
133 -h, --help display this help and exit
|
|
134 --prefix=DIR Set install location for the Mac OS X package
|
|
135 of the emacs related file. By default /usr/local
|
|
136 --no-conf Do not run the configure script before running
|
|
137 make install.
|
47808
|
138 --without-app Do not create the Emacs application bundle
|
49600
|
139 --with-x Setup the install to use X Windows for its
|
47808
|
140 windowed display, instead of carbon. Implies
|
|
141 --without-app.
|
48616
|
142 --without-full-dist Do not include all the .el files in the distribution.
|
|
143 This is discouraged except if disk space is critical.
|
66246
|
144 --compressed-dist Compress .el and info files in the distribution.
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
145 --app-symlink Have the Emacs.app executable be a symlink
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
146 to the install in [prefix]/bin/emacs and have
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
147 the emacs executable link to emacs-${version}
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
148 --self-contained Create an Emacs.app that is self-contained;
|
49600
|
149 prefix will be ignored and all files installed
|
|
150 inside the application
|
48990
|
151 --build-in-place Build the application in the source directory
|
49600
|
152 instead of a temporary directory.
|
48990
|
153 --build-dir=DIR Build the application in the specified directory
|
|
154 instead of a temporary directory. Mutually exclusive
|
|
155 with --build-in-place.
|
47808
|
156 -C,option Pass option to configure
|
|
157 -M,option Pass option to make
|
46183
|
158 EOF
|
|
159 exit 0
|
46177
|
160 fi
|
|
161
|
|
162 ### Exit if a command fails.
|
|
163 #set -e
|
|
164
|
|
165 ### Print out each line we read, for debugging's sake.
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
166 #set -v
|
46177
|
167
|
|
168 LANGUAGE=C
|
|
169 LC_ALL=C
|
|
170 LC_MESSAGES=
|
|
171 LANG=
|
|
172 export LANGUAGE LC_ALL LC_MESSAGES LANG
|
|
173
|
|
174 ## Don't restrict access to any files.
|
|
175 umask 0
|
|
176
|
|
177 ### Make sure we're running in the right place.
|
|
178 if [ -f Emacs.pkg ]; then
|
|
179 echo "${progname}: Package Emacs.pkg already exists.
|
|
180 Perhaps a previous invocation of \`${progname}' failed to clean up after
|
|
181 itself. Move or delete Emacs.pkg and try again." >&2
|
|
182 exit 1
|
|
183 fi
|
|
184
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
185 if test $with_app == "yes" && [ ! -f ${emapp}/Contents/PkgInfo ]; then
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
186 echo "${progname}: Can't find \`${emapp}/Contents/PkgInfo'" >&2
|
46177
|
187 echo "${progname} must be run in the \`mac' directory of the Emacs" >&2
|
|
188 echo "distribution tree. cd to that directory and try again." >&2
|
|
189 exit 1
|
|
190 fi
|
|
191
|
|
192 ### Check whether file ../lisp/version.el exists.
|
|
193 if [ ! -f ../lisp/version.el ]; then
|
|
194 echo "${progname}: Can't find \`../lisp/version.el'" >&2
|
|
195 exit 1
|
|
196 fi
|
|
197
|
|
198 ### Find out which version of Emacs this is.
|
|
199 shortversion=`grep 'defconst[ ]*emacs-version' ../lisp/version.el \
|
|
200 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
|
|
201 version=`grep 'defconst[ ]*emacs-version' ../lisp/version.el \
|
|
202 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
|
|
203 if [ ! "${version}" ]; then
|
|
204 echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2
|
|
205 exit 1
|
|
206 fi
|
|
207
|
|
208 echo Version numbers are $version and $shortversion
|
|
209
|
|
210 ### Make sure we don't already have a directory emacs-${version}.
|
|
211
|
|
212 emacsname="emacs-${version}${new_extension}"
|
|
213
|
|
214 if [ -d ${emacsname} ]
|
|
215 then
|
|
216 echo Directory "${emacsname}" already exists >&2
|
|
217 exit 1
|
|
218 fi
|
|
219
|
|
220 ### Make sure the subdirectory is available.
|
|
221 tempparent="make-package.tmp.$$"
|
|
222 if [ -d ${tempparent} ]; then
|
|
223 echo "${progname}: staging directory \`${tempparent}' already exists.
|
|
224 Perhaps a previous invocation of \`${progname}' failed to clean up after
|
|
225 itself. Check that directories whose names are of the form
|
|
226 \`make-dist.tmp.NNNNN' don't contain any important information, remove
|
|
227 them, and try again." >&2
|
|
228 exit 1
|
|
229 fi
|
|
230
|
|
231 if [ -d /Volumes/Emacs ]; then
|
|
232 echo "${progname}: Already have an Emacs disc image mounted. Please
|
|
233 eject that disc image and try again." >&2
|
|
234 exit 1
|
|
235 fi
|
|
236
|
|
237 tempparentfull="`pwd`/${tempparent}"
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
238 tempparentdist=${tempparentfull}/dist
|
46177
|
239
|
48990
|
240 if test "$build_in_place" = "no"; then
|
|
241 case ${builddir} in
|
|
242 ${srcdir})
|
|
243 tempbuild="make-package.build.$$"
|
|
244 builddir="`pwd`/${tempbuild}"
|
|
245 removable_build_dir=${builddir}
|
49230
|
246 mkdir -p ${builddir}
|
48990
|
247 ;;
|
|
248 [\\/]* | ?:[\\/]* ) #Absolutepath.
|
|
249 mkdir -p ${builddir}
|
|
250 ;;
|
|
251 *)
|
|
252 mkdir -p ${builddir}
|
|
253 builddir=`cd $builddir && pwd`
|
|
254 ;;
|
|
255 esac
|
|
256 fi
|
|
257 # Location of install package
|
|
258 packagedir=${builddir}/mac/Emacs.pkg
|
|
259
|
|
260 echo Building in directory ${builddir}
|
46177
|
261 echo Installing into directory ${tempparentfull} >&2
|
|
262
|
48990
|
263 ### This trap ensures that the staging directory will be cleaned up even
|
|
264 ### when the script is interrupted in mid-career.
|
|
265 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent} ${removable_build_dir} ${packagedir}; exit 1" 1 2 15
|
|
266
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
267 # Run configure in the new tempparent directory
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
268 if test "$with_config" = "yes"; then
|
48990
|
269 (cd ${builddir}; ${srcdir}/configure ${config_options} --prefix=${prefix})
|
46183
|
270 fi
|
|
271
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
272 installprefix=${tempparentfull}${prefix}
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
273 if test "$self_contained" = "yes"; then
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
274 # If selfcontained, the local directory is Resources directory
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
275 installprefix=$tempparentfull/$appsdir/$emapp/Contents/Resources
|
47782
de56ca3f523d
make-package: Now calls make bootstrap if .elc files are missing
Steven Tamm <steventamm@mac.com>
diff
changeset
|
276 fi
|
46177
|
277
|
49091
|
278
|
|
279 make_options="prefix=${installprefix} $make_options"
|
|
280
|
|
281 if test "$with_app" = "yes"; then
|
|
282 make_options="carbon_appdir=${tempparentfull}/Applications $make_options"
|
|
283 fi
|
|
284
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
285 ## Make bootstrap if .elc files are missing from distribution
|
48990
|
286 if [ ! -f ${srcdir}/lisp/abbrev.elc ]; then
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
287 echo "Required .elc files missing; making bootstrap..."
|
49091
|
288 if ! (cd ${builddir}; make bootstrap $make_options); then
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
289 echo "Make bootstrap failed... Aborting make-package."
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
290 exit 2
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
291 fi
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
292 fi
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
293
|
49091
|
294 if ! (cd ${builddir}; make install $make_options); then
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
295 echo "Make failed... Aborting make-package."
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
296 exit 1
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
297 fi
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
298
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
299 if test "$full_dist" == "no"; then
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
300 echo "Removing unneeded .el files"
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
301 sharedir=$installprefix/share/emacs/$version
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
302 find $sharedir/lisp $sharedir/leim -name "*.elc" -print | sed 's|\(.*\)\.elc$|/bin/rm -f \1.el|' | /bin/sh -s
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
303 fi
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
304
|
66246
|
305 if test "$compressed_dist" == "yes" -a "$full_dist" == "yes"; then
|
|
306 echo "Compressing .el files"
|
|
307 sharedir=$installprefix/share/emacs/$version
|
|
308 find $sharedir/lisp $sharedir/leim -name "*.elc" -print | sed 's|\(.*\)\.elc$|/usr/bin/gzip -9 \1.el|' | /bin/sh -s
|
|
309 echo "Compressing info files"
|
|
310 find $installprefix/info -type f ! -name dir -print | sed 's|\(.*\)$|/usr/bin/gzip -9 \1|' | /bin/sh -s
|
|
311 fi
|
|
312
|
47808
|
313 if test "$with_app" == "yes"; then
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
314 echo "Creating Emacs.app application"
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
315 tempappdir=${tempparentfull}${appsdir}
|
48749
|
316 tempemapp=${tempappdir}/${emapp}/Contents/MacOS/Emacs
|
47808
|
317 ## Delete any CVS files
|
48789
|
318 find ${tempappdir} -name "CVS" -type d -exec rm -rf {} \;
|
48749
|
319
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
320 ## Have application be a symlink to ${prefix}/bin/emacs
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
321 if test "$app_symlink" == "yes"; then
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
322 echo "Creating application symlink"
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
323 rm ${tempemapp}
|
48749
|
324 ln -s ${prefix}/bin/${emacsname} ${tempemapp}
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
325 fi
|
47808
|
326 fi
|
46177
|
327
|
77077
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
diff
changeset
|
328 compver=`uname -p`-apple-darwin`uname -r`
|
50450
33c5c2bf40c2
Place libexec executables directly under the Contents/MacOS/libexec if
Steven Tamm <steventamm@mac.com>
diff
changeset
|
329
|
48749
|
330 if test "$self_contained" = "yes"; then
|
|
331 # Move shared files down to Resources directory
|
|
332 mv $installprefix/share/emacs/$version/* $installprefix
|
75549
|
333 mv $installprefix/share/info $installprefix
|
|
334 mv $installprefix/share/man $installprefix
|
48749
|
335 rm -rf $installprefix/share
|
|
336 # These directories might remain in Resources
|
|
337 mv $installprefix/bin $installprefix/../MacOS/bin
|
50450
33c5c2bf40c2
Place libexec executables directly under the Contents/MacOS/libexec if
Steven Tamm <steventamm@mac.com>
diff
changeset
|
338 mv $installprefix/libexec/emacs/$version/$compver $installprefix/../MacOS/libexec
|
48749
|
339 # Make the application binary a hard link
|
|
340 rm $installprefix/../MacOS/Emacs
|
|
341 ln $installprefix/../MacOS/bin/emacs $installprefix/../MacOS/Emacs
|
|
342 fi
|
|
343
|
|
344
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
345 # Remove unnecessary .el files
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
346 #if test "$full_dist" = no; then
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
347 #fi
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
348
|
46177
|
349 echo "Creating Package Info file"
|
|
350
|
49230
|
351 mkdir -p ${packagedir}
|
48990
|
352 mkdir ${packagedir}/Contents
|
|
353 mkdir ${packagedir}/Contents/Resources
|
|
354 mkdir ${packagedir}/Contents/Resources/English.lproj
|
49005
|
355 echo -n 'pmkrpkg1' > ${packagedir}/Contents/PkgInfo
|
|
356
|
|
357 # Create ReadMe and License files
|
|
358 cp ${srcdir}/COPYING ${packagedir}/Contents/Resources/License.txt
|
|
359 cp ${srcdir}/mac/README ${packagedir}/Contents/Resources/ReadMe.txt
|
46177
|
360
|
48990
|
361 infofile=${packagedir}/Contents/Resources/English.lproj/Emacs.info
|
46177
|
362
|
48990
|
363 echo 'Title GNU Emacs' > ${infofile}
|
46177
|
364 echo "Version ${version}" >> ${infofile}
|
|
365 echo "Description Install GNU Emacs ${version} as a command-line app and a Mac OS Application" >> ${infofile}
|
|
366 echo 'DefaultLocation /' >> ${infofile}
|
|
367 echo 'DeleteWarning' >> ${infofile}
|
|
368 echo 'NeedsAuthorization YES' >> ${infofile}
|
|
369 echo 'Required NO' >> ${infofile}
|
|
370 echo 'Relocatable NO' >> ${infofile}
|
|
371 echo 'RequiresReboot NO' >> ${infofile}
|
|
372 echo 'UseUserMask NO' >> ${infofile}
|
|
373 echo 'OverwritePermissions NO' >> ${infofile}
|
|
374 echo 'InstallFat NO' >> ${infofile}
|
|
375
|
49600
|
376 ### Set the install directory to install files as root...
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
377 ### Not sure if this is a good diea
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
378 # echo "Setting owner to root"
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
379 # chown -Rh 0 ${tempparentfull}
|
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
380
|
46177
|
381 echo "Creating pax file"
|
48990
|
382 (cd ${tempparentfull}; pax -w -f ${packagedir}/Contents/Resources/Emacs.pax .)
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
383 echo "Compressing pax file"
|
48990
|
384 gzip ${packagedir}/Contents/Resources/Emacs.pax
|
46177
|
385
|
|
386 echo "Creating bom file"
|
48990
|
387 mkbom ${tempparentfull} ${packagedir}/Contents/Resources/Emacs.bom
|
46177
|
388
|
|
389 echo "Generating sizes file"
|
48990
|
390 sizesfile=${packagedir}/Contents/Resources/Emacs.sizes
|
46177
|
391
|
48979
|
392 numFiles=`du -a ${tempparent} | wc -l`
|
|
393 installedSize=`du -s ${tempparent} | cut -f1`
|
48990
|
394 compressedSize=`du -s ${packagedir} | cut -f1`
|
46177
|
395
|
|
396 echo "NumFiles ${numFiles}" > ${sizesfile}
|
|
397 echo "InstalledSize ${installedSize}" >> ${sizesfile}
|
|
398 echo "CompressedSize ${compressedSize}" >> ${sizesfile}
|
|
399 cat ${sizesfile}
|
|
400
|
|
401 echo "Creating Disc Image"
|
50724
efd65678bb08
* make-package: Allocate 5% extra space on disk image for directories
Andrew Choi <akochoi@shaw.ca>
diff
changeset
|
402 ## From hdiutil man page, a sector is 512k. Allocate an extra 5% for
|
efd65678bb08
* make-package: Allocate 5% extra space on disk image for directories
Andrew Choi <akochoi@shaw.ca>
diff
changeset
|
403 ## directories and partition tables.
|
efd65678bb08
* make-package: Allocate 5% extra space on disk image for directories
Andrew Choi <akochoi@shaw.ca>
diff
changeset
|
404 sectorsAlloced=`echo 2.1*${compressedSize}|bc`
|
48990
|
405 hdiutil create -ov ${builddir}/mac/EmacsRW -sectors ${sectorsAlloced}
|
46177
|
406 ## Need to format the disc image before mounting
|
48990
|
407 mountLoc=`hdid -nomount ${builddir}/mac/EmacsRW.dmg | grep HFS | cut -f1`
|
46177
|
408 /sbin/newfs_hfs -v Emacs ${mountLoc}
|
|
409 hdiutil eject ${mountLoc}
|
|
410 echo "Copying Package to Disc Image"
|
48990
|
411 hdid ${builddir}/mac/EmacsRW.dmg
|
46177
|
412
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
413 if test "$keep_directory" = "no"; then
|
48990
|
414 rm -rf ${tempparentfull}
|
|
415 else
|
|
416 mv ${tempparentfull} ${emacsname}
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
417 fi
|
46177
|
418
|
|
419 if [ ! -d /Volumes/Emacs ]; then
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
420 echo "Could not create disc image. The Emacs installer package (Emacs.pkg)
|
49600
|
421 in this directory should be correct. Please use the Disc Copy program to
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
422 create a disc image." >&2
|
46177
|
423 exit 0
|
|
424 fi
|
|
425
|
48990
|
426 cp -R ${packagedir} /Volumes/Emacs
|
46177
|
427
|
|
428 ## Converting Disk Image to read-only
|
|
429 echo 'Converting Disc Image to read-only'
|
|
430 hdiutil eject ${mountLoc}
|
48990
|
431 hdiutil resize ${builddir}/mac/EmacsRW.dmg -sectors min
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
432 if test "$comp_diskimage" = "yes"; then
|
48990
|
433 hdiutil convert ${builddir}/mac/EmacsRW.dmg -format UDZO -imagekey zlib-level=2 -o ${srcdir}/mac/EmacsInstaller.dmg
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
434 else
|
48990
|
435 hdiutil convert ${builddir}/mac/EmacsRW.dmg -format UDRO -o ${srcdir}/mac/EmacsInstaller.dmg
|
48603
ac86b769c135
Added a lot of options to reduce disk size of both the installer and the final
Steven Tamm <steventamm@mac.com>
diff
changeset
|
436 fi
|
48990
|
437 rm ${builddir}/mac/EmacsRW.dmg
|
46177
|
438
|
|
439 echo "Cleaning up the staging directory"
|
48990
|
440 rm -rf ${builddir}/mac/Emacs.pkg ${removable_build_dir}
|
46177
|
441
|
52401
|
442 # arch-tag: 1b631d0d-9fde-4f71-80c0-33e0e5815515
|
46177
|
443 ### make-package ends here
|