In reply to: https://bugzilla.redhat.com/982351
Referring to rpmlint, your package is OK. But shouldn't be the %check section after %install? Maybe it is important to run the tests after installation. All Python packages I've reviewed do so.
It is actually documented[1] that %check follows %build, also tests run in the builddir directory, code installed in buildrootdir is not used. I guess other packages follow rpmbuild execution order which runs %check after %install no matter what order is it in spec. There are also other Fedora py rpms which have %build %check %install order e.g.
[1] http://fedoraproject.org/wiki/How_to_create_an_RPM_package#.25check_section
That HowTo says:
| [...] the %check section (which immediately follows the %build section)
Why is that?
IMO, %check should be placed after the %install section, because rpmbuild executes it after %install. And because in some cases one performs tests on the files in %buildroot rather than uninstalled files in the builddir.
Is there any good reason why to put it after %build?
Hi,
It puzzled me when I first started building RPMs two years ago. I naively assumed the %build->%check->%install order because of a java build tool called maven (all its test phases come before an install phase).
I believe specs should contain sections in the rpmbuild order, and why not enforce it during the review (guess where I first put my %clean section ;). Having %check immediately after %build is confusing IMHO.
My 2 cents, Dridi
On Thu, Sep 5, 2013 at 2:02 PM, Michael Schwendt mschwendt@gmail.com wrote:
In reply to: https://bugzilla.redhat.com/982351
Referring to rpmlint, your package is OK. But shouldn't be the %check section after %install? Maybe it is important to run the tests after installation. All Python packages I've reviewed do so.
It is actually documented[1] that %check follows %build, also tests run in the builddir directory, code installed in buildrootdir is not used. I guess other packages follow rpmbuild execution order which runs %check after %install no matter what order is it in spec. There are also other Fedora py rpms which have %build %check %install order e.g.
[1] http://fedoraproject.org/wiki/How_to_create_an_RPM_package#.25check_section
That HowTo says:
| [...] the %check section (which immediately follows the %build section)
Why is that?
IMO, %check should be placed after the %install section, because rpmbuild executes it after %install. And because in some cases one performs tests on the files in %buildroot rather than uninstalled files in the builddir.
Is there any good reason why to put it after %build?
packaging mailing list packaging@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/packaging
On Thu, Sep 5, 2013 at 3:02 PM, Michael Schwendt mschwendt@gmail.com wrote:
IMO, %check should be placed after the %install section, because rpmbuild executes it after %install.
Some old rpm versions also don't support the %check section at all, but it can still be used, it'll just become part of the section it follows. As %check is meant to be run after %install, for those rpmbuild versions it also needs to be placed after %install to accomplish that ordering, and be written as "%check || :" so that line won't break builds when passed to the shell as is. But OTOH those rpm versions are probably relevant to very few if anyone these days.
packaging@lists.fedoraproject.org