dad90d
#!/bin/bash -
dad90d
dad90d
# Generate RPM provides automatically for nbdkit packages and filters.
dad90d
# Copyright (C) 2009-2022 Red Hat Inc.
dad90d
dad90d
# To test:
dad90d
# find /usr/lib64/nbdkit/plugins | ./nbdkit-find-provides VER REL
dad90d
# find /usr/lib64/nbdkit/filters | ./nbdkit-find-provides VER REL
dad90d
dad90d
ver="$1"
dad90d
rel="$2"
dad90d
dad90d
function process_file
dad90d
{
dad90d
    if [[ $1 =~ /plugins/nbdkit-.*-plugin ]] ||
dad90d
       [[ $1 =~ /filters/nbdkit-.*-filter ]]; then
dad90d
        echo "Provides:" "$(basename $1 .so)" "=" "$ver-$rel"
dad90d
    fi
dad90d
}
dad90d
dad90d
while read line; do
dad90d
    process_file "$line"
dad90d
done