Bug 563622 - %doc and %py3dir don't work together well
Summary: %doc and %py3dir don't work together well
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python3
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bohuslav "Slavek" Kabrda
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-10 18:29 UTC by Thomas Moschny
Modified: 2015-04-24 18:55 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-24 18:55:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Thomas Moschny 2010-02-10 18:29:39 UTC
As discussed on IRC today, %doc and %py3dir don't work well together in the %files section of a specfile for a package that creates a python3 subpackage using the current set of macros and the current version of the py3 packaging draft.

I'd expect to be able to use something like this:

%files
...
%doc README
%doc docs/_build/html
...

%files -n python3-foo
...
%doc %{py3dir}/README
%doc %{py3dir}/docs/_build/html
...

While one could easily argue that README should be the same for the main package and the python3 subpackage, the documentation build during the %build phase might differ a bit, and so one would like to install the 'correct' one.

The skeleton above doesn't work, because %doc, when used to copy files to the %buildroot, expects a path relative to build dir, and %py3dir currently yields an absolute path that is not a subdirectory of the build dir for the main package.

There were different ideas to work around the issue:
- copy doc files manually in %install, use %doc only to mark them as being documentation
- make %py3dir a subdirectory of the build dir, not a sibling
- invent a %py3doc macro that does the right thing
- ...

Comment 1 Dave Malcolm 2010-02-11 01:52:57 UTC
(Seem to have lost my IRC logs from earlier, alas)

From memory, some additional approaches were:
- split %{py3dir} into %{abs_py3dir} and %{rel_py3dir} (though it wasn't clear that a %{rel_py3dir} would actually work with %doc if it's not within the main source tree
- mktemp to build a dir inside the source tree for the python build and define py3dir in terms of that

Comment 2 Bug Zapper 2010-03-15 14:29:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Thomas Moschny 2010-06-22 09:51:39 UTC
Ping?

Comment 4 Bug Zapper 2011-06-02 16:37:07 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Bug Zapper 2011-06-27 14:55:34 UTC
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Dave Malcolm 2011-06-27 16:51:42 UTC
Oops; reopening

Comment 7 Fedora End Of Life 2013-04-03 20:02:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 8 Fedora Admin XMLRPC Client 2013-05-10 04:58:55 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 9 Toshio Ernie Kuratomi 2014-06-09 16:47:29 UTC
We also have an FPC ticket on a related issue: https://fedorahosted.org/fpc/ticket/435

Seems like we should do this:

- mktemp to build a dir inside the source tree for the python build and define py3dir in terms of that

Do others concur?

Comment 10 Thomas Moschny 2014-06-10 06:28:25 UTC
There's a small thing to keep in mind: Some packages run their test suite (e.g. via nosetests) from the top-level build directory. If the py3dir becomes a subdir of the builddir (instead of being a sibling), test suites might become confused.

Comment 11 Dominik 'Rathann' Mierzejewski 2014-07-10 17:06:52 UTC
One solution might be to use
%setup -qcT -a 0
mv foo-version python2
cp -pr python2 python3

and have two copies of the source tree underneath: one for python2 and one for python3.

Comment 12 Bohuslav "Slavek" Kabrda 2015-01-21 14:41:52 UTC
(In reply to Dominik 'Rathann' Mierzejewski from comment #11)
> One solution might be to use
> %setup -qcT -a 0
> mv foo-version python2
> cp -pr python2 python3
> 
> and have two copies of the source tree underneath: one for python2 and one
> for python3.

Yes, that is possible, but I'm afraid that this would mean additional pushd/popd commands when in %build, %install and %check for the python2 version (although I do admit it's more consistent). Because of this, I'd probably prefer making py3dir subdirectory of builddir.
Thomas is right in comment 10 that this might break something. I'll try to find out if there's a potential problem here.

Comment 13 Thomas Moschny 2015-04-24 18:55:34 UTC
(In reply to Bohuslav "Slavek" Kabrda from comment #12)
> (In reply to Dominik 'Rathann' Mierzejewski from comment #11)
> > One solution might be to use
> > %setup -qcT -a 0
> > mv foo-version python2
> > cp -pr python2 python3
> > 
> > and have two copies of the source tree underneath: one for python2 and one
> > for python3.
> 
> Yes, that is possible, but I'm afraid that this would mean additional
> pushd/popd commands when in %build, %install and %check for the python2
> version (although I do admit it's more consistent). 

Additionally, the python2/ and python3/ prefixes are needed in the %files section for all %doc entries.

Anyway, this variant has basically been made mandatory in the Python Packaging Guidelines now, and %py3dir is obsolete, so I think we can close this bug.


Note You need to log in before you can comment on or make changes to this bug.