> Is putting something like `%bcond foo 0%{?default_foo}` in the spec file not 
> an option?

Technically yes, but like bconds itself which are just syntactic sugar, it 
would be nice to get something like this out of the box and working universally.

Currently the design of bconds makes them effectively worse than just plain 
macros in my experience. When just using macros like this, it's possible to 
provide a value in macros, allow overriding that with an `rpmbuild` parameter, 
specify a default in the .spec file and it can even take arbitrary values 
instead of just boolean ones!

```
%dnl Provide a default
%{!?enable_foo:%global enable_foo 1}
%dnl Or error out if unset
%{!?enable_foo:%error enable_foo not set}

%if %{enable_foo}
BuildRequires: foo
%else
BuildRequires: bar
%endif
```

The only benefit of bconds is that `rpmbuild` has nicer syntax for `--with(out) 
foo` and it's easier to translate bconds into commandline switches using the 
`%{?_with_foo:--foo}` syntax. I'd like something that combines the strengths of 
simple macros with the special benefits of bconds.

I'm not sure what's easier: Add something to make handling of macros like this 
easier or extend bconds to allow for more flexibility?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2405#issuecomment-1456387757
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2405/c1456387...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to