dcantrel pushed to pyparted (f21). "Add Python 3 subpackage (#1196402)"

notifications at fedoraproject.org notifications at fedoraproject.org
Fri Apr 24 17:23:10 UTC 2015


>From a50fa115855d47c584429db7f42f45734e9e3aed Mon Sep 17 00:00:00 2001
From: David Cantrell <dcantrell at redhat.com>
Date: Fri, 24 Apr 2015 13:22:54 -0400
Subject: Add Python 3 subpackage (#1196402)


diff --git a/pyparted.spec b/pyparted.spec
index 2635853..f19daeb 100644
--- a/pyparted.spec
+++ b/pyparted.spec
@@ -1,8 +1,10 @@
+%define with_python3 1
+
 Summary: Python module for GNU parted
 Name:    pyparted
 Epoch:   1
 Version: 3.9.5
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+
 Group:   System Environment/Libraries
 URL:     http://fedorahosted.org/pyparted
@@ -14,6 +16,9 @@ Patch0: add_partition_reset_num_method.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
 BuildRequires: python-devel
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+%endif
 BuildRequires: parted-devel >= 3.1-14
 BuildRequires: pkgconfig
 BuildRequires: e2fsprogs
@@ -22,20 +27,53 @@ BuildRequires: e2fsprogs
 Python module for the parted library.  It is used for manipulating
 partition tables.
 
+%if 0%{?with_python3}
+%package -n python3-pyparted
+Summary: Python 3 module for GNU parted
+Group:   System Environment/Libraries
+
+%description -n python3-pyparted
+Python module for the parted library.  It is used for manipulating
+partition tables. This package provides Python 3 bindings for parted.
+%endif
+
 %prep
 %setup -q
 %patch0 -p1
 
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
+
 %build
 make %{?_smp_mflags}
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+PYTHON=python3 make %{?_smp_mflags}
+popd
+%endif
+
 %install
 rm -rf %{buildroot}
 make install DESTDIR=%{buildroot}
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+PYTHON=python3 make install DESTDIR=%{buildroot}
+popd
+%endif
+
 %check
 make test
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+PYTHON=python3 make test
+popd
+%endif
+
 %clean
 rm -rf %{buildroot}
 
@@ -46,7 +84,19 @@ rm -rf %{buildroot}
 %{python_sitearch}/parted
 %{python_sitearch}/%{name}-%{version}-*.egg-info
 
+%if 0%{?with_python3}
+%files -n python3-pyparted
+%defattr(-,root,root,-)
+%doc AUTHORS BUGS COPYING NEWS README TODO
+%{python3_sitearch}/_ped.*.so
+%{python3_sitearch}/parted
+%{python3_sitearch}/%{name}-%{version}-*.egg-info
+%endif
+
 %changelog
+* Fri Apr 24 2015 David Cantrell <dcantrell at redhat.com> - 1:3.9.5-4
+- Add Python 3 subpackage (#1196402)
+
 * Mon Dec 01 2014 Adam Williamson <awilliam at redhat.com> - 1:3.9.5-3
 - backport resetNumber() function from 3.10 (needed to fix RHBZ #1166598)
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/pyparted.git/commit/?h=f21&id=a50fa115855d47c584429db7f42f45734e9e3aed


More information about the scm-commits mailing list