view mac/make-bin-dist @ 46943:34c75ce396ea

*** empty log message ***
author Miles Bader <miles@gnu.org>
date Mon, 19 Aug 2002 05:03:55 +0000
parents 01b93e5e53a7
children
line wrap: on
line source

#!/bin/sh

#### make-bin-dist: create a binary Emacs distribution tar file for
#### Mac OS X.  This basically runs a `configure' and `make install'
#### into a temporary directory and archives that directory.  It also
#### places the Emacs application bundle and a installer script in the
#### tar file.  The installer script is run to set up the XML file for
#### setting the environment variables used by Emacs when it is
#### started from the Finder.

# Copyright (C) 2002 Free Software Foundation, Inc.
#
# This file is part of GNU Emacs.
#
# GNU Emacs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Emacs; see the file COPYING.  If not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

progname="$0"

### Exit if a command fails.
#set -e

### Print out each line we read, for debugging's sake.
set -v

LANGUAGE=C
LC_ALL=C
LC_MESSAGES=
LANG=
export LANGUAGE LC_ALL LC_MESSAGES LANG

## Don't restrict access to any files.
umask 0

### Make sure we're running in the right place.
if [ ! -f Emacs.app/Contents/PkgInfo ]; then
  echo "${progname}: Can't find \`Emacs.app/Contents/PkgInfo'" >&2
  echo "${progname} must be run in the \`mac' directory of the Emacs" >&2
  echo "distribution tree.  cd to that directory and try again." >&2
  exit 1
fi

### Check whether file ../lisp/version.el exists.
if [ ! -f ../lisp/version.el ]; then
  echo "${progname}: Can't find \`../lisp/version.el'" >&2
  exit 1
fi

### Find out which version of Emacs this is.
shortversion=`grep 'defconst[	 ]*emacs-version' ../lisp/version.el \
	 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
version=`grep 'defconst[	 ]*emacs-version' ../lisp/version.el \
	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
if [ ! "${version}" ]; then
  echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2
  exit 1
fi

echo Version numbers are $version and $shortversion

### Make sure we don't already have a directory  emacs-${version}.

emacsname="emacs-${version}${new_extension}"

if [ -d ${emacsname} ]
then
  echo Directory "${emacsname}" already exists >&2
  exit 1
fi

### Make sure the subdirectory is available.
tempparent="make-bin-dist.tmp.$$"
if [ -d ${tempparent} ]; then
  echo "${progname}: staging directory \`${tempparent}' already exists.
Perhaps a previous invocation of \`${progname}' failed to clean up after
itself.  Check that directories whose names are of the form
\`make-dist.tmp.NNNNN' don't contain any important information, remove
them, and try again." >&2
  exit 1
fi

tempparentfull="`pwd`/${tempparent}"

echo Installing into directory ${tempparentfull} >&2

(cd ..; ./configure --prefix=${tempparentfull}; make install)

### This trap ensures that the staging directory will be cleaned up even
### when the script is interrupted in mid-career.
trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15

cp -r Emacs.app ${tempparent}

cp osx-install ${tempparent}

echo "Creating tar file"

mv ${tempparent} ${emacsname}

tar cvf - ${emacsname} | gzip > ${emacsname}-mac-bin.tar.gz

echo "Cleaning up the staging directory"
rm -rf ${emacsname}

### make-bin-dist ends here