# build uboonecode

basequal=${1}

# specify version to bootstrap and setup ups
check_ups v6_0_8

build_bundle larsoft-@LARSOFT_DOT_VERSION@ ${basequal}
status=$?
if (( ${status} != 0)); then
  cat 1>&2 <<EOF
Build of larsoft-@LARSOFT_DOT_VERSION@ bundle failed with status ${status}
EOF
  return ${status}
fi

[[ "${build_label}" == py2 ]] && pyqual=:${build_label}

ensure_cetbuildtools v7_03_02

#pull_product uboone_photon_propagation @UBOONE_PHOTON_PROPAGATION_VERSION@ uboone_photon_propagation-@UBOONE_PHOTON_PROPAGATION_DOT_VERSION@-noarch.tar.bz2
build_noarch uboone_photon_propagation @UBOONE_PHOTON_PROPAGATION_VERSION@
do_build swtrigger @SWTRIGGER_VERSION@ ${basequal}${pyqual}
do_build larlite @LARLITE_VERSION@ ${basequal}${pyqual}
do_build larcv @LARCV_VERSION@ ${basequal}${pyqual}
do_pull geant4reweight @GEANT4REWEIGHT_VERSION@ ${basequal}-@SQUAL@
do_build glpk @GLPK_VERSION@
#do_build wcp @WCP_VERSION@ ${basequal}
build_noarch uboone_oslibs @UBOONE_OSLIBS_VERSION@
#pull_product uboonedaq_datatypes @UBOONEDAQ_DATATYPES_VERSION@ uboonedaq_datatypes-@UBOONEDAQ_DATATYPES_VERSION@-${thisplat}-${basequal}-${build_type}.tar.bz2
build_cet uboonedaq_datatypes @UBOONEDAQ_DATATYPES_VERSION@ ${basequal}:offline
build_cet_null uboonedata @UBOONEDATA_VERSION@
build_cet_null larbatch   @LARBATCH_VERSION@
build_cet ubutil @UBUTIL_VERSION@ ${basequal}${pyqual}
build_cet ubobj @UBOBJ_VERSION@ ${basequal}${pyqual}
build_cet ubcore @UBCORE_VERSION@ ${basequal}${pyqual}
build_cet ubraw @UBRAW_VERSION@ ${basequal}${pyqual}
build_cet -n ubevt @UBEVT_VERSION@ ${basequal}${pyqual}
build_cet ubcrt @UBCRT_VERSION@ ${basequal}${pyqual}
build_cet ubcv @UBCV_VERSION@ ${basequal}${pyqual}
build_cet ubsim @UBSIM_VERSION@ ${basequal}${pyqual}
build_cet ubreco @UBRECO_VERSION@ ${basequal}${pyqual}
build_cet ubana @UBANA_VERSION@ ${basequal}${pyqual}
build_cet ublite @UBLITE_VERSION@ ${basequal}${pyqual}
build_cet -n uboonecode @UBOONECODE_VERSION@ ${basequal}${pyqual}

return 0
