#!/bin/bash

source debian/vars.sh

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