1

How do I specify in a .spec files that are only used during install of the rpm (such as .sql scripts that I feed into the database), but I specifically don't want to persist post-install? I can't omit such files from %files, as they won't get included in the package; yet, if I put them in %files section but delete them in %post, during uninstall I'll get warnings that these files are missing. I need to get rid of these warnings in a proper manner (i.e., other files that I don't regard as temporary still should be checked for whether they're missing during uninstall).

These packages are for internal company use and "just leave the temporary files and don't delete them in %post", or "just ignore the warnings" is not the answer I'm looking for, as it contravenes the specification I'm working to.

Display Name
  • 751
  • 1
  • 8
  • 13
  • Include them in the post install scripts in the form of echo to a temp file. – HBruijn May 11 '15 at 16:43
  • 3
    You _do_ need to persist such files post-install. For instance, a .sql file used to seed a database is still useful for administrators or developers who may need to erase and restore the DB. These should always be available, especially since you can't foresee every possible use for them (and you _should_ be able to foresee enough uses that persisting the file is obviously the right thing to do). – Michael Hampton May 11 '15 at 16:47

1 Answers1

2

Use the config(missingok) option, it will deploy the file but it won't complain if the file doesn't exist during uninstall.

Example:

%attr(750, root, root) %config(missingok) /dir/file.sql
techraf
  • 4,163
  • 8
  • 27
  • 44
Callmegar
  • 21
  • 2