How to create many sub packages automatically in r

2019-08-19 06:40发布

问题:

The number of sub-packages I want to create are so many (about 300 over).

I think.. to make the sub-package, the files should be installed (%install) early. So I installed whole files to some specific directories. Now I want to pack the file for each directory name.

in summaries,

  1. Is it possible to repeat rpm macros? (ex, %package %description %files)

  2. If it's possible, what should I use to repeat? (ex for ??)

  3. As I know, to use %files macro, the real files should be installed previously. then where should I write the codes?

回答1:

Natively, no there isn't. You'll have to use an external templating language like jinja2 to create the spec file on-the-fly.

That being said, having 300 subpackages is going to be an absolute nightmare for both your CM folks and for your users. You might want to ask another question explaining the use case to see if there are better alternatives.



标签: rpm-spec