3 # pull source code in $WORKSPACE/source
4 # build in $WORKSPACE/build
5 # copyback directory is $WORKSPACE/copyBack
7 # this script is just for building release candidates
12 Usage: $(basename ${0}) [-h]
13 $(basename ${0}) <version> <qual_set> <build_type>
21 qual_set Supported qualifier sets: s8:e7, s11:e7
26 while getopts :h OPT; do
37 shift `expr $OPTIND - 1`
40 working_dir=${WORKSPACE}
43 build_type=${BUILDTYPE}
103 if [[ `uname -s` == Darwin ]]
105 OSnum=`uname -r | cut -f1 -d"."`
106 xver=`xcodebuild -version | grep Xcode | cut -f2 -d" " | cut -f1 -d"."`
107 xcver=`xcodebuild -version | grep Xcode`
108 if [[ ${basequal} == e9 ]] && [[ ${xver} < 7 ]] && [[ ${OSnum} > 13 ]]
110 echo "${basequal} build not supported on `uname -s`${OSnum} with ${xcver}"
115 dotver=`echo ${version} | sed -e 's/_/./g' | sed -e 's/^v//'`
117 echo "building the larsoft base distribution for ${version} ${dotver} ${qual_set} ${build_type}"
120 if [ "${OS}" = "Linux" ]
123 if [ "${id}" = "Ubuntu" ]
125 flvr=u`lsb_release -r | sed -e 's/[[:space:]]//g' | cut -f2 -d":" | cut -f1 -d"."`
127 flvr=slf`lsb_release -r | sed -e 's/[[:space:]]//g' | cut -f2 -d":" | cut -f1 -d"."`
129 elif [ "${OS}" = "Darwin" ]
131 flvr=d`uname -r | cut -f1 -d"."`
133 echo "ERROR: unrecognized operating system ${OS}"
136 echo "build flavor is ${flvr}"
139 qualdir=`echo ${qual_set} | sed -e 's%:%-%'`
143 blddir=${working_dir}/build
144 srcdir=${working_dir}/source
145 # start with clean directories
148 rm -rf $WORKSPACE/copyBack
149 # now make the dfirectories
150 mkdir -p ${srcdir} || exit 1
151 mkdir -p ${blddir} || exit 1
152 mkdir -p $WORKSPACE/copyBack || exit 1
154 cd ${blddir} || exit 1
155 curl --fail --silent --location --insecure -O http://scisoft.fnal.gov/scisoft/bundles/tools/pullProducts || exit 1
156 chmod +x pullProducts
157 # source code tarballs MUST be pulled first
158 ./pullProducts ${blddir} source lar_product_stack-${version} || \
160 ERROR: pull of lar_product_stack-${version} source failed
164 ./pullProducts ${blddir} source larbase-${version} || \
166 ERROR: pull of larbase-${version} source failed
170 ./pullProducts ${blddir} source larsoftobj-${objver} || \
172 ERROR: pull of larsoftobj-${objver} source failed
176 ./pullProducts ${blddir} source larsoft-${version} || \
178 ERROR: pull of larsoft-${version} failed
182 mv ${blddir}/*source* ${srcdir}/
184 cd ${blddir} || exit 1
188 ${WORKSPACE}/artutilscripts/tools/newBuild -t -b ${basequal} ${blddir} ${build_type} lar_product_stack-${version} || \
189 { mv ${blddir}/*.log $WORKSPACE/copyBack/
192 ${WORKSPACE}/artutilscripts/tools/newBuild -t -b ${basequal} -s ${squal} ${blddir} ${build_type} larbase-${version} || \
193 { mv ${blddir}/*.log $WORKSPACE/copyBack/
196 ${WORKSPACE}/artutilscripts/tools/newBuild -t -b ${basequal} ${blddir} ${build_type} larsoftobj-${objver} || \
197 { mv ${blddir}/*.log $WORKSPACE/copyBack/
200 ${WORKSPACE}/artutilscripts/tools/newBuild -t -b ${basequal} -s ${squal} ${blddir} ${build_type} larsoft-${version} || \
201 { mv ${blddir}/*.log $WORKSPACE/copyBack/
208 mv ${blddir}/*.bz2 $WORKSPACE/copyBack/
209 mv ${blddir}/*.txt $WORKSPACE/copyBack/