2014-11-17 15:30:23 +01:00
|
|
|
#!/bin/bash
|
2011-08-17 23:41:16 +02:00
|
|
|
#
|
|
|
|
# Script to install in:
|
|
|
|
# /usr/lib/rpm/redhat/find-provides.d
|
|
|
|
#
|
|
|
|
# Transform GStreamer auto install info into RPM provides
|
|
|
|
#
|
|
|
|
# Author: Bastien Nocera <hadess@hadess.net>
|
|
|
|
# Based on other provides scripts from RPM
|
|
|
|
#
|
|
|
|
|
|
|
|
# We need a way to disable automatic gst provides.
|
|
|
|
# Simply "%define SKIP_GSTPROVIDES 1" anywhere in the spec file
|
|
|
|
grep -q -E '^[^#]?%define\s+SKIP_GSTPROVIDES\s.*[^0\s].*' "$RPMBUILD_SPECFILE" && exit 0
|
|
|
|
|
|
|
|
filelist=`grep -e '.so$' | sed "s/['\"]/\\\&/g"`
|
|
|
|
|
|
|
|
# --- Alpha does not mark 64bit dependencies•
|
|
|
|
case `uname -m` in
|
|
|
|
alpha*) mark64="" ;;
|
|
|
|
*) mark64="()(64bit)" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
solist=$(echo $filelist | grep "libgst" | \
|
|
|
|
xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1 )
|
|
|
|
|
2014-11-17 15:30:23 +01:00
|
|
|
function getmark()
|
2011-08-17 23:41:16 +02:00
|
|
|
{
|
|
|
|
lib64=`if file -L $1 2>/dev/null | \
|
|
|
|
grep "ELF 64-bit" >/dev/null; then echo -n "$mark64"; fi`
|
|
|
|
}
|
|
|
|
|
2014-11-17 15:30:23 +01:00
|
|
|
function libdir()
|
2011-08-17 23:41:16 +02:00
|
|
|
{
|
|
|
|
buildlibdir=`dirname $1`
|
|
|
|
buildlibdir=`dirname $buildlibdir`
|
|
|
|
}
|
|
|
|
|
|
|
|
for so in $solist ; do
|
|
|
|
getmark $so
|
|
|
|
libdir $so
|
2012-07-30 09:39:58 +02:00
|
|
|
LD_LIBRARY_PATH=$buildlibdir gst-inspect-1.0 --print-plugin-auto-install-info --rpm $so 2> /dev/null | while read line ; do
|
2011-08-17 23:41:16 +02:00
|
|
|
echo -n "$line";
|
|
|
|
echo -n "$lib64"
|
|
|
|
echo
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|