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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content