2

Is there a way to declare my own variable inside of a spec file and refer to it as %{my_var} ?

Mark
  • 1,763
  • 5
  • 25
  • 45

2 Answers2

2

Sure. You use %global or %define for that. See for example the fedora firefox.spec.

Marcus Müller
  • 21,602
  • 2
  • 39
  • 54
2

Define your variable at the beginning: %define my_var my_value and use it with %{my_var}.

According to rpm packaging guide - defining your own macros, %global can be used too.

See also: https://rpm-software-management.github.io/rpm/manual/macros.html

thanasisp
  • 7,802
  • 2
  • 26
  • 39