summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2022-04-12 13:11:44 +0200
committerŁukasz Stelmach <l.stelmach@samsung.com>2023-03-30 11:26:59 +0200
commit894a0cb4562c358725b063db1a6ab37e7dcc694d (patch)
treec30b8d9ee118afa6c88136f050e25f52ca6427d6
parent05d2a4cf2edb944316a62b284695b99c8b32fe1b (diff)
downloadrpm-894a0cb4562c358725b063db1a6ab37e7dcc694d.tar.gz
rpm-894a0cb4562c358725b063db1a6ab37e7dcc694d.tar.bz2
rpm-894a0cb4562c358725b063db1a6ab37e7dcc694d.zip
Update autotools files on riscv64
Patch borrowed from OpenSUSE rpm. Change-Id: Idf138d3b8c4f66c5c470f3d28c9f6ac238fdb545 Origin: https://build.opensuse.org/package/view_file/Base:System/rpm/auto-config-update-aarch64-ppc64le.diff Fixes: 5bc7b1f94 ("Update autotools files on aarch64") Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
-rw-r--r--build/parseBuildInstallClean.c29
-rw-r--r--packaging/rpm.spec4
2 files changed, 19 insertions, 14 deletions
diff --git a/build/parseBuildInstallClean.c b/build/parseBuildInstallClean.c
index f7b4bb715..199571720 100644
--- a/build/parseBuildInstallClean.c
+++ b/build/parseBuildInstallClean.c
@@ -48,18 +48,23 @@ int parseBuildInstallClean(rpmSpec spec, int parsePart)
}
if (parsePart == PART_BUILD) {
- char* buf = strdup(
- "if [[ `uname -m` == \"aarch64\" ]]; then\n"
- "ref=/usr/lib/rpm\n"
- "for s in guess sub; do\n"
- " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n"
- " grep -q config-patches@ $c || continue\n"
- " grep -q aarch64 $c || install -m 755 $ref/config.$s $c\n"
- " grep -q ppc64le $c || install -m 755 $ref/config.$s $c\n"
- " done\n"
- "done\n"
- "fi\n"
- );
+ char* buf = strdup(
+ "ref=/usr/lib/rpm\n"
+ "mints=0\n"
+ "case $(uname -m) in\n"
+ " aarch64) mints=20120610;;\n"
+ " ppc64le) mints=20130610;;\n"
+ " riscv64) mints=20160911;;\n"
+ "esac\n"
+ "for s in guess sub; do\n"
+ " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n"
+ " grep -q config-patches@ $c || continue\n"
+ " timestamp=$(sed -n \"/^timestamp=/{s///;s/[-'\\\"]//g;p;q;}\" $c)\n"
+ " test -n \"$timestamp\" || timestamp=0\n"
+ " test $timestamp -ge $mints || install -m 755 $ref/config.$s $c\n"
+ " done\n"
+ "done\n"
+ );
appendLineStringBuf(*sbp, buf);
free(buf);
}
diff --git a/packaging/rpm.spec b/packaging/rpm.spec
index 8a4b3c71d..f50652efe 100644
--- a/packaging/rpm.spec
+++ b/packaging/rpm.spec
@@ -229,7 +229,7 @@ for i in %{_datadir}/automake-*/*; do
rm -f %{buildroot}%{rpmhome}/"${i##*/}"
fi
done
-%ifarch aarch64 ppc64le
+%ifarch aarch64 ppc64le riscv64
install -m 755 config.guess %{buildroot}%{rpmhome}
install -m 755 config.sub %{buildroot}%{rpmhome}
%endif
@@ -328,7 +328,7 @@ rm -f %{_dbpath}/Filemd5s \
%{rpmhome}/macros.*
%{rpmhome}/fileattrs
%{rpmhome}/debug.manifest
-%ifarch aarch64 ppc64le
+%ifarch aarch64 ppc64le riscv64
%{rpmhome}/config.*
%endif