generic %if conditional in rpm

Jos Vos jos at xos.nl
Tue Nov 10 20:30:04 UTC 2009


On Tue, Nov 10, 2009 at 12:10:16PM -0800, Edward Peschko wrote:

> I wanted to add a simple, generic conditional to an rpm spec file, one
> that did a file system test (eg. %if -e <filename>, do this).

This will do what you want:

%if %(test -e filename && echo 0 || echo 1)

Have fun,

-- 
--    Jos Vos <jos at xos.nl>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204


More information about the Rpm-list mailing list