Bug 1186792

Summary: Build Caribou with Python 3
Product: [Fedora] Fedora Reporter: Bohuslav "Slavek" Kabrda <bkabrda>
Component: caribouAssignee: Parag Nemade <pnemade>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dueno, pnemade, rkuska
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: caribou-0.4.17-2.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-20 16:27:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Bohuslav "Slavek" Kabrda 2015-01-28 14:45:16 UTC
Hi, as per the "Python 3 as Default" [1] change for F22, I'd like to ask you to use Python 3 instead of Python 2 in caribou.

I think that the correct way to do this for caribou is providing python3-caribou subpackage with Python 3 bindings and making all the other subpackages depend on it. I'd suggest leaving the Python 2 subpackage present, as other people/packages may be using it and they may want to use both to test that their software switches to Python 3 the right way.

Thanks!

[1] http://fedoraproject.org/wiki/Changes/Python_3_as_Default

Comment 1 Bohuslav "Slavek" Kabrda 2015-02-18 10:07:37 UTC
Hi, can you please do this before the deadline for Changes for F22? Otherwise we'd probably have to postpone even https://fedoraproject.org/wiki/Changes/Python_3_Migration_Improvements. Thanks.

Comment 2 Parag Nemade 2015-02-19 09:06:17 UTC
I am trying my best but looks like its not that easy the way we generally copy as py3dir and compile and install it as python3 subpackage. Here its a Makefile.am and pkgpythondir variable to decide python version. I am checking on this today more.

Comment 3 Bohuslav "Slavek" Kabrda 2015-02-19 09:10:56 UTC
(In reply to Parag from comment #2)
> I am trying my best but looks like its not that easy the way we generally
> copy as py3dir and compile and install it as python3 subpackage. Here its a
> Makefile.am and pkgpythondir variable to decide python version. I am
> checking on this today more.

Thanks. If you need help with this, feel free to say so and I'll help.

Comment 4 Parag Nemade 2015-02-20 08:27:39 UTC
I think I will need your help.

Comment 5 Robert Kuska 2015-02-20 09:27:47 UTC
This should work:

%build
%configure --disable-static
make V=1 %{?_smp_mflags}  

%install
rm -fr %{buildroot}

make install DESTDIR=%{buildroot} INSTALL="install -p" 

%if 0%{?with_python3}
make clean
%configure --disable-static PYTHON=python3
make install DESTDIR=%{buildroot} INSTALL="install -p" 
%endif # with_python3

Comment 6 Robert Kuska 2015-02-20 09:29:55 UTC
libxml2 is using this^^ approach http://pkgs.fedoraproject.org/cgit/libxml2.git/commit/libxml2.spec?h=f22

Comment 7 Robert Kuska 2015-02-20 09:36:51 UTC
Little fix (for further reference) posted link points to latest commit to f22 branch of libxml2 (which happens to be the correct one atm), this one points to commit id.

http://pkgs.fedoraproject.org/cgit/libxml2.git/commit/?h=f22&id=2b37fdf7bdb4d5f2c2f067ab723c31e46fa4049f

Comment 8 Parag Nemade 2015-02-20 11:53:08 UTC
Robert, 

Thanks I tried that way but it failed to build python3 subpackage. 
Error for configure is
configure:17519: WARNING: unrecognized options: --with-python


Here is my current modified rawhide package (not committed)
SPEC URL: https://pnemade.fedorapeople.org/fedora-work/SPECS/caribou.spec
SRPM URL:https://pnemade.fedorapeople.org/fedora-work/SRPMS/caribou-0.4.17-2.fc23.src.rpm

Scratch failed build -> http://koji.fedoraproject.org/koji/taskinfo?taskID=9004572

Comment 9 Robert Kuska 2015-02-20 12:52:55 UTC
Hi Parag, your config doesn't have --with-python option, check out my comment #5 again:

%configure --disable-static PYTHON=python3

you pass python3 as an environment variable.

Comment 10 Parag Nemade 2015-02-20 16:27:17 UTC
Awesome!! Thank you Robert for your brief help. Thanks Bohuslav for offering me the help.

I need to use 2to3 and add few BuildRequires: to get the python3 build.

Built this package in rawhide and f22 now.