PACKAGE_NAME="v4l2loopback"
PACKAGE_VERSION="0.12.7"

if [ -f $kernel_source_dir/.config ]; then
    . $kernel_source_dir/.config
    if ! { echo "$kernelver"; echo 5.18; } | sort -V -C; then
        # for linux>=5.18, CONFIG_VIDEO_V4L2 has been renamed to CONFIG_VIDEO_DEV
        if [ "${CONFIG_VIDEO_DEV:-n}" = "n" ]; then
            BUILD_EXCLUSIVE_KERNEL="REQUIRES CONFIG_VIDEO_DEV"
        fi
    else
        if [ "${CONFIG_VIDEO_V4L2:-n}" = "n" ]; then
            BUILD_EXCLUSIVE_KERNEL="REQUIRES CONFIG_VIDEO_V4L2"
        fi
    fi
fi

# Items below here should not have to change with each driver version
MAKE[0]="make KERNEL_DIR=${kernel_source_dir} all"
CLEAN="make clean"

BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/extra"

AUTOINSTALL="yes"
