BootStrap: docker
From: physino/geant4:gears

%help
Container of the latest Geant4 on the latest Fedora

%post
echo "#!/bin/sh" > /.singularity.d/env/99-g4.sh
grep DATA /usr/bin/geant4.sh >> /.singularity.d/env/99-g4.sh

# customize container PS1 (https://stackoverflow.com/a/61251143)
echo 'PS1="\u@geant4.11.0.3:\w \$ "' >> /.singularity.d/env/99-g4.sh

%environment
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
# https://github.com/apptainer/singularity/issues/643
# settings in ~/.bashrc will be loaded last
export SINGULARITY_SHELL=/usr/bin/bash

%runscript
gears "$@"
