summaryrefslogtreecommitdiff
path: root/autodeps
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2000-02-06 19:05:36 +0000
committerjbj <devnull@localhost>2000-02-06 19:05:36 +0000
commitf7b7154b57dd4ae628c4eac68bc62a9cca8c37de (patch)
treec0ac4f556f6a0b9585a3cb5734a22e246305ab44 /autodeps
parent016eacb22a8decd8f37473c8559949c93135650e (diff)
downloadlibrpm-tizen-f7b7154b57dd4ae628c4eac68bc62a9cca8c37de.tar.gz
librpm-tizen-f7b7154b57dd4ae628c4eac68bc62a9cca8c37de.tar.bz2
librpm-tizen-f7b7154b57dd4ae628c4eac68bc62a9cca8c37de.zip
(From suzukis@file.phys.tohoku.ac.jp)
It seems that current rpm can work on FreeBSD, on OpenBSD, and possibly on NetBSD (myself have not checked yet), but find-provides and find-requires scripts are not provided in rpm tarball. And, taking a glance on the "port"ed version of rpm by FreeBSD people, they didn't write their own scripts. Here's find-provides and find-requires for FreeBSD & OpenBSD. I checked on FreeBSD-2.2.8 and OpenBSD-2.5 (possibly works on 2.6 too) both a.out executable format. One of the known problem is that following script cannot check the inter-library dependency. On both systems, objdump is not bundled in default installation, and even if you install objdump of GNU binutils, it cannot check the inter-library dependency. The recent FreeBSD and NetBSD are in ELF format, so should be modified... I will send a version for FreeBSD-3.4 sooner or later, but if anybody is interested in, please write. I wish these scripts will be included in future version of rpm. suzuki CVS patchset: 3543 CVS date: 2000/02/06 19:05:36
Diffstat (limited to 'autodeps')
-rw-r--r--autodeps/freebsd.prov9
-rw-r--r--autodeps/freebsd.req22
-rw-r--r--autodeps/openbsd.prov9
-rw-r--r--autodeps/openbsd.req22
4 files changed, 62 insertions, 0 deletions
diff --git a/autodeps/freebsd.prov b/autodeps/freebsd.prov
new file mode 100644
index 000000000..cf00d4f14
--- /dev/null
+++ b/autodeps/freebsd.prov
@@ -0,0 +1,9 @@
+#!/bin/sh
+# ----------------------------------------------------------
+# find-provides for FreeBSD-2.2.x
+# ----------------------------------------------------------
+filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "FreeBSD.*shared" | cut -d: -f1)
+
+for f in $filelist; do
+ echo ${f##*/}
+done | sort -u
diff --git a/autodeps/freebsd.req b/autodeps/freebsd.req
new file mode 100644
index 000000000..c42d93c5a
--- /dev/null
+++ b/autodeps/freebsd.req
@@ -0,0 +1,22 @@
+#!/bin/sh
+# ----------------------------------------------------------------
+# find-requires for FreeBSD-2.2.x
+# how do we know what is required by a.out shared libraries?
+# ----------------------------------------------------------------
+ulimit -c 0
+
+filelist=`sed "s/['\"]/\\\&/g"`
+exelist=`echo $filelist | xargs file | fgrep executable | cut -d: -f1 `
+scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 `
+
+for f in $exelist; do
+ if [ -x $f ]; then
+ ldd $f | /usr/bin/awk '/=>/&&!/not found/ { print $3 }'
+ fi
+done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u
+
+for f in $scriptlist; do
+ if [ -x $f ]; then
+ head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1
+ fi
+done | sort -u
diff --git a/autodeps/openbsd.prov b/autodeps/openbsd.prov
new file mode 100644
index 000000000..1e7b06eb3
--- /dev/null
+++ b/autodeps/openbsd.prov
@@ -0,0 +1,9 @@
+#!/bin/sh
+# ----------------------------------------------------------
+# find-provides for OpenBSD-2.5
+# ----------------------------------------------------------
+filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "OpenBSD.*shared" | cut -d: -f1)
+
+for f in $filelist; do
+ echo ${f##*/}
+done | sort -u
diff --git a/autodeps/openbsd.req b/autodeps/openbsd.req
new file mode 100644
index 000000000..551ac2cfb
--- /dev/null
+++ b/autodeps/openbsd.req
@@ -0,0 +1,22 @@
+#!/bin/sh
+# ----------------------------------------------------------------
+# find-requires for OpenBSD-2.2.x
+# how do we know what is required by a.out shared libraries?
+# ----------------------------------------------------------------
+ulimit -c 0
+
+filelist=`sed "s/['\"]/\\\&/g"`
+exelist=`echo $filelist | xargs file | fgrep executable | cut -d: -f1 `
+scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 `
+
+for f in $exelist; do
+ if [ -x $f ]; then
+ ldd $f | /usr/bin/awk '/\=\>/&&!/not found/ { print $3 }'
+ fi
+done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u
+
+for f in $scriptlist; do
+ if [ -x $f ]; then
+ head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1
+ fi
+done | sort -u