[packages/rpm] - restore libtool dependency generator removed upstream

baggins baggins at pld-linux.org
Tue May 24 17:21:28 CEST 2022


commit a5bd64660761a3e536aa6339ec84a2faeda3311a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Nov 8 08:50:17 2021 +0100

    - restore libtool dependency generator removed upstream

 libtool.attr           |  3 +++
 libtooldeps.sh         | 51 ++++++++++++++++++++++++++++++++++++++++
 rpm-libtool-deps.patch | 64 --------------------------------------------------
 rpm.spec               | 11 +++++----
 4 files changed, 61 insertions(+), 68 deletions(-)
---
diff --git a/rpm.spec b/rpm.spec
index ed014f8..d46290c 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -56,6 +56,8 @@ Source12:	%{name}.noautoprovfiles
 Source13:	%{name}.noautoreq
 Source14:	%{name}.noautoreqfiles
 Source15:	perl.prov
+Source16:	libtooldeps.sh
+Source17:	libtool.attr
 Patch0:		%{name}-man_pl.patch
 Patch1:		%{name}-popt-aliases.patch
 Patch2:		%{name}-perl-macros.patch
@@ -64,7 +66,6 @@ Patch4:		%{name}-scripts-closefds.patch
 Patch5:		%{name}-dir-macros-relative.patch
 Patch6:		%{name}-perl_req-INC_dirs.patch
 Patch7:		%{name}-debuginfo.patch
-Patch8:		%{name}-libtool-deps.patch
 Patch9:		%{name}-builddir-readlink.patch
 Patch10:	%{name}-changelog_order_check_nonfatal.patch
 Patch11:	%{name}-postun-nofail.patch
@@ -629,7 +630,6 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch5 -p1
 %patch6 -p0
 %patch7 -p1
-#%patch8 -p1
 #%patch9 -p1
 %patch10 -p1
 %patch11 -p1
@@ -796,6 +796,9 @@ cp -p %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprovfiles
 cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreq
 cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreqfiles
 
+cp -p %{SOURCE16} $RPM_BUILD_ROOT%{_rpmlibdir}/libtooldeps.sh
+cp -p %{SOURCE17} $RPM_BUILD_ROOT%{_rpmlibdir}/fileattrs/libtool.attr
+
 # move rpm to /bin
 %{__mv} $RPM_BUILD_ROOT%{_bindir}/rpm $RPM_BUILD_ROOT/bin
 ln -sf /bin/rpm $RPM_BUILD_ROOT%{_bindir}/rpmquery
@@ -1017,7 +1020,7 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %attr(755,root,root) %{_rpmlibdir}/check-files
 %attr(755,root,root) %{_rpmlibdir}/install-build-tree
 %attr(755,root,root) %{_rpmlibdir}/elfdeps
-#%attr(755,root,root) %{_rpmlibdir}/libtooldeps.sh
+%attr(755,root,root) %{_rpmlibdir}/libtooldeps.sh
 # needs hacked pkg-config to return anything
 %attr(755,root,root) %{_rpmlibdir}/pkgconfigdeps.sh
 %attr(755,root,root) %{_rpmlibdir}/mkinstalldirs
@@ -1048,7 +1051,7 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %{_rpmlibdir}/fileattrs/desktop.attr
 %{_rpmlibdir}/fileattrs/elf.attr
 %{_rpmlibdir}/fileattrs/font.attr
-#%{_rpmlibdir}/fileattrs/libtool.attr
+%{_rpmlibdir}/fileattrs/libtool.attr
 %{_rpmlibdir}/fileattrs/metainfo.attr
 %{_rpmlibdir}/fileattrs/ocaml.attr
 %{_rpmlibdir}/fileattrs/perl.attr
diff --git a/libtool.attr b/libtool.attr
new file mode 100644
index 0000000..ed5cb8c
--- /dev/null
+++ b/libtool.attr
@@ -0,0 +1,3 @@
+%__libtool_provides	%{_rpmconfigdir}/libtooldeps.sh --provides %{buildroot} %{name}
+%__libtool_requires	%{_rpmconfigdir}/libtooldeps.sh --requires %{buildroot} %{name}
+%__libtool_path	^%{_libdir}/.*\.la$
diff --git a/libtooldeps.sh b/libtooldeps.sh
new file mode 100644
index 0000000..d08e3d5
--- /dev/null
+++ b/libtooldeps.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+[ $# -ge 2 ] || {
+    cat > /dev/null
+    exit 0
+}
+
+pkgname="$3"
+
+case $1 in
+-P|--provides)
+    shift
+    RPM_BUILD_ROOT="$1"
+    while read possible
+    do
+	case "$possible" in
+	*.la)
+	    if file -L "$possible" | grep -iq 'libtool library file' 2> /dev/null ; then
+		possible="`echo ${possible} | sed -e s,${RPM_BUILD_ROOT}/,/,`"
+		echo "libtool($possible)"
+	    fi
+	    ;;
+	esac
+    done
+    ;;
+-R|--requires)
+    case $pkgname in
+    *-devel)
+	    while read possible ; do
+		case "$possible" in
+		*.la)
+		    for dep in `grep '^dependency_libs=' "$possible" 2> /dev/null | \
+				sed -e "s,^dependency_libs='\(.*\)',\1,g"`
+		    do
+			case "$dep" in
+			/*.la)
+			    dep="`readlink -f "$dep" 2> /dev/null || echo "$dep"`"
+			    echo "libtool($dep)"
+			    ;;
+			esac
+		    done
+		    ;;
+		esac
+	    done
+     ;;
+     *)
+            cat > /dev/null
+     ;;
+     esac
+esac
+exit 0
diff --git a/rpm-libtool-deps.patch b/rpm-libtool-deps.patch
deleted file mode 100644
index 443d1fd..0000000
--- a/rpm-libtool-deps.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- rpm-4.4.8.org/scripts/libtooldeps.sh	2005-11-12 22:20:42.000000000 +0100
-+++ rpm-4.4.8/scripts/libtooldeps.sh	2006-11-26 20:06:49.254008750 +0100
-@@ -5,15 +5,17 @@
-     exit 0
- }
- 
-+pkgname="$3"
-+
- case $1 in
- -P|--provides)
-     shift
--    RPM_BUILD_ROOT="$1"
-+    RPM_BUILD_ROOT="$1"
-     while read possible
-     do
- 	case "$possible" in
- 	*.la)
--	    if grep -Eiq '^# Generated by (libtool|ltmain.sh)' "$possible" 2> /dev/null ; then
-+	    if file -L "$possible" | grep -iq 'libtool library file' 2> /dev/null ; then
- 		possible="`echo ${possible} | sed -e s,${RPM_BUILD_ROOT}/,/,`"
- 		echo "libtool($possible)"
- 	    fi
-@@ -22,21 +24,28 @@
-     done
-     ;;
- -R|--requires)
--    while read possible ; do
--	case "$possible" in
--	*.la)
--	    for dep in `grep '^dependency_libs='"$possible" 2> /dev/null | \
--			sed -e "s,^dependency_libs='\(.*\)',\1,g"`
--	    do
--		case "$dep" in
--		/*.la)
--		    echo "libtool($dep)"
-+    case $pkgname in
-+    *-devel)
-+	    while read possible ; do
-+		case "$possible" in
-+		*.la)
-+		    for dep in `grep '^dependency_libs=' "$possible" 2> /dev/null | \
-+				sed -e "s,^dependency_libs='\(.*\)',\1,g"`
-+		    do
-+			case "$dep" in
-+			/*.la)
-+			    dep="`readlink -f "$dep" 2> /dev/null || echo "$dep"`"
-+			    echo "libtool($dep)"
-+			    ;;
-+			esac
-+		    done
- 		    ;;
- 		esac
- 	    done
--	    ;;
--	esac
--    done
--    ;;
-+     ;;
-+     *)
-+            cat > /dev/null
-+     ;;
-+     esac
- esac
- exit 0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/51804d7b37f88c82f3e672f0310322ae05d98db8



More information about the pld-cvs-commit mailing list