[postgresql] spec: split aarch64 patch to allow build for %upgrade == 0

Pavel Raiskup praiskup at fedoraproject.org
Wed Jul 24 12:16:57 UTC 2013


commit 9d28c850755fe48d6cfc3d140b0e49a4e1dbcc92
Author: Pavel Raiskup <praiskup at redhat.com>
Date:   Wed Jul 24 14:15:40 2013 +0200

    spec: split aarch64 patch to allow build for %upgrade == 0
    
    Version: 9.2.4-6

 postgresql-9.2.4-aarch64-atomic-upgrade.patch |   34 +++++++++++++++++++++++++
 postgresql-9.2.4-aarch64-atomic.patch         |   34 -------------------------
 postgresql.spec                               |   24 +++++++++++------
 3 files changed, 49 insertions(+), 43 deletions(-)
---
diff --git a/postgresql-9.2.4-aarch64-atomic-upgrade.patch b/postgresql-9.2.4-aarch64-atomic-upgrade.patch
new file mode 100644
index 0000000..2b8c82e
--- /dev/null
+++ b/postgresql-9.2.4-aarch64-atomic-upgrade.patch
@@ -0,0 +1,34 @@
+diff --git a/postgresql-9.1.9/src/include/storage/s_lock.h b/postgresql-9.1.9/src/include/storage/s_lock.h
+index 987fb9c..1ba718c 100644
+--- a/postgresql-9.1.9/src/include/storage/s_lock.h
++++ b/postgresql-9.1.9/src/include/storage/s_lock.h
+@@ -296,6 +296,29 @@ tas(volatile slock_t *lock)
+ #endif	 /* __arm__ */
+ 
+ 
++/*
++ * On ARM64, we use __sync_lock_test_and_set(int *, int) if available.
++ */
++#if defined(__aarch64__) || defined(__aarch64)
++#ifdef HAVE_GCC_INT_ATOMICS
++#define HAS_TEST_AND_SET
++
++#define TAS(lock) tas(lock)
++
++typedef int slock_t;
++
++static __inline__ int
++tas(volatile slock_t *lock)
++{
++	return __sync_lock_test_and_set(lock, 1);
++}
++
++#define S_UNLOCK(lock) __sync_lock_release(lock)
++
++#endif	 /* HAVE_GCC_INT_ATOMICS */
++#endif	 /* __aarch64__ */
++
++
+ /* S/390 and S/390x Linux (32- and 64-bit zSeries) */
+ #if defined(__s390__) || defined(__s390x__)
+ #define HAS_TEST_AND_SET
diff --git a/postgresql-9.2.4-aarch64-atomic.patch b/postgresql-9.2.4-aarch64-atomic.patch
index 3c5edda..7a297ce 100644
--- a/postgresql-9.2.4-aarch64-atomic.patch
+++ b/postgresql-9.2.4-aarch64-atomic.patch
@@ -1,37 +1,3 @@
-diff --git a/postgresql-9.1.9/src/include/storage/s_lock.h b/postgresql-9.1.9/src/include/storage/s_lock.h
-index 987fb9c..1ba718c 100644
---- a/postgresql-9.1.9/src/include/storage/s_lock.h
-+++ b/postgresql-9.1.9/src/include/storage/s_lock.h
-@@ -296,6 +296,29 @@ tas(volatile slock_t *lock)
- #endif	 /* __arm__ */
- 
- 
-+/*
-+ * On ARM64, we use __sync_lock_test_and_set(int *, int) if available.
-+ */
-+#if defined(__aarch64__) || defined(__aarch64)
-+#ifdef HAVE_GCC_INT_ATOMICS
-+#define HAS_TEST_AND_SET
-+
-+#define TAS(lock) tas(lock)
-+
-+typedef int slock_t;
-+
-+static __inline__ int
-+tas(volatile slock_t *lock)
-+{
-+	return __sync_lock_test_and_set(lock, 1);
-+}
-+
-+#define S_UNLOCK(lock) __sync_lock_release(lock)
-+
-+#endif	 /* HAVE_GCC_INT_ATOMICS */
-+#endif	 /* __aarch64__ */
-+
-+
- /* S/390 and S/390x Linux (32- and 64-bit zSeries) */
- #if defined(__s390__) || defined(__s390x__)
- #define HAS_TEST_AND_SET
 diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
 index d4a783f..29124b1 100644
 --- a/src/include/storage/s_lock.h
diff --git a/postgresql.spec b/postgresql.spec
index 9f264c7..3d2a0fe 100644
--- a/postgresql.spec
+++ b/postgresql.spec
@@ -58,7 +58,7 @@ Summary: PostgreSQL client programs
 Name: postgresql
 %global majorversion 9.2
 Version: 9.2.4
-Release: 5%{?dist}
+Release: 6%{?dist}
 
 # The PostgreSQL license is very similar to other MIT licenses, but the OSI
 # recognizes it as an independent license, so we do as well.
@@ -103,11 +103,6 @@ Patch4: postgresql-config-comment.patch
 Patch5: postgresql-multi-sockets.patch
 Patch6: postgresql-var-run-socket.patch
 
-# Add support for atomic operations TAS/S_UNLOCK in aarch64.
-# ~> upstream (612ecf311b)
-# ~> #970661
-Patch7: postgresql-9.2.4-aarch64-atomic.patch
-
 # Comments for these patches are in the patch files.
 Patch8: postgresql-man.patch
 
@@ -115,6 +110,12 @@ Patch8: postgresql-man.patch
 # ~> upstream (035a5e1e8c34)
 Patch9: postgresql-9.2.4-perl-5.18.patch
 
+# Add support for atomic operations TAS/S_UNLOCK in aarch64.
+# ~> upstream (612ecf311b)
+# ~> #970661
+Patch10: postgresql-9.2.4-aarch64-atomic.patch
+Patch11: postgresql-9.2.4-aarch64-atomic-upgrade.patch
+
 BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex gawk
 BuildRequires: perl(ExtUtils::Embed), perl-devel
 BuildRequires: readline-devel zlib-devel
@@ -343,6 +344,7 @@ benchmarks.
 %patch6 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 
 # We used to run autoconf here, but there's no longer any real need to,
 # since Postgres ships with a reasonably modern configure script.
@@ -360,10 +362,11 @@ tar xfj %{SOURCE3}
 # (and also see the ppc64p7 hack above)
 cp -p config/config.guess postgresql-%{prevversion}/config/config.guess
 cp -p config/config.sub postgresql-%{prevversion}/config/config.sub
-%endif
 
-# the %%{SOURCE3} must be unpacked before this patch is applied
-%patch7 -p1 -b .atomic-aarch64
+pushd postgresql-%{prevversion}
+%patch11 -p2
+popd
+%endif
 
 # remove .gitignore files to ensure none get into the RPMs (bug #642210)
 find . -type f -name .gitignore | xargs rm
@@ -1114,6 +1117,9 @@ fi
 %endif
 
 %changelog
+* Wed Jul 24 2013 Pavel Raiskup <praiskup at redhat.com> - 9.2.4-6
+- split aarch64 patch to allow build without postgresql-upgrade
+
 * Tue Jul 23 2013 Pavel Raiskup <praiskup at redhat.com> - 9.2.4-5
 - fix testsuite to allow build against Perl 5.18
 


More information about the scm-commits mailing list