5 BP_INIT_RESULTS([source])
6 BP_INIT_LOG([source/LOG])
8 BP_SET_VAR([BUILD_NUMBER], [@BUILD_NUMBER@])
9 BP_SET_VAR([PSPP_REPO], [@PSPP_REPO@])
10 BP_SET_VAR([PSPP_BRANCH], [@PSPP_BRANCH@])
11 BP_SET_VAR([PSPP_COMMIT], [@PSPP_COMMIT@])
12 BP_SET_VAR([GNULIB_COMMIT], [@GNULIB_COMMIT@])
13 BP_SET_VAR([GNULIB_REPO], [@GNULIB_REPO@])
15 ABBREV_COMMIT=`expr "$PSPP_COMMIT" : '\(......\)'`
17 BP_START_STEP([Extracting Git sources])
18 BP_RUN([(cd repo && zcat pspp-$PSPP_COMMIT.tar.gz | tar xf -) >&AS_MESSAGE_LOG_FD 2>&1])
20 BP_START_STEP([Extract repository version number])
21 BP_RUN([(cd repo/pspp-$PSPP_COMMIT && autoconf -t AC_INIT) >tmp$$ 2>&AS_MESSAGE_LOG_FD])
22 BP_RUN([IFS=: read FILE LINE macro PACKAGE REPO_VERSION BUG_REPORT TARNAME URL <tmp$$ >&AS_MESSAGE_LOG_FD 2>&1])
23 BP_RUN([rm tmp$$ >&AS_MESSAGE_LOG_FD 2>&1])
24 BP_SET_VAR([REPO_VERSION])
26 BP_START_STEP([Checking Automake mode])
27 if grep gnits repo/pspp-$PSPP_COMMIT/Makefile.am >/dev/null 2>&1; then
33 BP_START_STEP([Generate build version number])
34 case $AM_MODE-$REPO_VERSION in # (
36 # We want to append -g012345, but we're in Gnits mode and the
37 # version number already has a hyphen, so we have to omit the
39 VERSION="$REPO_VERSIONg$ABBREV_COMMIT"
42 VERSION="$REPO_VERSION-g$ABBREV_COMMIT"
47 BP_START_STEP([Update version number in configure.ac])
48 AS_ECHO(["AC_INIT([$PACKAGE], [$VERSION], [$BUG_REPORT], [$TARNAME], [$URL])]") > tmp$$
49 BP_RUN([sed -n "${LINE}r tmp$$
50 $LINE!p" < repo/pspp-$PSPP_COMMIT/$FILE > repo/pspp-$PSPP_COMMIT/$FILE.new 2>&AS_MESSAGE_LOG_FD])
51 BP_RUN([mv repo/pspp-$PSPP_COMMIT/$FILE.new repo/pspp-$PSPP_COMMIT/$FILE >&AS_MESSAGE_LOG_FD 2>&1])
52 BP_RUN([rm tmp$$ >&AS_MESSAGE_LOG_FD 2>&1])
54 BP_START_STEP([Updating NEWS])
56 sed -n '/^Changes/q;p' repo/pspp-$PSPP_COMMIT/NEWS
58 Changes from $REPO_VERSION to $VERSION:
60 * Built from PSPP commit $PSPP_COMMIT
61 in branch $PSPP_BRANCH from repository $PSPP_REPO.
63 * Built from Gnulib commit $GNULIB_COMMIT
64 from repository $GNULIB_REPO.
67 sed -n '/^Changes/,$p' repo/pspp-$PSPP_COMMIT/NEWS
69 mv NEWS.new repo/pspp-$PSPP_COMMIT/NEWS
71 BP_START_STEP([Extract Gnulib source])
72 BP_RUN([(cd repo && zcat gnulib-$GNULIB_COMMIT.tar.gz | tar xf -) >&AS_MESSAGE_LOG_FD 2>&1])
74 BP_START_STEP([Bootstrap (make -f Smake)])
75 BP_RUN([(cd repo/pspp-$PSPP_COMMIT && make -f Smake GNULIB=../gnulib-$GNULIB_COMMIT) >&AS_MESSAGE_LOG_FD 2>&1])
77 BP_START_STEP([Configure])
78 mkdir repo/pspp-$PSPP_COMMIT/_dist
79 BP_RUN([(cd repo/pspp-$PSPP_COMMIT/_dist && ../configure) >&AS_MESSAGE_LOG_FD 2>&1])
81 BP_START_STEP([Make source tarball])
82 BP_RUN([(cd repo/pspp-$PSPP_COMMIT/_dist && make dist) >&AS_MESSAGE_LOG_FD 2>&1])
83 BP_MOVE_OUTPUT([source distribution], [repo/pspp-$PSPP_COMMIT/_dist/pspp-$VERSION.tar.gz])
85 potfile=repo/pspp-$PSPP_COMMIT/_dist/po/pspp.pot
86 if test ! -e $potfile; then
87 potfile=repo/pspp-$PSPP_COMMIT/po/pspp.pot
89 BP_COPY_OUTPUT([translation templates], [$potfile])
91 BP_START_STEP([Build user manual])
92 BP_RUN([(cd repo/pspp-$PSPP_COMMIT && cp _dist/doc/*.texi doc/) >&AS_MESSAGE_LOG_FD 2>&1])
93 BP_RUN([(cd repo/pspp-$PSPP_COMMIT && GENDOCS_TEMPLATE_DIR=../../build-aux ../../build-aux/gendocs.sh -s doc/pspp.texinfo -o BP_RESULTS_DIR/user-manual --email bug-gnu-pspp@gnu.org pspp "GNU PSPP User Manual") >&AS_MESSAGE_LOG_FD 2>&1])
94 BP_OUTPUT([User Manual], [repo/user-manual])
96 BP_START_STEP([Build developers guide])
97 BP_RUN([(cd repo/pspp-$PSPP_COMMIT && GENDOCS_TEMPLATE_DIR=../../build-aux ../../build-aux/gendocs.sh -s doc/pspp-dev.texinfo -o BP_RESULTS_DIR/dev-guide --email bug-gnu-pspp@gnu.org pspp-dev "GNU PSPP Developers Guide") >&AS_MESSAGE_LOG_FD 2>&1])
98 BP_OUTPUT([Developers Guide], [repo/dev-guide])