Bootstrap: docker
From: corsika/devel:u-22.04

%post
    git clone --depth 1 --recursive https://gitlab.iap.kit.edu/AirShowerPhysics/corsika.git /corsika/repo
    mkdir /corsika/build
    /corsika/repo/conan-install.sh /corsika/build
    cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -S /corsika/repo -B /corsika/build
    cmake --build /corsika/build --target testModules -j 4
    cmake -Dcorsika_DIR=/corsika/build -DCMAKE_BUILD_TYPE=RelWithDebInfo -S /corsika/repo/examples -B /corsika/build-examples
    cd /corsika/build-examples
    make corsika    

%environment
    export PATH=/corsika/build-examples/bin:$PATH

%runscript
    echo "THIS IS CORSIKA!"

