6 Usage: $0 [OPTION]... PSPP_DIST.TAR.GZ BINID
7 where PSPP_DIST.TAR.GZ is a PSPP tarball prepared by \"make dist\"
8 and BINID briefly identifies the target, e.g. \"debian-squeeze-i386\".
11 --on HOST[:DIR] Perform remote build using ssh and scp
12 -h, --help Print this usage message and exit
13 -f, --force Delete existing directory instead of aborting
15 Report bugs to <bug-gnu-pspp@gnu.org>.
16 GNU PSPP: <http://www.gnu.org/software/pspp/>.
17 General help using GNU software: <http://www.gnu.org/gethelp/>."]
20 make-binary (@PACKAGE_NAME@) @VERSION@
21 Copyright (C) 2010 Free Software Foundation, Inc.
22 License GPLv3+/Autoconf: GNU GPL version 3 or later
23 <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
24 This is free software: you are free to change and redistribute it.
25 There is NO WARRANTY, to the extent permitted by law.
27 Written by Ben Pfaff."]
30 Try \`$as_me --help' for more information."
33 m4_bpatsubst([AS_ERROR([option `$[1]' requires an argument$as_nl$help])],
35 # restore font-lock: '
45 while test $# -gt 0 ; do
46 option=[`expr "x$1" : 'x\(--[^=]*\)' \| \
48 optarg=[`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
52 echo "$version" ; exit ;;
54 AS_ECHO(["$usage"]); exit ;;
64 test $# = 1 && eval "$exit_missing_arg"
69 CONFIGUREFLAGS=$optarg
72 test $# = 1 && eval "$exit_missing_arg"
80 -- ) # Stop option processing
84 AS_ERROR([invalid option `$[1]'$as_nl$help]) ;; #`(
86 AS_VAR_ARITH([n_envvars], [$n_envvars + 1])
87 AS_VAR_SET([env$n_envvars], ["$[1]"])
95 # Find the input file.
102 AS_ERROR([invalid number of arguments$as_nl$help]) ;;
105 if test ! -e "$tarball"; then
107 AS_ERROR([$tarball does not exist])
113 AS_ERROR([invalid binid $BINID])
123 REMOTE_HOST=[`expr "$remote" : '\([^:]*\):'`]
124 REMOTE_DIR=[`expr "$remote" : '[^:]*:\(.*\)'`]
131 if test "X$REMOTE_HOST" != X; then
132 m4_pattern_allow([BP_SSH])
136 AS_ECHO("$1") | sed "s/'/'\\\\''/g"
140 if test "x$CONFIGUREFLAGS" != x; then
141 options="--configureflags='"`escape "$CONFIGUREFLAGS"`\'
143 $check || options="$options --no-check"
144 $overwrite && options="$options --force"
147 while test $i -lt $n_envvars; do
148 AS_VAR_ARITH([i], [$i + 1])
149 AS_VAR_COPY([tmp], [env$i])
150 options="$options '"`escape "$tmp"`\'
155 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=$?
156 $BP_SSH $REMOTE_HOST "cd $REMOTE_DIR && tar cf - $BINID" | tar xf - || rc=$?
160 for dir in $BINID $BINID.buildtmp; do
161 if test -e $dir; then
167 AS_ERROR([$dir exists and --force not specified])
170 mkdir $dir || { exec >&2; AS_ERROR([failed to create $dir]); }
173 BP_INIT_RESULTS([$BINID])
174 BP_INIT_LOG([$BINID/LOG])
176 BP_SET_VAR([BUILD_NUMBER], [@BUILD_NUMBER@])
177 BP_SET_VAR([PSPP_REPO], [@PSPP_REPO@])
178 BP_SET_VAR([PSPP_BRANCH], [@PSPP_BRANCH@])
179 BP_SET_VAR([PSPP_COMMIT], [@PSPP_COMMIT@])
180 BP_SET_VAR([GNULIB_REPO], [@GNULIB_REPO@])
181 BP_SET_VAR([GNULIB_COMMIT], [@GNULIB_COMMIT@])
184 BP_SET_VAR([CONFIGUREFLAGS])
186 BP_START_STEP([Determining $tarball target directory])
187 DIST_DIR=`zcat $tarball | tar tf - 2>/dev/null | sed 1q | sed s,/.*,,`
188 BP_SET_VAR([DIST_DIR])
189 if test X$DIST_DIR = X; then
190 BP_ERROR([failed to determine $tarball target directory])
193 BP_START_STEP([Extracting source tarball])
194 BP_RUN([(cd $BINID.buildtmp && zcat ../$tarball | tar xf -) >&AS_MESSAGE_LOG_FD 2>&1])
196 BP_START_STEP([Extracting tar version])
197 DIST_VERSION=`$BINID.buildtmp/$DIST_DIR/configure --version 2>/dev/null | sed 1q | sed 's/.* //'`
198 BP_SET_VAR([DIST_VERSION])
200 BP_START_STEP([Checking for GNU make])
201 case `(make --version | sed 1q) 2>/dev/null` in # (
202 "GNU Make"*) GNU_MAKE=true ;;
205 BP_SET_VAR([GNU_MAKE])
207 BP_START_STEP([Configuring])
208 srcdir=$BINID.buildtmp/$DIST_DIR
210 builddir=$srcdir/_$BINID
212 BP_RUN([mkdir $builddir >&AS_MESSAGE_LOG_FD 2>&1])
213 BP_RUN([chmod -R a-w $srcdir >&AS_MESSAGE_LOG_FD 2>&1])
214 BP_RUN([chmod u+w $builddir >&AS_MESSAGE_LOG_FD 2>&1])
218 BP_RUN([find $builddir -type f -print | xargs chmod u-w >&AS_MESSAGE_LOG_FD 2>&1])
219 BP_RUN([chmod u+w $builddir >&AS_MESSAGE_LOG_FD 2>&1])
224 while test $i -lt $n_envvars; do
225 AS_VAR_ARITH([i], [$i + 1])
226 AS_VAR_COPY([tmp], [env$i])
231 BP_TRY_RUN([(cd $builddir && $rel_srcdir/configure --enable-relocatable --prefix='' $CONFIGUREFLAGS "$@") >&AS_MESSAGE_LOG_FD 2>&1])
233 for base in config.h config.log; do
235 if test -e "$fn"; then
236 BP_COPY_OUTPUT([build configuration], [$fn])
239 if test $_bp_status != 0; then
240 AS_ECHO(["$as_me:$LINENO: command exited with status $_bp_status"]) >&AS_MESSAGE_LOG_FD
244 BP_START_STEP([Build])
245 BP_RUN([(cd $builddir && make) >&AS_MESSAGE_LOG_FD 2>&1])
247 BP_START_STEP([Install])
248 BP_RUN([(cd $builddir && make install DESTDIR=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
250 BP_START_STEP([Make binary distribution])
251 BP_RUN([(cd $builddir && tar cfz pspp-$DIST_VERSION-$BINID.tar.gz pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
252 BP_MOVE_OUTPUT([binary distribution], [$builddir/pspp-$DIST_VERSION-$BINID.tar.gz])
255 BP_START_STEP([Check])
256 BP_TRY_RUN([(cd $builddir && make check) >&AS_MESSAGE_LOG_FD 2>&1])
258 for base in tests/testsuite.log tests/testsuite.dir; do
260 if test -e "$fn"; then
261 BP_MOVE_OUTPUT([test logs], [$fn])
264 if test $_bp_status != 0; then
265 AS_ECHO(["$as_me:$LINENO: command exited with status $_bp_status"]) >&AS_MESSAGE_LOG_FD
270 BP_START_STEP([Uninstall])
271 BP_RUN([(cd $builddir && make uninstall DESTDIR=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
273 BP_START_STEP([Check uninstall])
274 BP_RUN([(cd $builddir && make distuninstallcheck distuninstallcheck_dir=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])