3 # build dunetpc and related packages.
5 # designed to work on Jenkins
7 # Extract set qualifier from $LARSOFT_QUAL (we don't care about anything else in $LARSOFT_QUAL).
9 SQUAL=`echo $LARSOFT_QUAL | tr : '\n' | grep ^s`
11 echo "dunetpc version: $VERSION"
12 echo "base qualifiers: $QUAL"
13 echo "set qualifier: $SQUAL"
14 echo "build type: $BUILDTYPE"
15 echo "workspace: $WORKSPACE"
17 # Parse qualifier parameter into base qualifier and label (if any).
18 # Use hyphen as separator.
22 quals=`echo $QUAL | tr '-' ' '`
25 if [[ $q == e* || $q == c* ]]; then
31 echo "basequal: $basequal"
34 if [ x$basequal = x ]; then
35 echo "No base qualifier."
39 # Create area for biuld artifacts.
40 rm -rf $WORKSPACE/copyBack
41 mkdir -p $WORKSPACE/copyBack || exit 1
43 # Check for unsupported combinations of base qualifier, OS, and build label.
44 if [[ `uname -s` == Darwin ]] && [[ $basequal == e* ]]; then
45 echo "${basequal} build not supported on `uname -s`"
46 echo "${basequal} build not supported on `uname -s`" > $WORKSPACE/copyBack/skipping_build
49 if [[ `uname -s` == Darwin ]] && [[ x$label == xpy2 ]]; then
50 echo "Python 2 build not supported on `uname -s`"
51 echo "Python 2 build not supported on `uname -s`" > $WORKSPACE/copyBack/skipping_build
54 if [[ `uname -s` == Linux ]] && [[ `lsb_release -rs` == 6* ]] && [[ x$label == x ]] && [[ $basequal != e17 ]] && [[ $basequal != c2 ]]; then
55 echo "Python 3 build not supported on SL6"
56 echo "Python 3 build not supported on SL6" > $WORKSPACE/copyBack/skipping_build
60 # Create build directory and go there.
61 blddir=${WORKSPACE}/build
62 logdir=${WORKSPACE}/log
65 mkdir -p $blddir || exit 1
66 mkdir -p $logdir || exit 1
69 # Fetch buildFW script.
70 echo "Fetching buildFW."
71 curl --fail --silent --location --insecure -O http://scisoft.fnal.gov/scisoft/bundles/tools/buildFW || exit 1
78 if [ x$label = x ]; then
79 ./buildFW -t -b $basequal -s $SQUAL $blddir $BUILDTYPE dune-$VERSION || \
84 ./buildFW -t -b $basequal -s $SQUAL -l $label $blddir $BUILDTYPE dune-$VERSION || \
92 mv *.log $logdir || exit 1
96 mv dunetpc*.bz2 $WORKSPACE/copyBack/ || exit 1
97 mv dune_raw_data*.bz2 $WORKSPACE/copyBack/ || exit 1
98 mv *.txt $WORKSPACE/copyBack/ || exit 1
102 cd $WORKSPACE || exit 1
103 rm -rf $blddir || exit 1