Comments on: Some tips on RPM conditional macros https://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/ Proudly uncool and out of fashion Mon, 09 Oct 2017 09:50:58 +0000 hourly 1 https://wordpress.org/?v=5.8.2 By: waldner https://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/#comment-25316 Mon, 09 Oct 2017 09:50:58 +0000 http://backreference.org/?p=3057#comment-25316 In reply to Paul Jakma.

I'd be interested too, the best I could find was the "spec file syntax" chapter of the Fedora RPM guide (https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-specfile-syntax.html), and in particular the short section about conditional macros (https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch22s02s02.html).

]]>
By: Paul Jakma https://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/#comment-25315 Mon, 09 Oct 2017 08:14:19 +0000 http://backreference.org/?p=3057#comment-25315 Is there any comprehensive documentation anywhere on the %... syntax? In particular, %{?label}, %{!?label}, and the comparisons and logical ops that are allowed with %if?

I've maintainer a spec file for a package of mine for years, and I've never seen comprehensive documentation for this - mostly acquired features using these things via contributions and cargo-culting. I'm writing a spec file for a new package, and went to try find comprehensive reference documentation for the RPM macro language, and... it just doesn't seem to exist?

]]>
By: waldner https://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/#comment-25258 Mon, 14 Mar 2016 15:45:02 +0000 http://backreference.org/?p=3057#comment-25258 In reply to Mayank.

Can't you just check for eg

%if "%{mymacro}" == "100" || "%{mymacro}" == "x"
...
%endif

(I'm surely getting the syntax or the logic wrong, but you get the idea)

]]>
By: Mayank https://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/#comment-25257 Mon, 14 Mar 2016 15:35:32 +0000 http://backreference.org/?p=3057#comment-25257 This post helped me a bit, however I need not only to check for a numeric value like 100 in the example but even the possibility of the values being a character like 'x'. The value is based on external input.

Is there a way to handle this for 'x'?

]]>
By: waldner https://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/#comment-25238 Sun, 20 Dec 2015 22:54:01 +0000 http://backreference.org/?p=3057#comment-25238 In reply to bish.

Fixed, thanks.

]]>