summaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-abuild-use-scanelf-soname-to-find-the-provides-so.patch
blob: 8fe9ce296c333c1e85c601ac9b1583a33f1a3549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 87953c711587b932fb8e9f95798a0907faaaecf6 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 4 Sep 2012 12:30:08 +0000
Subject: [PATCH 1/2] abuild: use scanelf --soname to find the provides-so

---
 abuild.in | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/abuild.in b/abuild.in
index 32dd153..3acec46 100755
--- a/abuild.in
+++ b/abuild.in
@@ -778,8 +778,13 @@ prepare_tracedeps() {
 	[ "$arch" = "noarch" ] && return 0
 	options_has "!tracedeps" && return 0
 	# lets tell all the .so files this package provides in .provides-so
-	find -name '*.so' -o -name '*.so.[0-9]*' | sed 's:.*/::' \
-		>"$controldir"/.provides-so
+	scanelf --recursive --nobanner --soname "$dir" | while read etype soname file; do
+		# if soname field is missing, soname will be the filepath
+		# we only want shared libs
+		case $soname in
+		*.so|*.so.[0-9]*) echo ${soname##*/};;
+		esac
+	done >"$controldir"/.provides-so
 	# lets tell all the places we should look for .so files - all rpaths
 	scanelf -q -Rr "$dir" | sed -e 's/[[:space:]].*//' -e 's/:/\n/' \
 		| sort | uniq \
-- 
1.7.12