comparison mac/make-package @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 23a1cea22d13
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
16 #### ./make-package /usr 16 #### ./make-package /usr
17 #### Will create an installer that will place the emacs support 17 #### Will create an installer that will place the emacs support
18 #### files inside /usr. This will replace the default version of 18 #### files inside /usr. This will replace the default version of
19 #### emacs included with Mac OS X. 19 #### emacs included with Mac OS X.
20 20
21 # Copyright (C) 2002 Free Software Foundation, Inc. 21 # Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
22 # 22 #
23 # This file is part of GNU Emacs. 23 # This file is part of GNU Emacs.
24 # 24 #
25 # GNU Emacs is free software; you can redistribute it and/or modify 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 26 # it under the terms of the GNU General Public License as published by
32 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 32 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 # GNU General Public License for more details. 33 # GNU General Public License for more details.
34 # 34 #
35 # You should have received a copy of the GNU General Public License 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 36 # along with GNU Emacs; see the file COPYING. If not, write to the
37 # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 37 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 # Boston, MA 02111-1307, USA. 38 # Boston, MA 02110-1301, USA.
39 # 39 #
40 # Contributed by Steven Tamm (steventamm@mac.com). 40 # Contributed by Steven Tamm (steventamm@mac.com).
41 41
42 progname="$0" 42 progname="$0"
43 43
53 with_x=no 53 with_x=no
54 comp_diskimage=no 54 comp_diskimage=no
55 self_contained=no 55 self_contained=no
56 app_symlink=no 56 app_symlink=no
57 full_dist=yes 57 full_dist=yes
58 compressed_dist=no
58 build_in_place=no 59 build_in_place=no
59 keep_directory=no 60 keep_directory=no
60 61
61 ac_prev= 62 ac_prev=
62 display_usage=false; 63 display_usage=false;
92 -with-x | --with-x) 93 -with-x | --with-x)
93 with_x=yes 94 with_x=yes
94 with_app=no ;; 95 with_app=no ;;
95 --without-full-dist | -without-full-dist | -no-full-dist | -no-full) 96 --without-full-dist | -without-full-dist | -no-full-dist | -no-full)
96 full_dist=no ;; 97 full_dist=no ;;
98 --compressed-dist)
99 compressed_dist=yes ;;
97 --self-contained | -self-contained | --with-self-contained-app | -sc) 100 --self-contained | -self-contained | --with-self-contained-app | -sc)
98 self_contained=yes ;; 101 self_contained=yes ;;
99 -app-symlink | --app-symlink | -symlink | --symlink | --asl) 102 -app-symlink | --app-symlink | -symlink | --symlink | --asl)
100 app_symlink=yes ;; 103 app_symlink=yes ;;
101 --keep-dir) 104 --keep-dir)
136 --with-x Setup the install to use X Windows for its 139 --with-x Setup the install to use X Windows for its
137 windowed display, instead of carbon. Implies 140 windowed display, instead of carbon. Implies
138 --without-app. 141 --without-app.
139 --without-full-dist Do not include all the .el files in the distribution. 142 --without-full-dist Do not include all the .el files in the distribution.
140 This is discouraged except if disk space is critical. 143 This is discouraged except if disk space is critical.
144 --compressed-dist Compress .el and info files in the distribution.
141 --app-symlink Have the Emacs.app executable be a symlink 145 --app-symlink Have the Emacs.app executable be a symlink
142 to the install in [prefix]/bin/emacs and have 146 to the install in [prefix]/bin/emacs and have
143 the emacs executable link to emacs-${version} 147 the emacs executable link to emacs-${version}
144 --self-contained Create an Emacs.app that is self-contained; 148 --self-contained Create an Emacs.app that is self-contained;
145 prefix will be ignored and all files installed 149 prefix will be ignored and all files installed
296 echo "Removing unneeded .el files" 300 echo "Removing unneeded .el files"
297 sharedir=$installprefix/share/emacs/$version 301 sharedir=$installprefix/share/emacs/$version
298 find $sharedir/lisp $sharedir/leim -name "*.elc" -print | sed 's|\(.*\)\.elc$|/bin/rm -f \1.el|' | /bin/sh -s 302 find $sharedir/lisp $sharedir/leim -name "*.elc" -print | sed 's|\(.*\)\.elc$|/bin/rm -f \1.el|' | /bin/sh -s
299 fi 303 fi
300 304
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
301 if test "$with_app" == "yes"; then 313 if test "$with_app" == "yes"; then
302 echo "Creating Emacs.app application" 314 echo "Creating Emacs.app application"
303 tempappdir=${tempparentfull}${appsdir} 315 tempappdir=${tempparentfull}${appsdir}
304 tempemapp=${tempappdir}/${emapp}/Contents/MacOS/Emacs 316 tempemapp=${tempappdir}/${emapp}/Contents/MacOS/Emacs
305 ## Delete any CVS files 317 ## Delete any CVS files
311 rm ${tempemapp} 323 rm ${tempemapp}
312 ln -s ${prefix}/bin/${emacsname} ${tempemapp} 324 ln -s ${prefix}/bin/${emacsname} ${tempemapp}
313 fi 325 fi
314 fi 326 fi
315 327
328 compver=powerpc-apple-darwin`uname -r`
329
316 if test "$self_contained" = "yes"; then 330 if test "$self_contained" = "yes"; then
317 # Move shared files down to Resources directory 331 # Move shared files down to Resources directory
318 mv $installprefix/share/emacs/$version/* $installprefix 332 mv $installprefix/share/emacs/$version/* $installprefix
319 rm -rf $installprefix/share 333 rm -rf $installprefix/share
320 # These directories might remain in Resources 334 # These directories might remain in Resources
321 mv $installprefix/bin $installprefix/../MacOS/bin 335 mv $installprefix/bin $installprefix/../MacOS/bin
322 mv $installprefix/libexec $installprefix/../MacOS/libexec 336 mv $installprefix/libexec/emacs/$version/$compver $installprefix/../MacOS/libexec
323 # Make the application binary a hard link 337 # Make the application binary a hard link
324 rm $installprefix/../MacOS/Emacs 338 rm $installprefix/../MacOS/Emacs
325 ln $installprefix/../MacOS/bin/emacs $installprefix/../MacOS/Emacs 339 ln $installprefix/../MacOS/bin/emacs $installprefix/../MacOS/Emacs
326 fi 340 fi
327 341
381 echo "InstalledSize ${installedSize}" >> ${sizesfile} 395 echo "InstalledSize ${installedSize}" >> ${sizesfile}
382 echo "CompressedSize ${compressedSize}" >> ${sizesfile} 396 echo "CompressedSize ${compressedSize}" >> ${sizesfile}
383 cat ${sizesfile} 397 cat ${sizesfile}
384 398
385 echo "Creating Disc Image" 399 echo "Creating Disc Image"
386 ## Allocate an extra 5000 sectors (about 2.5 mg) 400 ## From hdiutil man page, a sector is 512k. Allocate an extra 5% for
387 ## Note a sector appears to be 512k 401 ## directories and partition tables.
388 sectorsAlloced=`echo 2*${compressedSize}+20|bc` 402 sectorsAlloced=`echo 2.1*${compressedSize}|bc`
389 hdiutil create -ov ${builddir}/mac/EmacsRW -sectors ${sectorsAlloced} 403 hdiutil create -ov ${builddir}/mac/EmacsRW -sectors ${sectorsAlloced}
390 ## Need to format the disc image before mounting 404 ## Need to format the disc image before mounting
391 mountLoc=`hdid -nomount ${builddir}/mac/EmacsRW.dmg | grep HFS | cut -f1` 405 mountLoc=`hdid -nomount ${builddir}/mac/EmacsRW.dmg | grep HFS | cut -f1`
392 /sbin/newfs_hfs -v Emacs ${mountLoc} 406 /sbin/newfs_hfs -v Emacs ${mountLoc}
393 hdiutil eject ${mountLoc} 407 hdiutil eject ${mountLoc}
421 rm ${builddir}/mac/EmacsRW.dmg 435 rm ${builddir}/mac/EmacsRW.dmg
422 436
423 echo "Cleaning up the staging directory" 437 echo "Cleaning up the staging directory"
424 rm -rf ${builddir}/mac/Emacs.pkg ${removable_build_dir} 438 rm -rf ${builddir}/mac/Emacs.pkg ${removable_build_dir}
425 439
440 # arch-tag: 1b631d0d-9fde-4f71-80c0-33e0e5815515
426 ### make-package ends here 441 ### make-package ends here