#!/bin/sh
-# $Id: make-dist-files,v 1.12 2001/02/23 05:19:03 cph Exp $
+# $Id: make-dist-files,v 1.13 2001/03/03 05:28:05 cph Exp $
#
# Copyright (c) 2000-2001 Massachusetts Institute of Technology
#
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+set -e
+
TYPE=$1
DESTINATION=$2
. /scheme/v7/dist/release-prefix
-BUILD_DIR="`pwd`/build-$$"
-BINDIR=${BUILD_DIR}/usr/local/bin
-AUXDIR=${BUILD_DIR}/usr/local/lib/mit-scheme
+SRC_FILE="$(get_release_prefix)-src.tar.gz"
+if [ ! -f "${SRC_FILE}" ]; then
+ echo "No source file: ${SRC_FILE}."
+ exit 1
+fi
+
+BUILD_DIR="$(pwd)/$(get_release_prefix)"
+IMAGE_DIR="$(pwd)/image-$$"
+BINDIR="${IMAGE_DIR}/usr/local/bin"
+AUXDIR="${IMAGE_DIR}/usr/local/lib/mit-scheme"
MKINSTALLDIRS="/scheme/v7/src/mkinstalldirs"
INSTALL="install"
INSTALL_DATA="${INSTALL} -m 644"
+rm -rf ${BUILD_DIR} ${IMAGE_DIR}
+tar xzf "${SRC_FILE}"
+
+cd "${BUILD_DIR}/src"
+./configure --enable-static-libs=yes --with-mcrypt=no
+make
+make install DESTDIR="${IMAGE_DIR}"
+${MKINSTALLDIRS} "${AUXDIR}/doc/."
+${INSTALL_DATA} COPYING "${AUXDIR}/doc/."
+
+cd "${BUILD_DIR}/doc"
+./configure
+make
+make install-info-gz DESTDIR="${IMAGE_DIR}" \
+ infodir=/usr/local/lib/mit-scheme/edwin/info
+make install-html DESTDIR="${IMAGE_DIR}"
+
rm -rf ${BUILD_DIR}
-(
- cd /scheme/v7/linux
- make install DESTDIR=${BUILD_DIR}
-)
-(
- cd /scheme/v7/doc
- make install-info-gz DESTDIR=${BUILD_DIR} \
- infodir=/usr/local/lib/mit-scheme/edwin/info
- make install-html DESTDIR=${BUILD_DIR}
-)
-
-${MKINSTALLDIRS} ${AUXDIR}/doc
-${INSTALL_DATA} /scheme/v7/src/COPYING ${AUXDIR}/doc/.
-
-${INSTALL_DATA} /usr/local/info/dir ${AUXDIR}/edwin/info/.
-${INSTALL_DATA} /usr/local/info/r4rs.* ${AUXDIR}/edwin/info/.
-${INSTALL_DATA} /usr/local/info/r5rs.* ${AUXDIR}/edwin/info/.
-
-BANDS="runtime.com compiler.com edwin.com all.com 6001.com"
+
+${INSTALL_DATA} /usr/local/info/dir "${AUXDIR}/edwin/info/."
+${INSTALL_DATA} /usr/local/info/r4rs.* "${AUXDIR}/edwin/info/."
+${INSTALL_DATA} /usr/local/info/r5rs.* "${AUXDIR}/edwin/info/."
+
+ALL_BANDS="runtime.com compiler.com edwin.com all.com 6001.com"
case ${TYPE} in
std)
- rm -f ${AUXDIR}/6001.com
- ;;
-6001)
- for BAND in ${BANDS}; do
- [ "${BAND}" = "6001.com" ] || rm -f ${AUXDIR}/${BAND}
+ for BAND in ${ALL_BANDS}; do
+ case "${BAND}" in
+ "runtime.com"|"all.com")
+ ;;
+ *)
+ rm -f "${AUXDIR}/${BAND}"
+ ;;
+ esac
done
;;
all)
- for BAND in ${BANDS}; do
- [ "${BAND}" = "all.com" ] || rm -f ${AUXDIR}/${BAND}
+ ;;
+6001)
+ for BAND in ${ALL_BANDS}; do
+ case "${BAND}" in
+ "6001.com")
+ ;;
+ *)
+ rm -f "${AUXDIR}/${BAND}"
+ ;;
+ esac
done
;;
scmutils)
- for BAND in ${BANDS}; do
- rm -f ${AUXDIR}/${BAND}
+ for BAND in ${ALL_BANDS}; do
+ rm -f "${AUXDIR}/${BAND}"
done
;;
esac
#
if [ ${TYPE} = scmutils ]; then
MECH_SOURCE=/sw/scmutils
- MECH_DEST=${BUILD_DIR}/usr/local/scmutils
+ MECH_DEST=${IMAGE_DIR}/usr/local/scmutils
${MKINSTALLDIRS} ${MECH_DEST}
- for DIR in `cd ${MECH_SOURCE};find src -type d -print`; do
+ for DIR in $(cd ${MECH_SOURCE};find src -type d -print); do
${MKINSTALLDIRS} ${MECH_DEST}/${DIR}
for FILE in ${MECH_SOURCE}/${DIR}/*.scm \
${MECH_SOURCE}/${DIR}/*.doc \
rm -rf ${MECH_DEST}/src/commentary
rm -rf ${MECH_DEST}/src/poly/zuras
- for DIR in `cd ${MECH_SOURCE};find linux -type d -print`; do
+ for DIR in $(cd ${MECH_SOURCE};find linux -type d -print); do
${MKINSTALLDIRS} ${MECH_DEST}/${DIR}
for FILE in ${MECH_SOURCE}/${DIR}/*.bci; do
[ -f ${FILE} ] && ${INSTALL_DATA} ${FILE} ${MECH_DEST}/${DIR}/.
#
# Adjust permissions
#
-find ${BUILD_DIR} -type f -print | xargs chmod og-w
-find ${BUILD_DIR} -type d -print | xargs chmod og-w
+find ${IMAGE_DIR} -type f -print | xargs chmod og-w
+find ${IMAGE_DIR} -type d -print | xargs chmod og-w
make_tarfile ()
{
tarfile=${1}.tar.gz
rm -f ${tarfile}
- (cd ${BUILD_DIR}/usr/local; tar cvzf ../../../${tarfile} *)
+ (cd ${IMAGE_DIR}/usr/local; tar cvzf ../../../${tarfile} *)
chmod 444 ${tarfile}
}
if [ "${DESTINATION}" = "" ]; then
- PRE="`get_release_prefix`-ix86"
+ PRE="$(get_release_prefix)-ix86"
make_tarfile "${PRE}-gnu-linux"
${INSTALL} /scheme/v7/dist/freebsd-bin/* ${BINDIR}/.
make_tarfile "${PRE}-freebsd"
make_tarfile ${DESTINATION}
fi
-rm -rf ${BUILD_DIR}
+rm -rf ${IMAGE_DIR}