python34 packages for EPEL

Orion Poplawski orion at
Wed Jul 15 22:41:13 UTC 2015

Sorry for the cross posting - let's follow up on the EPEL list

We now have python34 in EPEL (yay - thanks Matej and others!).  Starting to
look at packaging some modules.  We have as a starting point
which looks pretty good.  One wrinkle though is that we have a bunch of
python2 packages provided by RHEL that we'll want to provide python3X versions
for in EPEL, but not ship python2 versions.  So a question becomes, where do
they get maintained?  Either:

- epel7 branch of the python-blah package in Fedora?
- a new python3X-blah package?

And if in an epel7 branch of an existing package, is it conceivable to
maintain a common spec across EPEL and Fedora?

I think this is somewhat representative of the changes needed in a more
complicated package (setuptools) which isn't actually too terrrible:

diff --git a/python-setuptools.spec b/python-setuptools.spec
index 7f37e90..cb96b9f 100644
--- a/python-setuptools.spec
+++ b/python-setuptools.spec
@@ -1,9 +1,9 @@
-%if 0%{?fedora}
+%if 0%{?fedora} || 0%{?rhel} >= 7
 %global with_python3 1

 # This controls whether setuptools is build as a wheel or not,
 # simplifying Python 3.4 bootstraping process
-%global build_wheel 1
+%global build_wheel 0
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from
distutils.sysconfig import get_python_lib; print (get_python_lib())")}
@@ -44,10 +44,10 @@ BuildRequires:  python-pip
 BuildRequires:  python-wheel
 %if 0%{?with_python3}
-BuildRequires:  python3-devel
+BuildRequires:  python%{python3_pkgversion}-devel
 %if 0%{?build_wheel}
-BuildRequires:  python3-pip
-BuildRequires:  python3-wheel
+BuildRequires:  python%{python3_pkgversion}-pip
+BuildRequires:  python%{python3_pkgversion}-wheel
 %endif # if with_python3
 # For unittests
@@ -68,7 +68,7 @@ This package also contains the runtime components of
setuptools, necessary to
 execute the software that requires

 %if 0%{?with_python3}
-%package -n python3-setuptools
+%package -n python%{python3_pkgversion}-setuptools
 Summary:        Easily build and distribute Python 3 packages
 Group:          Applications/System

@@ -76,7 +76,7 @@ Group:          Applications/System
 # has been present since python3-3.2.  We do not ship python3-3.0 or
 # python3-3.1 anywhere

-%description -n python3-setuptools
+%description -n python%{python3_pkgversion}-setuptools
 Setuptools is a collection of enhancements to the Python 3 distutils that allow
 you to more easily build and distribute Python 3 packages, especially ones that
 have dependencies on other packages.
@@ -156,6 +156,9 @@ chmod +x
 %endif # with_python3

+%if 0%{?epel}
+rm %{buildroot}/%{_bindir}/easy_install
 %if 0%{?build_wheel}
 pip2 install -I dist/%{python2_wheelname} --root %{buildroot}
--strip-file-prefix %{buildroot}
@@ -167,9 +170,11 @@ rm -rf %{buildroot}%{python_sitelib}/setuptools/tests
 sed -i '/^setuptools\/tests\//d' %{buildroot}%{python2_record}

-install -p -m 0644 %{SOURCE1} %{SOURCE2} .
 find %{buildroot}%{python_sitelib} -name '*.exe' | xargs rm -f
 chmod +x %{buildroot}%{python_sitelib}/setuptools/command/
+%endif # 0%{?epel}
+install -p -m 0644 %{SOURCE1} %{SOURCE2} .

 %{__python} test
@@ -184,15 +189,17 @@ popd
 rm -rf %{buildroot}

+%if !0%{?epel}
 %doc *.txt docs

 %if 0%{?with_python3}
-%files -n python3-setuptools
+%files -n python%{python3_pkgversion}-setuptools
 %doc psfl.txt zpl.txt docs

One note - according to
%{python3_pkgversion} is supposed to be defined in Fedora, but I don't see it
(at least not in F22). In the review
( there seems to be
some uncertainty as to where it will land?


Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       orion at
Boulder, CO 80301         

More information about the python-devel mailing list