#! /bin/sh

# This script is used to inject the Varnish ABI into the provides.

set -x

if [ -x /usr/lib/rpm/redhat/find-provides ]; then
    /usr/lib/rpm/redhat/find-provides "$@"
elif [ -x /usr/lib/rpm/find-provides ]; then
    /usr/lib/rpm/find-provides "$@"
fi

cd $(dirname $0)/..

printf '#include "vmod_abi.h"\nVMOD_ABI_Version' | cpp - -Iinclude | sed '/^#/D;s/"//g;s/\([A-Z]\)/\L\1/g;s/[^a-z0-9.]/-/g;s/varnish/varnishabi/'
