Update autotools files on aarch64 33/26033/1 accepted/tizen/common/20140826.160946 accepted/tizen/ivi/20140902.210650 submit/tizen/20140825.050559
authorVyacheslav Barinov <v.barinov@samsung.com>
Thu, 14 Aug 2014 07:52:16 +0000 (11:52 +0400)
committerVyacheslav Barinov <v.barinov@samsung.com>
Thu, 14 Aug 2014 10:37:21 +0000 (14:37 +0400)
Patch borrowed from OpenSUSE rpm.
We have many packages with old config.sub and config.guess files which don't
have aarch64 support. In order not to patch every separate package, just update
them from rpmbuild during build initialization

Change-Id: I040bab160864edad84fd9cffcff2c9226ef3a4d0
Signed-off-by: Vyacheslav Barinov <v.barinov@samsung.com>
build/parseBuildInstallClean.c
packaging/rpm.spec

index 6386c23..f7b4bb7 100644 (file)
@@ -46,7 +46,24 @@ int parseBuildInstallClean(rpmSpec spec, int parsePart)
     } else if (rc < 0) {
        goto exit;
     }
-    
+
+    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"
+        );
+        appendLineStringBuf(*sbp, buf);
+        free(buf);
+    }
+
     while (! (nextPart = isPart(spec->line))) {
        appendStringBuf(*sbp, spec->line);
        if ((rc = readLine(spec, STRIP_NOTHING)) > 0) {
index 5027ba0..844f557 100644 (file)
@@ -206,6 +206,10 @@ for i in %{_datadir}/automake-*/*; do
   fi
 done
 popd
+%ifarch aarch64 ppc64le
+install -m 755 config.guess %{buildroot}/usr/lib/rpm
+install -m 755 config.sub %{buildroot}/usr/lib/rpm
+%endif
 rm -f %{buildroot}%{_libdir}/*.la
 rm -f %{buildroot}%{__plugindir}/*.la
 
@@ -290,6 +294,9 @@ rm -f %{_dbpath}/Filemd5s \
 %{rpmhome}/*.req
 %{rpmhome}/macros.*
 %{rpmhome}/fileattrs
+%ifarch aarch64 ppc64le
+%{rpmhome}/config.*
+%endif
 
 %files devel
 %manifest %{name}.manifest