and BINID briefly identifies the target, e.g. \"debian-squeeze-i386\".
Options:
+ --on HOST[:DIR] Perform remote build using ssh and scp
-h, --help Print this usage message and exit
-f, --force Delete existing directory instead of aborting
# Variables.
overwrite=false
+remote=
+CONFIGUREFLAGS=
+n_envvars=0
# Parse command line.
while test $# -gt 0 ; do
AS_ECHO(["$usage"]); exit ;;
--force | -f )
- overwrite=true ;;
+ overwrite=true
+ shift ;;
+
+ --on=* )
+ remote=$optarg
+ shift ;;
+ --on )
+ test $# = 1 && eval "$exit_missing_arg"
+ remote=$2
+ shift; shift ;;
+
+ --configureflags=* )
+ CONFIGUREFLAGS=$optarg
+ shift ;;
+ --configureflags )
+ test $# = 1 && eval "$exit_missing_arg"
+ CONFIGUREFLAGS=$2
+ shift; shift ;;
-- ) # Stop option processing
shift; break ;;
- - ) # Use stdin as input.
- break ;;
-* )
exec >&2
- AS_ERROR([invalid option `$[1]'$as_nl$help]) ;; #`
+ AS_ERROR([invalid option `$[1]'$as_nl$help]) ;; #`(
+ *=* )
+ AS_VAR_ARITH([n_envvars], [$n_envvars + 1])
+ AS_VAR_SET([env$n_envvars], ["$[1]"])
+ shift
+ ;;
* )
break ;;
esac
AS_ERROR([$tarball does not exist])
fi
+REMOTE_HOST=
+REMOTE_DIR=
+case $remote in # (
+ "")
+ ;; # (
+ *:*)
+ REMOTE_HOST=[`expr "$remote" : '\([^:]*\):'`]
+ REMOTE_DIR=[`expr "$remote" : '[^:]*:\(.*\)'`]
+ ;; # (
+ *)
+ REMOTE_HOST=$remote
+ ;;
+esac
+
+if test "X$REMOTE_HOST" != X; then
+ m4_pattern_allow([BP_SSH])
+ : ${BP_SSH=ssh}
+
+ escape () {
+ AS_ECHO("$1") | sed "s/'/'\\\\''/g"
+ }
+
+ options=
+ if test "x$CONFIGUREFLAGS" != x; then
+ options="--configureflags='"`escape "$CONFIGUREFLAGS"`\'
+ fi
+ $overwrite && options="$options --force"
+
+ i=0
+ while test $i -lt $n_envvars; do
+ AS_VAR_ARITH([i], [$i + 1])
+ AS_VAR_COPY([tmp], [env$i])
+ options="$options '"`escape "$tmp"`"\'
+ done
+ shift
+
+ rc=0
+ tar cf - make-bin-dist build-aux $tarball | gzip | $BP_SSH $REMOTE_HOST "cd $REMOTE_DIR && zcat | tar xf - && ./make-bin-dist $options $tarball $BINID" || rc=$?
+ $BP_SSH $REMOTE_HOST "cd $REMOTE_DIR && tar cf - $BINID" | tar xf - || rc=$?
+ exit $rc
+fi
+
if test -e "$BINID"; then
if test $overwrite = true; then
chmod -R u+w "$BINID"
BP_INIT_LOG([$BINID/LOG])
BP_SET_VAR([BUILD_NUMBER], [@BUILD_NUMBER@])
-BP_SET_VAR([PSPP_COMMIT], [@PSPP_COMMIT@])
BP_SET_VAR([PSPP_REPO], [@PSPP_REPO@])
-BP_SET_VAR([GNULIB_COMMIT], [@GNULIB_COMMIT@])
+BP_SET_VAR([PSPP_BRANCH], [@PSPP_BRANCH@])
+BP_SET_VAR([PSPP_COMMIT], [@PSPP_COMMIT@])
BP_SET_VAR([GNULIB_REPO], [@GNULIB_REPO@])
-BP_SET_VAR([BRANCH], [@BRANCH@])
+BP_SET_VAR([GNULIB_COMMIT], [@GNULIB_COMMIT@])
BP_SET_VAR([BINID])
+BP_SET_VAR([CONFIGUREFLAGS])
BP_START_STEP([Determining $tarball target directory])
DIST_DIR=`zcat $tarball | tar tf - 2>/dev/null | sed 1q | sed s,/.*,,`
fi
BP_START_STEP([Extracting source tarball])
-BP_RUN([zcat $tarball | tar xkf - >&AS_MESSAGE_LOG_FD 2>&1])
+BP_RUN([zcat $tarball | tar xf - >&AS_MESSAGE_LOG_FD 2>&1])
BP_START_STEP([Extracting tar version])
DIST_VERSION=`$DIST_DIR/configure --version 2>/dev/null | sed 1q | sed 's/.* //'`
BP_RUN([mkdir $DIST_DIR/_$BINID >&AS_MESSAGE_LOG_FD 2>&1])
BP_RUN([chmod -R a-w $DIST_DIR >&AS_MESSAGE_LOG_FD 2>&1])
BP_RUN([chmod u+w $DIST_DIR/_$BINID >&AS_MESSAGE_LOG_FD 2>&1])
-BP_TRY_RUN([(cd $DIST_DIR/_$BINID && ../configure --enable-relocatable --prefix='') >&AS_MESSAGE_LOG_FD 2>&1])
+
+set x
+i=0
+while test $i -lt $n_envvars; do
+ AS_VAR_ARITH([i], [$i + 1])
+ AS_VAR_COPY([tmp], [env$i])
+ set "$@" "$tmp"
+done
+shift
+
+BP_TRY_RUN([(cd $DIST_DIR/_$BINID && ../configure --enable-relocatable --prefix='' $CONFIGUREFLAGS "$@") >&AS_MESSAGE_LOG_FD 2>&1])
_bp_status=$?
for base in config.h config.log; do
fn=$DIST_DIR/_$BINID/$base
BP_SET_VAR([GNULIB_COMMIT], [@GNULIB_COMMIT@])
BP_SET_VAR([GNULIB_REPO], [@GNULIB_REPO@])
-ABBREV_COMMIT=`expr "$COMMIT" : '\(......\)'`
+ABBREV_COMMIT=`expr "$PSPP_COMMIT" : '\(......\)'`
BP_START_STEP([Extracting Git sources])
BP_RUN([(cd repo && zcat pspp-$PSPP_COMMIT.tar.gz | tar xf -) >&AS_MESSAGE_LOG_FD 2>&1])
BP_START_STEP([Update version number in configure.ac])
AS_ECHO(["AC_INIT([$PACKAGE], [$VERSION], [$BUG_REPORT], [$TARNAME], [$URL])]") > tmp$$
-sed -n "${LINE}r tmp$$
-$LINE!p" < repo/pspp-$PSPP_COMMIT/$FILE > repo/pspp-$PSPP_COMMIT/$FILE.new
-mv repo/pspp-$PSPP_COMMIT/$FILE.new repo/pspp-$PSPP_COMMIT/$FILE
+BP_RUN([sed -n "${LINE}r tmp$$
+$LINE!p" < repo/pspp-$PSPP_COMMIT/$FILE > repo/pspp-$PSPP_COMMIT/$FILE.new 2>&AS_MESSAGE_LOG_FD])
+BP_RUN([mv repo/pspp-$PSPP_COMMIT/$FILE.new repo/pspp-$PSPP_COMMIT/$FILE >&AS_MESSAGE_LOG_FD 2>&1])
+BP_RUN([rm tmp$$ >&AS_MESSAGE_LOG_FD 2>&1])
BP_START_STEP([Updating NEWS])
{
BP_START_STEP([Configure])
mkdir repo/pspp-$PSPP_COMMIT/_dist
-BP_RUN([(cd repo/pspp-$PSPP_COMMIT/_dist && ../configure @CONFIGUREFLAGS@) >&AS_MESSAGE_LOG_FD 2>&1])
+BP_RUN([(cd repo/pspp-$PSPP_COMMIT/_dist && ../configure) >&AS_MESSAGE_LOG_FD 2>&1])
BP_START_STEP([Make source tarball])
BP_RUN([(cd repo/pspp-$PSPP_COMMIT/_dist && make dist) >&AS_MESSAGE_LOG_FD 2>&1])