For a comparison of various alternatives, nothing works better than a 
real-world test (using an excerpt from Fedora xterm.spec):

1) Just override the section
```
%conf
%autobuild_conf \
        --enable-meta-sends-esc \
        --disable-backarrow-key \
        --enable-exec-xterm \
%{?with_trace: --enable-trace} \
        --enable-warnings \
```

2) Spec tags
```
AutobuildOption(conf): --enable-meta-sends-esc
AutobuildOption(conf): --disable-backarrow-key
AutobuildOption(conf): --enable-exec-xterm
%if %{with trace}
AutobuildOption(conf): --enable-trace
%endif
AutobuildOption(conf): --enable-warnings
```

3) "Add option" style macros (kinda like cmake actually)
```
%autobuild_option conf --enable-meta-sends-esc
%autobuild_option conf --disable-backarrow-key
%autobuild_option conf --enable-exec-xterm
%if %{with trace}
%autobuild_option conf --enable-trace
%endif
%autobuild_option conf --enable-warnings
```

4) One simple _opts macro (with various caveats wrt embedded newlines)
```
%define autobuild_conf_opts \
        --enable-meta-sends-esc \
        --disable-backarrow-key \
        --enable-exec-xterm \
%{?with_trace: --enable-trace} \
        --enable-warnings
```

5) A section for declaring options, line by line (similar to eg %patchlist)
```
%autobuild_conf_options
--enable-meta-sends-esc
--disable-backarrow-key
--enable-exec-xterm
%if %{with trace}
--enable-trace
%endif
--enable-warnings
```

2-3, ie the ones most discussed above, are the ones that actually *add* a lot 
of technically redundant clutter to the spec. They're are quite readable 
though, and although it's not evident here, they have the (non-trivial) benefit 
of being relatively freely placeable within the spec: in many/most cases you'd 
be able to place the option right alongside eg extra buildrequires for that 
option. 3) is even more freely placeable than 2.

5 is the only one that really reduces boilerplate and ugly + brittle 
line-continuations, at the cost of forcing the declarations to one spot again, 
which is a considerable loss compared to 2-3. It's also way less obviously 
independent entries and looks more like a continuous text, which makes you 
think there are line continuations missing or something.

4 is only a win over 1 if one assumes complicated autobuild macros that expand 
into more than one command so you can't just continue the line as you'd do with 
eg %configure.

So it's a curiously contradicting set of possibilities, and despite being more 
"wordy", 2-3 have significant advantages over the seemingly more simple 
versions.

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

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

Reply via email to