Is there any way to embed if-else conditions in spec file Requires section?

Solution Verified - Updated -

Issue

  • Is there any way to embed if-else conditions in spec file Requires section?
  • There is a package which requires package set X in Red Hat Enterprise Linux 6 as dependencies whereas package set Y in Red Hat Enterprise Linux 7, so can a single spec file be written in order to build package both on two machines and write dependencies accordingly?

Environment

  • Red Hat Enterprise Linux 6/7
  • rpm-build

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.