2011-05-16 18:07:44 +02:00
|
|
|
--- ./autodeps/linux.prov.orig 2010-12-03 12:11:57.000000000 +0000
|
|
|
|
+++ ./autodeps/linux.prov 2011-05-11 14:27:40.000000000 +0000
|
2007-05-17 00:32:19 +02:00
|
|
|
@@ -2,60 +2,72 @@
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
# This script reads filenames from STDIN and outputs any relevant provides
|
|
|
|
# information that needs to be included in the package.
|
|
|
|
+IFS=$'\n'
|
|
|
|
+filelist=($(cat))
|
|
|
|
|
|
|
|
-filelist=`sed "s/['\"]/\\\&/g"`
|
|
|
|
-
|
|
|
|
-solist=$(echo $filelist | grep "\\.so" | grep -v "^/lib/ld.so" | \
|
|
|
|
- xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1)
|
|
|
|
+solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \
|
|
|
|
+ tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \
|
|
|
|
+ cut -d: -f1))
|
|
|
|
pythonlist=
|
|
|
|
tcllist=
|
2008-01-18 00:45:52 +01:00
|
|
|
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# --- Alpha does not mark 64bit dependencies
|
|
|
|
case `uname -m` in
|
|
|
|
- alpha*) mark64="" ;;
|
|
|
|
- *) mark64="()(64bit)" ;;
|
|
|
|
+ alpha*) mark64=false ;;
|
|
|
|
+ *) mark64=true ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
#
|
|
|
|
# --- Library sonames and weak symbol versions (from glibc).
|
|
|
|
-for f in $solist; do
|
|
|
|
- soname=$(objdump -p $f | awk '/SONAME/ {print $2}')
|
|
|
|
+for f in "${solist[@]}"; do
|
|
|
|
+ soname=$(objdump -p "$f" | awk '/SONAME/ {print $2}')
|
|
|
|
+ [ -n "$soname" -a -L "$f" ] && continue
|
|
|
|
+ [ -z "$soname" ] && soname="${f##*/}"
|
|
|
|
|
|
|
|
- lib64=`if file -L $f 2>/dev/null | \
|
|
|
|
- grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
|
|
|
|
- if [ "$soname" != "" ]; then
|
|
|
|
- if [ ! -L $f ]; then
|
|
|
|
- echo $soname$lib64
|
|
|
|
- objdump -p $f | awk '
|
|
|
|
- BEGIN { START=0 ; }
|
|
|
|
- /Version definitions:/ { START=1; }
|
|
|
|
- /^[0-9]/ && (START==1) { print $4; }
|
|
|
|
- /^$/ { START=0; }
|
|
|
|
- ' | \
|
|
|
|
- grep -v $soname | \
|
|
|
|
- while read symbol ; do
|
|
|
|
- echo "$soname($symbol)`echo $lib64 | sed 's/()//'`"
|
|
|
|
- done
|
|
|
|
- fi
|
|
|
|
+ if $mark64 && file -L "$f" 2>/dev/null | grep "ELF 64-bit" >/dev/null; then
|
|
|
|
+ lib64="()(64bit)" slib64="(64bit)"
|
|
|
|
else
|
|
|
|
- echo ${f##*/}$lib64
|
|
|
|
+ lib64= slib64=
|
|
|
|
fi
|
|
|
|
+ echo "$soname$lib64"
|
|
|
|
+ objdump -p "$f" | awk '
|
|
|
|
+ BEGIN { START=0 ; }
|
|
|
|
+ /Version definitions:/ { START=1; }
|
|
|
|
+ /^[0-9]/ && (START==1) { print $4; }
|
|
|
|
+ /^$/ { START=0; }
|
|
|
|
+ ' | \
|
|
|
|
+ while read symbol ; do
|
|
|
|
+ echo "$soname($symbol)$slib64"
|
|
|
|
+ done
|
|
|
|
done | sort -u
|
|
|
|
|
|
|
|
#
|
|
|
|
# --- Perl modules.
|
|
|
|
[ -x /usr/lib/rpm/perl.prov ] &&
|
|
|
|
- echo $filelist | tr '[:blank:]' \\n | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u
|
|
|
|
+ printf "%s\n" "${filelist[@]}" | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u
|
|
|
|
|
|
|
|
#
|
|
|
|
# --- Python modules.
|
|
|
|
[ -x /usr/lib/rpm/python.prov -a -n "$pythonlist" ] &&
|
|
|
|
- echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.prov | sort -u
|
|
|
|
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.prov | sort -u
|
|
|
|
|
|
|
|
#
|
|
|
|
# --- Tcl modules.
|
|
|
|
[ -x /usr/lib/rpm/tcl.prov -a -n "$tcllist" ] &&
|
|
|
|
- echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.prov | sort -u
|
|
|
|
+ printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.prov | sort -u
|
|
|
|
+
|
|
|
|
+#
|
|
|
|
+# --- Mono exes/dlls
|
|
|
|
+: ${MONO_PREFIX=/usr}
|
2007-05-17 00:32:19 +02:00
|
|
|
+if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
|
2007-05-06 17:11:25 +02:00
|
|
|
+ printf "%s\n" "${monolist[@]}" | MONO_PATH=$MONO_PREFIX/lib${MONO_PATH:+:$MONO_PATH} prefix=$MONO_PREFIX $MONO_PREFIX/bin/mono-find-provides || echo "WARNING: MONO RPM PROVIDES WERE NOT GENERATED FOR THIS BUILD!!" 1>&2
|
2007-05-17 00:32:19 +02:00
|
|
|
+fi
|
2006-12-19 00:17:44 +01:00
|
|
|
+
|
|
|
|
+#
|
|
|
|
+# --- Kernel module exported symbols
|
|
|
|
+[ -x /usr/lib/rpm/find-provides.ksyms ] &&
|
|
|
|
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
|
|
|
|
|
|
|
|
exit 0
|
2011-05-16 18:07:44 +02:00
|
|
|
--- ./autodeps/linux.req.orig 2010-12-03 12:11:57.000000000 +0000
|
|
|
|
+++ ./autodeps/linux.req 2011-05-11 14:28:45.000000000 +0000
|
|
|
|
@@ -19,18 +19,21 @@ fi
|
2006-12-19 00:17:44 +01:00
|
|
|
#
|
|
|
|
# --- Grab the file manifest and classify files.
|
|
|
|
#filelist=`sed "s/['\"]/\\\&/g"`
|
|
|
|
-filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
|
2011-05-16 18:07:44 +02:00
|
|
|
-exelist=`echo $filelist | xargs -r file | grep -Ev ":.* (commands|script) " | \
|
2006-12-19 00:17:44 +01:00
|
|
|
- grep ":.*executable" | cut -d: -f1`
|
|
|
|
-scriptlist=`echo $filelist | xargs -r file | \
|
2011-05-16 18:07:44 +02:00
|
|
|
- grep -E ":.* (commands|script) " | cut -d: -f1`
|
2006-12-19 00:17:44 +01:00
|
|
|
-liblist=`echo $filelist | xargs -r file | \
|
|
|
|
- grep ":.*shared object" | cut -d : -f1`
|
|
|
|
+#filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
|
|
|
|
+filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
|
|
|
|
+exelist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
|
|
|
|
+ egrep -v ":.* (commands|script) " | \
|
|
|
|
+ grep ":.*executable" | cut -d: -f1))
|
|
|
|
+scriptlist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
|
|
|
|
+ egrep ":.* (commands|script) " | cut -d: -f1))
|
|
|
|
+liblist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
|
|
|
|
+ grep ":.*shared object" | cut -d : -f1))
|
2011-05-16 18:07:44 +02:00
|
|
|
|
|
|
|
-interplist=
|
|
|
|
-perllist=
|
|
|
|
-pythonlist=
|
|
|
|
-tcllist=
|
2006-12-19 00:17:44 +01:00
|
|
|
+interplist=()
|
|
|
|
+perllist=()
|
|
|
|
+pythonlist=()
|
|
|
|
+tcllist=()
|
2008-01-18 00:45:52 +01:00
|
|
|
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# --- Alpha does not mark 64bit dependencies
|
2011-05-16 18:07:44 +02:00
|
|
|
@@ -42,12 +45,12 @@ esac
|
2006-12-19 00:17:44 +01:00
|
|
|
if [ "$needed" -eq 0 ]; then
|
|
|
|
#
|
|
|
|
# --- Executable dependency sonames.
|
|
|
|
- for f in $exelist; do
|
|
|
|
- [ -r $f -a -x $f ] || continue
|
|
|
|
- lib64=`if file -L $f 2>/dev/null | \
|
|
|
|
+ for f in "${exelist[@]}"; do
|
|
|
|
+ [ -r "$f" -a -x "$f" ] || continue
|
|
|
|
+ lib64=`if file -L "$f" 2>/dev/null | \
|
|
|
|
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
|
|
|
|
- ldd $f | awk '/=>/ {
|
|
|
|
- if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) {
|
|
|
|
+ ldd "$f" | awk '/=>/ {
|
|
|
|
+ if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /linux-gate.so/) {
|
|
|
|
gsub(/'\''"/,"\\&",$1);
|
|
|
|
printf "%s'$lib64'\n", $1
|
|
|
|
}
|
2011-05-16 18:07:44 +02:00
|
|
|
@@ -56,12 +59,12 @@ if [ "$needed" -eq 0 ]; then
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# --- Library dependency sonames.
|
|
|
|
- for f in $liblist; do
|
|
|
|
- [ -r $f ] || continue
|
|
|
|
- lib64=`if file -L $f 2>/dev/null | \
|
|
|
|
+ for f in "${liblist[@]}"; do
|
|
|
|
+ [ -r "$f" ] || continue
|
|
|
|
+ lib64=`if file -L "$f" 2>/dev/null | \
|
|
|
|
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
|
|
|
|
- ldd $f | awk '/=>/ {
|
|
|
|
- if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) {
|
|
|
|
+ ldd "$f" | awk '/=>/ {
|
|
|
|
+ if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /linux-gate.so/) {
|
|
|
|
gsub(/'\''"/,"\\&",$1);
|
|
|
|
printf "%s'$lib64'\n", $1
|
|
|
|
}
|
2011-05-16 18:07:44 +02:00
|
|
|
@@ -71,30 +74,30 @@ fi
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# --- Script interpreters.
|
|
|
|
-for f in $scriptlist; do
|
|
|
|
- [ -r $f -a -x $f ] || continue
|
|
|
|
- interp=`head -n 1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1`
|
|
|
|
- interplist="$interplist $interp"
|
|
|
|
+for f in "${scriptlist[@]}"; do
|
|
|
|
+ [ -r "$f" -a -x "$f" ] || continue
|
|
|
|
+ interp=`head -n 1 "$f" | sed -ne 's/^\#\![ ]*//p' | cut -d" " -f1`
|
|
|
|
+ interplist=("${interplist[@]}" "$interp")
|
|
|
|
case $interp in
|
|
|
|
- */perl) perllist="$perllist $f" ;;
|
|
|
|
+ */perl) perllist=("${perllist[@]}" "$f") ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
-[ -n "$interplist" ] && { echo "$interplist" | tr '[:blank:]' \\n | sort -u ; }
|
|
|
|
+[ -n "$interplist" ] && { printf "%s\n" "${interplist[@]}" | sort -u ; }
|
|
|
|
|
|
|
|
#
|
|
|
|
# --- Add perl module files to perllist.
|
|
|
|
-for f in $filelist; do
|
|
|
|
- [ -r $f -a "${f%.pm}" != "${f}" ] && perllist="$perllist $f"
|
|
|
|
+for f in "${filelist[@]}"; do
|
|
|
|
+ [ -r "$f" -a "${f%.pm}" != "${f}" ] && perllist=("${perllist[@]}" "$f")
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# --- Weak symbol versions (from glibc).
|
|
|
|
[ -n "$mark64" ] && mark64="(64bit)"
|
|
|
|
-for f in $liblist $exelist ; do
|
|
|
|
- [ -r $f ] || continue
|
|
|
|
- lib64=`if file -L $f 2>/dev/null | \
|
|
|
|
+for f in "${liblist[@]}" "${exelist[@]}" ; do
|
|
|
|
+ [ -r "$f" ] || continue
|
|
|
|
+ lib64=`if file -L "$f" 2>/dev/null | \
|
|
|
|
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
|
|
|
|
- objdump -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
|
|
|
|
+ objdump -p "$f" | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
|
|
|
|
/^$/ { START=0; }
|
|
|
|
/^Dynamic Section:$/ { START=1; }
|
|
|
|
(START==1) && /NEEDED/ {
|
2011-05-16 18:07:44 +02:00
|
|
|
@@ -111,7 +114,7 @@ for f in $liblist $exelist ; do
|
2006-12-19 00:17:44 +01:00
|
|
|
sub(/:/, "", $3);
|
|
|
|
LIBNAME=$3;
|
|
|
|
}
|
|
|
|
- (START==2) && (LIBNAME!="") && ($4!="") && (($4~/^GLIBC_*/) || ($4~/^GCC_*/)) {
|
|
|
|
+ (START==2) && (LIBNAME!="") && ($4!="") {
|
|
|
|
print LIBNAME "(" $4 ")'$lib64'";
|
|
|
|
}
|
|
|
|
'
|
2011-05-16 18:07:44 +02:00
|
|
|
@@ -119,17 +122,29 @@ done | sort -u
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# --- Perl modules.
|
|
|
|
-[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
|
|
|
|
- echo $perllist | tr '[:blank:]' \\n | /usr/lib/rpm/perl.req | sort -u
|
|
|
|
+#[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
|
|
|
|
+# printf "%s\n" "${perllist[@]}" | /usr/lib/rpm/perl.req | sort -u
|
|
|
|
|
|
|
|
#
|
|
|
|
# --- Python modules.
|
|
|
|
[ -x /usr/lib/rpm/python.req -a -n "$pythonlist" ] && \
|
|
|
|
- echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.req | sort -u
|
|
|
|
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.req | sort -u
|
|
|
|
|
|
|
|
#
|
|
|
|
# --- Tcl modules.
|
|
|
|
[ -x /usr/lib/rpm/tcl.req -a -n "$tcllist" ] && \
|
|
|
|
- echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.req | sort -u
|
|
|
|
+ printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.req | sort -u
|
|
|
|
+
|
|
|
|
+#
|
|
|
|
+# --- Mono exes/dlls
|
|
|
|
+: ${MONO_PREFIX=/usr}
|
2007-05-17 00:32:19 +02:00
|
|
|
+if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
|
2007-05-06 17:11:25 +02:00
|
|
|
+ printf "%s\n" "${monolist[@]}" | MONO_PATH=$MONO_PREFIX/lib${MONO_PATH:+:$MONO_PATH} prefix=$MONO_PREFIX $MONO_PREFIX/bin/mono-find-requires || echo "WARNING: MONO RPM REQUIRES WERE NOT GENERATED FOR THIS BUILD!!" 1>&2
|
2007-05-17 00:32:19 +02:00
|
|
|
+fi
|
2006-12-19 00:17:44 +01:00
|
|
|
+
|
|
|
|
+#
|
|
|
|
+# --- Kernel module imported symbols
|
|
|
|
+[ -x ${0%/*}/find-requires.ksyms ] &&
|
|
|
|
+ printf "%s\n" "${filelist[@]}" | ${0%/*}/find-requires.ksyms "$@"
|
|
|
|
|
|
|
|
exit 0
|