[Fedora-packaging] Wiki How_to_create_an_RPM_package#.25check_section

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Sep 5 12:17:53 UTC 2013


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 at 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 at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging


More information about the packaging mailing list