From 9d8d74f5601710e62667ceda1480924ec14d8c1e Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Mon, 22 Mar 2021 01:53:47 +0100 Subject: [PATCH] - merged PLD fix for _target_platform --- rpm.spec | 2 +- x32.patch | 138 ++++++++++++++++++++++++++---------------------------- 2 files changed, 67 insertions(+), 73 deletions(-) diff --git a/rpm.spec b/rpm.spec index a0cfec4..cfd989d 100644 --- a/rpm.spec +++ b/rpm.spec @@ -34,7 +34,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM Summary(uk.UTF-8): Менеджер пакетів від RPM Name: rpm Version: 4.16.1.2 -Release: 8.1 +Release: 9 Epoch: 1 License: GPL v2 / LGPL v2.1 Group: Base diff --git a/x32.patch b/x32.patch index 197f905..38aa140 100644 --- a/x32.patch +++ b/x32.patch @@ -1,7 +1,7 @@ -diff -ur rpm-4.15.1.orig/build/rpmfc.c rpm-4.15.1/build/rpmfc.c ---- rpm-4.15.1.orig/build/rpmfc.c 2019-12-29 14:07:19.877313873 +0100 -+++ rpm-4.15.1/build/rpmfc.c 2019-12-29 13:47:23.183804165 +0100 -@@ -595,6 +595,7 @@ +diff -ur rpm-4.16.1.2/build/rpmfc.c rpm-4.16.1.2.x32/build/rpmfc.c +--- rpm-4.16.1.2/build/rpmfc.c 2021-03-21 21:51:28.231530270 +0100 ++++ rpm-4.16.1.2.x32/build/rpmfc.c 2021-03-21 21:50:04.127398387 +0100 +@@ -641,6 +641,7 @@ { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE }, { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE }, @@ -9,7 +9,7 @@ diff -ur rpm-4.15.1.orig/build/rpmfc.c rpm-4.15.1/build/rpmfc.c { "troff or preprocessor input", RPMFC_INCLUDE }, { "GNU Info", RPMFC_INCLUDE }, -@@ -696,7 +697,11 @@ +@@ -746,7 +747,11 @@ if (strstr(fmstr, fct->token) == NULL) continue; @@ -22,7 +22,7 @@ diff -ur rpm-4.15.1.orig/build/rpmfc.c rpm-4.15.1/build/rpmfc.c if (fcolor & RPMFC_INCLUDE) break; } -@@ -1152,7 +1152,10 @@ +@@ -1147,7 +1152,10 @@ color = RPMFC_ELF64; break; case ELFCLASS32: @@ -34,9 +34,9 @@ diff -ur rpm-4.15.1.orig/build/rpmfc.c rpm-4.15.1/build/rpmfc.c break; } elf_end(elf); -diff -ur rpm-4.15.1.orig/build/rpmfc.h rpm-4.15.1/build/rpmfc.h ---- rpm-4.15.1.orig/build/rpmfc.h 2019-06-26 16:17:31.397985717 +0200 -+++ rpm-4.15.1/build/rpmfc.h 2019-12-29 13:45:05.936980833 +0100 +diff -ur rpm-4.16.1.2/build/rpmfc.h rpm-4.16.1.2.x32/build/rpmfc.h +--- rpm-4.16.1.2/build/rpmfc.h 2020-05-28 12:04:25.011136544 +0200 ++++ rpm-4.16.1.2.x32/build/rpmfc.h 2021-03-21 21:50:04.127398387 +0100 @@ -26,8 +26,9 @@ RPMFC_BLACK = 0, RPMFC_ELF32 = (1 << 0), @@ -48,10 +48,10 @@ diff -ur rpm-4.15.1.orig/build/rpmfc.h rpm-4.15.1/build/rpmfc.h /* (1 << 3) leaks into package headers, reserved */ RPMFC_WHITE = (1 << 29), -diff -ur rpm-4.15.1.orig/configure.ac rpm-4.15.1/configure.ac ---- rpm-4.15.1.orig/configure.ac 2019-12-29 14:07:19.813977936 +0100 -+++ rpm-4.15.1/configure.ac 2019-12-29 14:27:41.381850928 +0100 -@@ -1050,6 +1050,9 @@ +diff -ur rpm-4.16.1.2/configure.ac rpm-4.16.1.2.x32/configure.ac +--- rpm-4.16.1.2/configure.ac 2021-03-21 21:51:28.221530479 +0100 ++++ rpm-4.16.1.2.x32/configure.ac 2021-03-21 21:50:04.127398387 +0100 +@@ -930,6 +930,9 @@ host_os=`echo "${host_os}" | sed 's/-gnueabi$//'` host_os_gnu=-gnueabi fi @@ -61,18 +61,50 @@ diff -ur rpm-4.15.1.orig/configure.ac rpm-4.15.1/configure.ac if echo "$host_os" | grep '.*-gnu' > /dev/null ; then host_os=`echo "${host_os}" | sed 's/-gnu$//'` fi -diff -ur rpm-4.15.1.orig/installplatform rpm-4.15.1/installplatform ---- rpm-4.15.1.orig/installplatform 2019-06-26 16:17:31.404985707 +0200 -+++ rpm-4.15.1/installplatform 2019-12-29 14:52:09.331085139 +0100 -@@ -21,6 +21,7 @@ +diff -ur rpm-4.16.1.2/fileattrs/python.attr rpm-4.16.1.2.x32/fileattrs/python.attr +--- rpm-4.16.1.2/fileattrs/python.attr 2020-08-31 11:14:07.991087349 +0200 ++++ rpm-4.16.1.2.x32/fileattrs/python.attr 2021-03-21 21:50:04.127398387 +0100 +@@ -14,14 +14,15 @@ + %__python_requires() %{lua: + -- Match buildroot paths of the form + -- /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and +- -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ ++ -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ and ++ -- /PATH/OF/BUILDROOT/usr/libx32/pythonMAJOR.MINOR/ + -- generating a line of the form: + -- python(abi) = MAJOR.MINOR + local path = rpm.expand('%1') +- if path:match('/usr/lib%d*/python%d+%.%d+/.*') then +- local requires = path:gsub('.*/usr/lib%d*/python(%d+%.%d+)/.*', 'python(abi) = %1') ++ if path:match('/usr/lib%w*/python%d+%.%d+/.*') then ++ local requires = path:gsub('.*/usr/lib%w*/python(%d+%.%d+)/.*', 'python(abi) = %1') + print(requires) + end + } + +-%__python_path ^((%{_prefix}/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$ ++%__python_path ^((%{_prefix}/lib(64|x32)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$ +diff -ur rpm-4.16.1.2/fileattrs/pythondist.attr rpm-4.16.1.2.x32/fileattrs/pythondist.attr +--- rpm-4.16.1.2/fileattrs/pythondist.attr 2020-05-28 12:04:25.026136626 +0200 ++++ rpm-4.16.1.2.x32/fileattrs/pythondist.attr 2021-03-21 21:50:04.127398387 +0100 +@@ -1,3 +1,3 @@ + %__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides + %__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires +-%__pythondist_path /lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$ ++%__pythondist_path /lib(64|x32)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$ +diff -ur rpm-4.16.1.2/installplatform rpm-4.16.1.2.x32/installplatform +--- rpm-4.16.1.2/installplatform 2020-05-28 12:04:25.027136631 +0200 ++++ rpm-4.16.1.2.x32/installplatform 2021-03-21 21:51:47.671145954 +0100 +@@ -21,6 +21,8 @@ ARCH_INSTALL_POST='%{nil}' LIB=lib + TARGETCPU="%{_target_cpu}" ++ FORCE_RPMRC_GNU= # XXX FIXME: incomplete and quite likely wrong too in places, # consult various arch folks for correct names etc. -@@ -82,7 +83,15 @@ +@@ -75,7 +77,16 @@ ISANAME=x86 ISABITS=64 CANONARCH=x86_64 @@ -84,12 +116,13 @@ diff -ur rpm-4.15.1.orig/installplatform rpm-4.15.1/installplatform + ISABITS=x32 + CANONARCH=x32 + CANONCOLOR=7 -+ FORCE_RPMRC_GNU="${RPMRC_GNU}x32" ++ RPMRC_GNU="gnux32" ++ FORCE_RPMRC_GNU="%{?_gnu}" + TARGETCPU="x86_64" ;; ia64) ISANAME=ia -@@ -190,10 +199,14 @@ +@@ -190,10 +201,14 @@ # skip architectures for which we dont have full config parameters [ -z "$CANONARCH" ] && continue @@ -105,40 +138,30 @@ diff -ur rpm-4.15.1.orig/installplatform rpm-4.15.1/installplatform PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}" [ -d $PPD ] || mkdir -p $PPD -@@ -201,7 +214,8 @@ - | sed -e "s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS," \ +@@ -202,6 +221,8 @@ -e "s,@RPMCANONARCH@,$CANONARCH,g" \ -e "s,@RPMCANONCOLOR@,$CANONCOLOR," \ -- -e "s,@RPMRC_GNU@,$RPMRC_GNU," \ -+ -e "s,@RPMRC_GNU@,${FORCE_RPMRC_GNU:-$RPMRC_GNU}," \ + -e "s,@RPMRC_GNU@,$RPMRC_GNU," \ ++ -e "s,@FORCE_RPMRC_GNU@,$FORCE_RPMRC_GNU," \ + -e "s,@TARGETCPU@,$TARGETCPU," \ -e "s,@LIB@,$LIB," \ -e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \ -e '/\${\w*:-/!s,\${,%{_,' \ -@@ -212,6 +226,8 @@ - | ${FILTER} \ - > ${PPD}/macros - -+ FORCE_RPMRC_GNU= -+ - done - - # gently adjust undefined autoconf variables to rpm macros... -diff -ur rpm-4.15.1.orig/platform.in rpm-4.15.1/platform.in ---- rpm-4.15.1.orig/platform.in 2019-11-13 10:19:29.371710954 +0100 -+++ rpm-4.15.1/platform.in 2019-12-29 14:47:30.886959421 +0100 +diff -ur rpm-4.16.1.2/platform.in rpm-4.16.1.2.x32/platform.in +--- rpm-4.16.1.2/platform.in 2020-05-28 12:04:25.047136741 +0200 ++++ rpm-4.16.1.2.x32/platform.in 2021-03-21 21:51:47.671145954 +0100 @@ -8,7 +8,7 @@ %_vendor @RPMCANONVENDOR@ %_os @RPMCANONOS@ %_gnu @RPMRC_GNU@ -%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os} -+%_target_platform @TARGETCPU@-%{_vendor}-%{_target_os} ++%_target_platform @TARGETCPU@-%{_vendor}-%{_target_os}@FORCE_RPMRC_GNU@ %optflags @RPMRC_OPTFLAGS@ %__isa_name @ISANAME@ -diff -ur rpm-4.15.1.orig/rpmrc.in rpm-4.15.1/rpmrc.in ---- rpm-4.15.1.orig/rpmrc.in 2019-11-13 10:19:29.418711227 +0100 -+++ rpm-4.15.1/rpmrc.in 2019-12-29 14:51:20.293119352 +0100 +diff -ur rpm-4.16.1.2/rpmrc.in rpm-4.16.1.2.x32/rpmrc.in +--- rpm-4.16.1.2/rpmrc.in 2020-05-28 12:04:25.075136894 +0200 ++++ rpm-4.16.1.2.x32/rpmrc.in 2021-03-21 21:50:04.127398387 +0100 @@ -24,6 +24,7 @@ optflags: x86_64 -O2 -g optflags: amd64 -O2 -g @@ -196,9 +219,9 @@ diff -ur rpm-4.15.1.orig/rpmrc.in rpm-4.15.1/rpmrc.in buildarch_compat: sh3: noarch buildarch_compat: sh4: noarch buildarch_compat: sh4a: sh4 -diff -ur rpm-4.15.1.orig/tools/elfdeps.c rpm-4.15.1/tools/elfdeps.c ---- rpm-4.15.1.orig/tools/elfdeps.c 2019-06-26 16:17:31.462985619 +0200 -+++ rpm-4.15.1/tools/elfdeps.c 2019-12-29 14:22:05.339471071 +0100 +diff -ur rpm-4.16.1.2/tools/elfdeps.c rpm-4.16.1.2.x32/tools/elfdeps.c +--- rpm-4.16.1.2/tools/elfdeps.c 2020-05-28 12:04:25.084136944 +0200 ++++ rpm-4.16.1.2.x32/tools/elfdeps.c 2021-03-21 21:50:04.127398387 +0100 @@ -94,6 +94,9 @@ break; } @@ -209,32 +232,3 @@ diff -ur rpm-4.15.1.orig/tools/elfdeps.c rpm-4.15.1/tools/elfdeps.c return marker; } ---- rpm-4.15.1/fileattrs/pythondist.attr~ 2019-06-26 23:17:31.000000000 +0900 -+++ rpm-4.15.1/fileattrs/pythondist.attr 2020-01-04 23:34:05.680366882 +0900 -@@ -1,3 +1,3 @@ - %__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides - %__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires --%__pythondist_path /lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$ -+%__pythondist_path /lib(64|x32)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$ ---- rpm-4.16.0/fileattrs/python.attr.orig 2020-08-31 11:14:07.991087349 +0200 -+++ rpm-4.16.0/fileattrs/python.attr 2020-10-03 10:47:16.560360859 +0200 -@@ -14,14 +14,15 @@ - %__python_requires() %{lua: - -- Match buildroot paths of the form - -- /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and -- -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ -+ -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ and -+ -- /PATH/OF/BUILDROOT/usr/libx32/pythonMAJOR.MINOR/ - -- generating a line of the form: - -- python(abi) = MAJOR.MINOR - local path = rpm.expand('%1') -- if path:match('/usr/lib%d*/python%d+%.%d+/.*') then -- local requires = path:gsub('.*/usr/lib%d*/python(%d+%.%d+)/.*', 'python(abi) = %1') -+ if path:match('/usr/lib%w*/python%d+%.%d+/.*') then -+ local requires = path:gsub('.*/usr/lib%w*/python(%d+%.%d+)/.*', 'python(abi) = %1') - print(requires) - end - } - --%__python_path ^((%{_prefix}/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$ -+%__python_path ^((%{_prefix}/lib(64|x32)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$ -- 2.46.0