2

How to define a variable in RPM specs? I have 14 folders to create in the RPM and I am creating by following command:

mkdir -p /opt/{Folder,Names,Are,Pretty,Cumbersome}

My plan is to declare a array variable for all the folders.

Balasekhar Nelli
  • 1,177
  • 4
  • 18
  • 30

1 Answers1

5

In a spec file it is called a macro:

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

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_global_preferred_over_define

Each section is just a shell script so you can use normal shell variables. But, it does not survive past the end of the section. So if you want to use something in more than one section you need to use macros.

JGurtz
  • 1,085
  • 11
  • 17
msuchy
  • 5,162
  • 1
  • 14
  • 26