#!/bin/bash

source debian/vars.sh

mkdir -p $DEB_INSTALL_ROOT/opt/cpanel/ea-valkey72
echo -n "$version-$release_prefix" > $DEB_INSTALL_ROOT/opt/cpanel/ea-valkey72/pkg-version
cp $SOURCE2 $DEB_INSTALL_ROOT/opt/cpanel/ea-valkey72/
cp $SOURCE3 $DEB_INSTALL_ROOT/opt/cpanel/ea-valkey72/
cp $SOURCE4 $DEB_INSTALL_ROOT/opt/cpanel/ea-valkey72/
cp $SOURCE5 $DEB_INSTALL_ROOT/opt/cpanel/ea-valkey72/README.md
cat << EOF > $DEB_INSTALL_ROOT/opt/cpanel/ea-valkey72/ea-podman.json
{
    "ports" : [],
    "image" : "docker.io/valkey/valkey:$version",
    "startup" : {
        "-v"     : [
            ":/socket_dir",
            "valkey.conf:/usr/local/etc/valkey/valkey.conf",
            "podman_entrypoint.sh:/usr/local/bin/docker-entrypoint.sh"
       ]
    }
}
EOF
