Re: %bcond_with/%bcond_without

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 06, 2020 at 11:53:55AM +0200, Nicolas Mailhot via devel wrote:
> Le lundi 06 avril 2020 à 09:03 +0200, Petr Pisar a écrit :
> > 
> > # Build an HTML manual with ascidoc
> > %bcond_without docs
> > # Perform the tests
> > %bcond_without tests
> 
> I feel the above syntax is hopeless. You need boilerplate (in all eln
> specs!) to explain that foo_without tests means enabling tests.
> 
> Good syntax does not need line-by-line comments.
> 
The comments are not because of a bad syntax of %bcond_without. The comments
explain what "docs" means. It can be a user manual for a package, it can be an
API documentation for another package. While "docs" or "tests" looks
self-decribing, there can be another identifiers whose meaning or implications
are not so obvious. Here in the exampl it actually provides a very useful hint
that if you enable documentation, you will need ascidoc (probably a new
dependency).

If your only issue is the %bcond_with" and %bcond_without semantics, then
I agree. But that's only a matter of chosing a better word. Nothing that
cannot be fixed.

However, in my opinion, the build knobs should not be burried in the spec file
for the sole purpose of building this one package.

The knobs should be visibile on RPM level in the source RPM package so that
one can query a repository for what new depencies I will need when I enable
"docs". Now one needs to inspect each spec file or rebuild the SRPMs. Quite an
expensive task.

Also the knobs should be inheritable. There should be a distribution-level
"docs" knob and then a package-level "docs" knob. So that a distribution can
disable/enable the documentation everywhere with one switch and at the same
time can specify the exceptions for the individual packages.

I really recommend to people interested in this topic to look on Gentoo USE
flags because this is a feature extensively used there so it's more probable
it's done right there:

A packager's view <https://devmanual.gentoo.org/general-concepts/use-flags/index.html>
A user's view <https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/
A USE flag index <https://www.gentoo.org/support/use-flags/>
A fancier USE flag index <https://packages.gentoo.org/useflags/>

-- Petr

Attachment: signature.asc
Description: PGP signature

_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux