Bootstrap: docker
From: eicweb.phy.anl.gov:4567/whit/image_recipes/root_base_broadwell:latest

%help
  Help me. I'm in the container.

%labels
  Maintainer "Whitney Armstrong"
  Version v1.0

%environment
  export PYTHONPATH=/usr/local/lib:$PYTHONPATH

%post -c /bin/bash
  echo "Hello from post"
  source /usr/local/bin/thisroot.sh
  export PYTHONPATH=/usr/local/lib:$PYTHONPATH
  git clone https://gitlab+deploy-token-1:FaNA-Yg4s7hpjvWPZnq8@eicweb.phy.anl.gov/upsilon/Pcsim.git 
  mkdir Pcsim/build && cd Pcsim/build 
  cmake ../. -DCOMPILE_FOR_BROADWELL:BOOL=ON
  make -j20
  make install


%runscript
  echo "Hello from runscirpt"
  echo "Rooooar!"
  echo "Arguments received: $*"
  exec echo "$@"

#  derp=
#  if [ -p /dev/stdin ]; then
#    # If we want to read the input line by line
#    while IFS= read line; do
#      #echo "Line: ${line}"
#      if [ -z ${derp} ]; then
#        derp="${line}"
#      else 
#        derp="${derp}\n${line}"
#      fi
#    done
#  fi
#  /bin/bash <<EOF
#  source /usr/local/bin/geant4.sh
#  echo -e ${derp} | bubble_chamber $@
#EOF
#  #exec /usr/local/bin/run_bubble_sim "$@"