2017-11-24 18:02:58 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
set -e
|
2018-06-28 21:10:14 +00:00
|
|
|
if [ -n "$BUILD_DEBUG" ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
2018-07-07 15:31:06 +00:00
|
|
|
# use bash or lose if pipes fail
|
|
|
|
[ -n "$BASH" ] && set -o pipefail
|
|
|
|
|
2018-05-23 04:54:33 +00:00
|
|
|
SHELL=${SHELL-$(command -v sh)}
|
2018-07-09 08:46:28 +00:00
|
|
|
prefix=${prefix-/usr/local}
|
2017-11-24 18:02:58 +00:00
|
|
|
|
2018-07-09 08:46:28 +00:00
|
|
|
MES_PREFIX=${MES_PREFIX-$prefix/share/mes}
|
|
|
|
MES_SEED=${MES_SEED-../MES-SEED}
|
|
|
|
TINYCC_SEED=${TINYCC_SEED-../TINYCC-SEED}
|
2017-11-24 18:02:58 +00:00
|
|
|
|
2018-07-21 05:15:52 +00:00
|
|
|
GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-2.2}
|
|
|
|
datadir=${moduledir-$prefix/share/mes}
|
|
|
|
docdir=${moduledir-$prefix/share/doc/mes}
|
|
|
|
mandir=${mandir-$prefix/share/man}
|
|
|
|
moduledir=${moduledir-$datadir/module}
|
|
|
|
guile_site_dir=${guile_site_dir-$prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION}
|
|
|
|
guile_site_ccache_dir=${guile_site_ccache_dir-$prefix/lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache}
|
|
|
|
docdir=${moduledir-$prefix/share/doc/mes}
|
|
|
|
|
2018-07-09 08:46:28 +00:00
|
|
|
mkdir -p $DESTDIR$prefix/bin
|
|
|
|
cp src/mes $DESTDIR$prefix/bin/mes
|
|
|
|
|
|
|
|
mkdir -p $DESTDIR$prefix/lib
|
2018-06-29 18:38:11 +00:00
|
|
|
mkdir -p $DESTDIR$MES_PREFIX/lib
|
2018-07-09 08:46:28 +00:00
|
|
|
cp scripts/mescc $DESTDIR$prefix/bin/mescc
|
2017-11-24 18:02:58 +00:00
|
|
|
|
2018-06-29 18:38:11 +00:00
|
|
|
mkdir -p $DESTDIR$MES_PREFIX
|
2018-07-21 05:15:52 +00:00
|
|
|
tar -cf- doc include lib scaffold | tar -xf- -C $DESTDIR$MES_PREFIX
|
|
|
|
tar -cf- --exclude='*.go' module | tar -xf- -C $DESTDIR$MES_PREFIX
|
|
|
|
tar -cf- -C mes module | tar -xf- -C $DESTDIR$MES_PREFIX
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-07-21 05:15:52 +00:00
|
|
|
mkdir -p $DESTDIR$guile_site_dir
|
|
|
|
mkdir -p $DESTDIR$guile_site_ccache_dir
|
|
|
|
tar -cf- -C module --exclude='*.go' . | tar -xf- -C $DESTDIR$guile_site_dir
|
|
|
|
tar -cf- -C module --exclude='*.scm' . | tar -xf- -C $DESTDIR$guile_site_ccache_dir
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-07-09 08:46:28 +00:00
|
|
|
chmod +w $DESTDIR$prefix/bin/mescc
|
2018-04-29 16:38:57 +00:00
|
|
|
sed \
|
2018-05-23 18:28:43 +00:00
|
|
|
-e "s,^#! /bin/sh,#! $SHELL," \
|
2018-07-09 08:46:28 +00:00
|
|
|
-e "s,@datadir@,$datadir,g" \
|
|
|
|
-e "s,@docdir@,$docdir,g" \
|
|
|
|
-e "s,@guile_site_ccache_dir@,$guile_site_ccache_dir,g" \
|
|
|
|
-e "s,@guile_site_dir@,$guile_site_dir,g" \
|
|
|
|
-e "s,@moduledir@,$moduledir,g" \
|
|
|
|
-e "s,@prefix@,$prefix,g" \
|
2018-04-29 16:38:57 +00:00
|
|
|
-e "s,@VERSION@,$VERSION,g" \
|
2018-07-09 08:46:28 +00:00
|
|
|
scripts/mescc > $DESTDIR$prefix/bin/mescc
|
|
|
|
chmod +w $DESTDIR$moduledir/mes/boot-0.scm
|
2018-04-29 16:38:57 +00:00
|
|
|
sed \
|
2018-05-23 18:28:43 +00:00
|
|
|
-e "s,^#! /bin/sh,#! $SHELL," \
|
2018-07-21 05:15:52 +00:00
|
|
|
-e "s,mes/module/,$moduledir/," \
|
2018-07-09 08:46:28 +00:00
|
|
|
-e "s,@datadir@,$datadir,g" \
|
|
|
|
-e "s,@docdir@,$docdir,g" \
|
|
|
|
-e "s,@guile_site_ccache_dir@,$guile_site_ccache_dir,g" \
|
|
|
|
-e "s,@guile_site_dir@,$guile_site_dir,g" \
|
|
|
|
-e "s,@moduledir@,$moduledir,g" \
|
|
|
|
-e "s,@prefix@,$prefix,g" \
|
2018-04-29 16:38:57 +00:00
|
|
|
-e "s,@VERSION@,$VERSION,g" \
|
2018-07-21 05:15:52 +00:00
|
|
|
mes/module/mes/boot-0.scm > $DESTDIR$moduledir/mes/boot-0.scm
|
2018-05-23 04:54:33 +00:00
|
|
|
|
|
|
|
sed \
|
2018-05-23 18:28:43 +00:00
|
|
|
-e "s,^#! /bin/sh,#! $SHELL," \
|
2018-07-09 08:46:28 +00:00
|
|
|
scripts/diff.scm > $DESTDIR$prefix/bin/diff.scm
|
|
|
|
chmod -w+x $DESTDIR$prefix/bin/diff.scm
|
2018-06-27 11:42:47 +00:00
|
|
|
|
|
|
|
if [ -f doc/mes.info ]; then
|
2018-07-09 08:46:28 +00:00
|
|
|
mkdir -p $DESTDIR$prefix/share/info
|
2018-06-29 05:49:59 +00:00
|
|
|
tar -cf- doc/mes.info* doc/images | tar -xf- --strip-components=1 -C $DESTDIR$prefix/share/info
|
2018-07-09 08:46:28 +00:00
|
|
|
install-info --info-dir=$DESTDIR$prefix/share/info doc/mes.info
|
2018-06-27 11:42:47 +00:00
|
|
|
fi
|
2018-06-28 21:10:14 +00:00
|
|
|
|
|
|
|
if [ -f doc/mes.1 ]; then
|
2018-07-09 08:46:28 +00:00
|
|
|
mkdir -p $DESTDIR$mandir/man1
|
|
|
|
cp doc/mes.1 $DESTDIR$mandir/man1/
|
2018-06-28 21:10:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f doc/mescc.1 ]; then
|
2018-07-09 08:46:28 +00:00
|
|
|
mkdir -p $DESTDIR$mandir/man1
|
|
|
|
cp doc/mescc.1 $DESTDIR$mandir/man1/
|
2018-06-28 21:10:14 +00:00
|
|
|
fi
|