Blame SOURCES/gstreamer.prov

6ce7fb
#!/bin/sh
6ce7fb
#
6ce7fb
# Script to install in:
6ce7fb
# /usr/lib/rpm/redhat/find-provides.d
6ce7fb
#
6ce7fb
# Transform GStreamer auto install info into RPM provides
6ce7fb
#
6ce7fb
# Author: Bastien Nocera <hadess@hadess.net>
6ce7fb
# Based on other provides scripts from RPM
6ce7fb
#
6ce7fb
6ce7fb
filelist=`grep -e '.so$' | sed "s/['\"]/\\\&/g"`
6ce7fb
6ce7fb
# --- Alpha does not mark 64bit dependencies•
6ce7fb
case `uname -m` in
6ce7fb
  alpha*)	mark64="" ;;
6ce7fb
  *)		mark64="()(64bit)" ;;
6ce7fb
esac
6ce7fb
6ce7fb
solist=$(echo $filelist | grep "libgst" | \
6ce7fb
	xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1 )
6ce7fb
6ce7fb
function getmark()
6ce7fb
{
6ce7fb
	lib64=`if file -L $1 2>/dev/null | \
6ce7fb
		grep "ELF 64-bit" >/dev/null; then echo -n "$mark64"; fi`
6ce7fb
}
6ce7fb
6ce7fb
function libdir()
6ce7fb
{
6ce7fb
	buildlibdir=`dirname $1`
6ce7fb
	buildlibdir=`dirname $buildlibdir`
6ce7fb
}
6ce7fb
6ce7fb
for so in $solist ; do
6ce7fb
	getmark $so
6ce7fb
	libdir $so
6ce7fb
	LD_LIBRARY_PATH=$buildlibdir gst-inspect --print-plugin-auto-install-info --rpm $so 2> /dev/null | while read line ; do
6ce7fb
		echo -n "$line";
6ce7fb
		echo -n "$lib64"
6ce7fb
		echo
6ce7fb
	done
6ce7fb
done
6ce7fb