DEFVER=1
ARCHS_SUPPORTED="amd64 armhf"
CODENAMES_SUPPORTED="buster bullseye bookworm focal jammy noble"
get_website "https://openrgb.org/releases.html"
if [ "${ACTION}" != "prettylist" ]; then
    local codename, regex, deb
    case "${UPSTREAM_CODENAME}" in
        buster)
            codename=buster
        ;;
        bullseye|focal)
            codename=bullseye
        ;;
        *)
            codename=bookworm
        ;;
    esac
    # allow more complex version numbers, such as 0.9.1, 0.9b, or 0.9-1:
    regex="/releases/release_[^/]+/openrgb_[^_]+_${HOST_ARCH}_${codename}_[^.]+\.deb"
    # can return multiple lines (since the content has no newlines):
    deb=$( grep -m 1 -o -E "${regex}" "${CACHE_FILE}" )
    # strip everything after the first newline:
    deb="${deb/$'\n'*/}"
    URL="https://openrgb.org/${deb}"
    # grab the first version found in the path (in the directory name):
    VERSION_PUBLISHED=$( grep -m 1 -o -E '_[^/]+/' <<<"${deb}" )
    # strip the leading _:
    VERSION_PUBLISHED="${VERSION_PUBLISHED/_/}"
    # strip the trailing /:
    VERSION_PUBLISHED="${VERSION_PUBLISHED/\//}"
fi
PRETTY_NAME="OpenRGB"
WEBSITE="https://openrgb.org/"
SUMMARY="Open source RGB lighting control that doesn't depend on manufacturer software."
