From c2f52cb11ea889a563c7b5c19a773ccb8ae5c4a5 Mon Sep 17 00:00:00 2001
From: Jacco Ligthart <jacco@redsleeve.org>
Date: Sat, 28 Nov 2015 22:11:10 +0100
Subject: [PATCH] redsleeve

---
 SOURCES/pyparted-3.9-arm.patch | 38 ++++++++++++++++++++++++++++++++++++++
 SPECS/pyparted.spec            |  9 ++++++++-
 2 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 SOURCES/pyparted-3.9-arm.patch

diff --git a/SOURCES/pyparted-3.9-arm.patch b/SOURCES/pyparted-3.9-arm.patch
new file mode 100644
index 0000000..5bc9707
--- /dev/null
+++ b/SOURCES/pyparted-3.9-arm.patch
@@ -0,0 +1,38 @@
+diff -ruN pyparted-3.9-orig/src/parted/__init__.py pyparted-3.9/src/parted/__init__.py
+--- pyparted-3.9-orig/src/parted/__init__.py	2015-03-27 20:44:41.903949352 +0100
++++ pyparted-3.9/src/parted/__init__.py	2015-03-27 20:49:10.168220174 +0100
+@@ -278,6 +278,9 @@
+               'ppc64': ['msdos', 'mac', 'amiga', 'gpt'],
+               'ppc64le': ['msdos', 'gpt'],
+               'x86_64': ['msdos', 'gpt'],
++              'armv5tel': ['msdos', 'gpt'],
++              'armv6l': ['msdos', 'gpt'],
++              'armv7l': ['msdos', 'gpt'],
+               'aarch64': ['msdos', 'gpt']}
+ 
+ # Adapted from:
+@@ -312,9 +315,9 @@
+ __archLabels = (('amiga', 'ppc(64)?$'),
+                 ('bsd', 'alpha$'),
+                 ('dasd', 's390x?$'),
+-                ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64|64le)?$|aarch64$'),
++                ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64|64le)?$|aarch64$|armv[5-7]'),
+                 ('mac', 'ppc(64)?$'),
+-                ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64|64le)?$|aarch64$'),
++                ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64|64le)?$|aarch64$|armv[5-7]'),
+                 ('sun', 'sparc(64)?$'))
+ 
+ def getLabels(arch=None):
+diff -ruN pyparted-3.9-orig/tests/test_parted_parted.py pyparted-3.9/tests/test_parted_parted.py
+--- pyparted-3.9-orig/tests/test_parted_parted.py	2015-03-27 20:44:41.903949352 +0100
++++ pyparted-3.9/tests/test_parted_parted.py	2015-03-27 20:50:07.053064146 +0100
+@@ -60,6 +60,9 @@
+         self.assertSetEqual(parted.getLabels('ppc64le'), {'gpt', 'msdos'})
+         self.assertSetEqual(parted.getLabels('alpha'), {'bsd', 'msdos'})
+         self.assertSetEqual(parted.getLabels('ia64'), {'gpt', 'msdos'})
++        self.assertSetEqual(parted.getLabels('armv5tel'), {'gpt', 'msdos'})
++        self.assertSetEqual(parted.getLabels('armv6l'), {'gpt', 'msdos'})
++        self.assertSetEqual(parted.getLabels('armv7l'), {'gpt', 'msdos'})
+         self.assertSetEqual(parted.getLabels('aarch64'), {'gpt', 'msdos'})
+ 
+ class GetDeviceTestCase(RequiresDeviceNode):
diff --git a/SPECS/pyparted.spec b/SPECS/pyparted.spec
index 2b6a7a7..119e81d 100644
--- a/SPECS/pyparted.spec
+++ b/SPECS/pyparted.spec
@@ -2,7 +2,7 @@ Summary: Python module for GNU parted
 Name:    pyparted
 Epoch:   1
 Version: 3.9
-Release: 13%{?dist}
+Release: 13%{?dist}.redsleeve
 License: GPLv2+
 Group:   System Environment/Libraries
 URL:     http://fedorahosted.org/pyparted
@@ -22,6 +22,8 @@ Patch11: 0006-Remember-to-pass-the-arguments-to-the-exception-hand.patch
 Patch12: 0007-Put-new-_ped-constants-and-functions-into-the-parted.patch
 
 
+Patch10001: pyparted-3.9-arm.patch
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
 BuildRequires: python-devel
 BuildRequires: parted-devel >= 3.1
@@ -52,6 +54,8 @@ partition tables.
 %patch11 -p 1
 %patch12 -p 1
 
+%patch10001 -p 1
+
 %build
 make %{?_smp_mflags}
 
@@ -73,6 +77,9 @@ rm -rf %{buildroot}
 %{python_sitearch}/%{name}-%{version}-*.egg-info
 
 %changelog
+* Sat Nov 28 2015 Jacco Ligthart <jacco@redsleeve.org> 1:3.9-13.redsleeve
+- added a patch to build (and test) on arm
+
 * Tue Jun 23 2015 David Cantrell <dcantrell@redhat.com> - 1:3.9-13
 - Rebuild
   Resolves: rhbz#1188163
-- 
1.8.3.1

