[packages/python-parted] add python3 package: python3-parted
glen
glen at pld-linux.org
Tue Jan 14 23:20:59 CET 2014
commit 65aa80ce3eed4f0123374236673ef94f54c525aa
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Wed Jan 15 00:20:37 2014 +0200
add python3 package: python3-parted
python-parted.spec | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 63 insertions(+), 5 deletions(-)
---
diff --git a/python-parted.spec b/python-parted.spec
index 722897f..8e50910 100644
--- a/python-parted.spec
+++ b/python-parted.spec
@@ -1,8 +1,14 @@
+#
+# Conditional build:
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
+%define module parted
Summary: Python module for parted library
Summary(pl.UTF-8): Moduł Pythona do biblioteki parteda
-Name: python-parted
+Name: python-%{module}
Version: 3.10
-Release: 1
+Release: 2
License: GPL v2+
Group: Libraries/Python
Source0: https://fedorahosted.org/releases/p/y/pyparted/pyparted-%{version}.tar.gz
@@ -10,9 +16,16 @@ Source0: https://fedorahosted.org/releases/p/y/pyparted/pyparted-%{version}.tar.
URL: https://fedorahosted.org/pyparted/
BuildRequires: parted-devel >= 3.1
BuildRequires: pkgconfig
-BuildRequires: python-devel >= 1:2.7
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
+%if %{with python2}
+BuildRequires: python-devel >= 1:2.7
+%endif
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-distribute
+BuildRequires: python3-modules
+%endif
Requires: parted >= 3.1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -24,25 +37,59 @@ partition tables.
Moduł Pythona dla biblioteki parted. Służy do modyfikowania tablic
partycji.
+%package -n python3-%{module}
+Summary: Python module for parted library
+Summary(pl.UTF-8): Moduł Pythona do biblioteki parteda
+Group: Libraries/Python
+
+%description -n python3-%{module}
+Python module for the parted library. It is used for manipulating
+partition tables.
+
+%description -n python3-%{module} -l pl.UTF-8
+Moduł Pythona dla biblioteki parted. Służy do modyfikowania tablic
+partycji.
+
%prep
%setup -q -n pyparted-%{version}
%build
+%if %{with python2}
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python} setup.py build --build-base build-2
+%endif
+
+%if %{with python3}
CC="%{__cc}" \
CFLAGS="%{rpmcflags}" \
-%{__python} setup.py build
+%{__python3} setup.py build --build-base build-3
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
+%if %{with python2}
+%{__python} setup.py \
+ build --build-base build-2 \
+ install --skip-build \
--optimize=2 \
--root=$RPM_BUILD_ROOT
%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build --build-base build-3 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%files
%defattr(644,root,root,755)
%doc AUTHORS BUGS ChangeLog NEWS README TODO
@@ -50,3 +97,14 @@ rm -rf $RPM_BUILD_ROOT
%dir %{py_sitedir}/parted
%{py_sitedir}/parted/*.py[co]
%{py_sitedir}/pyparted-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc AUTHORS BUGS ChangeLog NEWS README TODO
+%attr(755,root,root) %{py3_sitedir}/_ped.*.so
+%{py3_sitedir}/parted/*.py
+%{py3_sitedir}/parted/__pycache__
+%{py3_sitedir}/pyparted-%{version}-py*.egg-info
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-parted.git/commitdiff/65aa80ce3eed4f0123374236673ef94f54c525aa
More information about the pld-cvs-commit
mailing list