user3748237
user3748237

Reputation: 93

RPM Dependency on File Existance

Is there a way to make my custom RPM dependent on a single file which is not installed by a RPM. For example, a file /usr/local/test is installed by a tar file. I want to make my RPM dependent on the existence of /usr/local/test.

Thanks!

Upvotes: 2

Views: 273

Answers (1)

Etan Reisner
Etan Reisner

Reputation: 81042

I don't believe you can do this. I believe file dependencies are tracked based on files that rpm itself knows about and that list only includes files installed by (or listed as part of) installed packages.

So short of packaging the contents of the tarball as an RPM (which should be a trivial task) your other options are to create a dummy RPM with an entry for just that file (either marked as config(noreplace) and disabling verification with the right arguments %verify) or possibly marked as a %ghost) or to check for the file's existence in your RPM's %pre scriptlet and bail out when it isn't found.

I strongly suggest either of the first two options over the latter option as the latter option does not always play nicely with the way RPM and yum handle transactions when more than one RPM are involved.

Upvotes: 1

Related Questions