]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- auto-dependency exceptions macros support
authorJacek Konieczny <jajcus@pld-linux.org>
Fri, 23 Mar 2001 10:44:20 +0000 (10:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-find-perl-provides -> 1.2
    rpm-find-perl-requires -> 1.3
    rpm-find-provides -> 1.1
    rpm-find-requires -> 1.4

rpm-find-perl-provides
rpm-find-perl-requires
rpm-find-provides [new file with mode: 0644]
rpm-find-requires [new file with mode: 0755]

index 38ae6786f6c5715c3ce70ccb65d2bc83673c5383..90f62a71b045036f6e79c3d41c17aafb3f8f005f 100644 (file)
@@ -1,8 +1,21 @@
 #!/bin/sh
 ulimit -c 0
+cd `rpm --eval %{_builddir}`
 
 filelist=`sed "s/['\"]/\\\&/g"`
+if [ -f __rpm_noautoprovfiles ] ; then
+       for i in `cat __rpm_noautoprovfiles`; do
+               filelist=`echo $filelist | sed "s![[:space:]]*$i[[:space:]]*!!g"`
+       done
+fi
+
 
 echo $filelist|/usr/lib/rpm/find-provides
-/usr/lib/rpm/perl.prov $filelist
+provides_perl=`/usr/lib/rpm/perl.prov $filelist`
+if [ -f __rpm_noautoprov ] ; then
+       for i in `cat __rpm_noautoprov`; do
+               provides_perl=`echo $provides_perl | sed "s!\<$i[[:space:]]*!!g"`
+       done
+fi
 
+echo "$provides_perl"
index fcbee277a67ae7cbcb02fd692aab5998ca464325..eee26016f37d0b5853228d9d0619a54b99fd0830 100644 (file)
@@ -1,11 +1,30 @@
 #!/bin/sh
 ulimit -c 0
+cd `rpm --eval %{_builddir}`
 
 filelist=`sed "s/['\"]/\\\&/g"`
+if [ -f __rpm_noautoreqfiles ] ; then
+       for i in `cat __rpm_noautoreqfiles`; do
+               filelist=`echo $filelist | sed "s![[:space:]]*$i[[:space:]]*!!g"`
+       done
+fi
 
 requires="`echo $filelist|/usr/lib/rpm/find-requires`"
 requires_perl="`/usr/lib/rpm/perl.req $filelist`"
-requires_mod="`LC_ALL=C rpm -q --whatprovides --qf "%{NAME}\n"  $requires_perl 2>/dev/null`"
+if [ -f __rpm_noautoreq ] ; then
+       for i in `cat __rpm_noautoreq`; do
+               requires_perl=`echo $requires_perl | sed "s!\<$i[[:space:]]*!!g"`
+       done
+fi
+
+require_perl_t="$requires_perl"
+if [ -f __rpm_noautoreqdep ] ; then
+       for i in `cat __rpm_noautoreqdep`; do
+               requires_perl_t=`echo $requires_perl_t | sed "s!\<$i[[:space:]]*!!g"`
+       done
+fi
+
+requires_mod="`LC_ALL=C rpm -q --whatprovides --qf "%{NAME}\n"  $requires_perl_t 2>/dev/null`"
 echo "$requires
 $requires_perl
 $requires_mod"| grep -v "no package provides" | sort -u
diff --git a/rpm-find-provides b/rpm-find-provides
new file mode 100644 (file)
index 0000000..bb16bc3
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+cd `rpm --eval %{_builddir}`
+
+# This script reads filenames from STDIN and outputs any relevant provides
+# information that needs to be included in the package.
+
+filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1)
+if [ -f __rpm_noautoprovfiles ] ; then
+       for i in `cat __rpm_noautoprovfiles`; do
+               filelist=`echo $filelist | sed "s![[:space:]]*$i[[:space:]]*!!g"`
+       done
+fi
+
+allprovides=`for f in $filelist; do
+    soname=$(objdump -p $f | awk '/SONAME/ {print $2}')
+
+    if [ "$soname" != "" ]; then
+        if [ ! -L $f ]; then
+            echo $soname
+           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)"
+               done
+       fi
+    else
+       echo ${f##*/}
+    fi
+done | sort -u`
+
+if [ -f __rpm_noautoprovdep ] ; then
+       for i in `cat __rpm_noautoprovdep`; do
+               allprovides=`echo $allprovides | sed "s!\<$i[[:space:]]*!!g"`
+       done
+fi
+
+echo "$allprovides"
+
+
diff --git a/rpm-find-requires b/rpm-find-requires
new file mode 100755 (executable)
index 0000000..7c8e604
--- /dev/null
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+cd `rpm --eval %{_builddir}`
+
+# note this works for both a.out and ELF executables
+# it also auto-generates requirment lines for shell scripts
+
+ulimit -c 0
+
+filelist=`sed "s/['\"]/\\\&/g"`
+for i in /examples/ /doc/; do
+filelist=`echo $filelist | sed "s!\<[^[:space:]]*$i[^[:space:]]*[[:space:]]*!!g"`
+done
+if [ -f __rpm_noautoreqfiles ] ; then
+       for i in `cat __rpm_noautoreqfiles`; do
+               filelist=`echo $filelist | sed "s![[:space:]]*$i[[:space:]]*!!g"`
+       done
+fi
+exelist=`echo $filelist | xargs -r file | grep ":.*executable" |grep -v ":.*script"| cut -d: -f1 `
+elfexelist=`echo $exelist | xargs -r file | egrep  ":.* ELF" | cut -d: -f1 `
+aoutexelist=`echo $exelist | xargs -r file | egrep  -v ":.* ELF" | cut -d: -f1 `
+scriptlist=`echo $filelist | xargs -r file | egrep ":.* (commands|script) .*executable" | cut -d: -f1 `
+liblist=`echo $filelist | xargs -r file | grep ":.*shared object" | cut -d : -f1 `
+elfliblist=`echo $liblist | xargs -r file | egrep  ":.* ELF" | cut -d: -f1 `
+aoutliblist=`echo $liblist | xargs -r file | egrep  -v ":.* ELF" | cut -d: -f1 `
+
+aoutexerequires=`for f in $aoutexelist; do
+    if [ -x $f ]; then
+       ldd $f | awk '/=>/ { print $1 }'
+    fi
+done | sort -u | sed "s/['\"]/\\\&/g" | xargs -r -n 1 basename | grep -v 'libNoVersion.so' | sort -u
+`
+
+elfexerequires=`for f in $elfexelist; do 
+    if [ -x $f ]; then
+       objdump -p $f|awk '/NEEDED/ {print $2}'
+    fi
+done | sed "s/['\"]/\\\&/g" | grep -v 'libNoVersion.so' | sort -u
+`
+               
+aoutlibrequires=`for f in $aoutliblist; do
+    ldd $f | awk '/=>/ { print $1 }'
+done | sort -u | sed "s/['\"]/\\\&/g" | xargs -r -n 1 basename | grep -v 'libNoVersion.so' | sort -u
+`
+
+elflibrequires=`for f in $elfliblist; do
+       objdump -p $f|awk '/NEEDED/ {print $2}'
+done | sed "s/['\"]/\\\&/g" | grep -v 'libNoVersion.so' | sort -u
+`
+    
+for f in $scriptlist; do
+    if [ -x $f ]; then
+       head -1 $f | sed -ne '/^\#\!/p' | sed -e 's/^\#\![      ]*//' | cut -d" " -f1
+    fi
+done | sort -u
+
+for f in $liblist $exelist ; do
+    objdump -p $f | awk '
+       BEGIN { START=0; LIBNAME=""; }
+       /Version References:/ { START=1; }
+       /required from/ && (START==1) {
+           sub(/:/, "", $3);
+           LIBNAME=$3;
+       }
+       (START==1) && (LIBNAME!="") && ($4~/^GLIBC_*/) { print LIBNAME "(" $4 ")"; }
+       /^$/ { START=0; }
+    '
+done | sort -u
+# Generate name of rpm package provides library
+
+allrequires="$aoutexerequires
+$elfexerequires
+$aoutlibrequires
+$elflibrequires"
+
+if [ -f __rpm_noautoreq ] ; then
+       for i in `cat __rpm_noautoreq`; do
+               allrequires=`echo $allrequires | sed "s!\<$i[[:space:]]*!!g"`
+       done
+fi
+
+echo "$allrequires" | sort -u
+
+if [ -f __rpm_noautoreqdep ] ; then
+       for i in `cat __rpm_noautoreqdep`; do
+               allrequires=`echo $allrequires | sed "s!\<$i[[:space:]]*!!g"`
+       done
+fi
+
+echo "$allrequires" | LC_ALL=C xargs -r -- rpm -q --whatprovides --qf "%{NAME}\n"  2>/dev/null \
+       | grep -v "no package provides" | sort -u
+
This page took 0.10409 seconds and 4 git commands to generate.