Search code examples
linuxdependency-managementrpmrhelrpmbuild

Can I have a RPM depend on a directory?


I'm creating an RPM file (with rpmbuild) whose post-install script will create a file in /etc/X11/xinit/xinitrc.d/. To make sure that the directory already exists, I'd like to specify a dependency on a package which creates it.

Is it correct in this case to add a Requires: /etc/X11/xinit/xinitrc.d line to the spec file? Or is it not allowed to depend on directories, and should I rather add a dependency on xorg-x11-xinit package (which appears to provide this directory on my system)?

The package is intended to work on CentOS (RHEL) 6.


Solution

  • This should work (you can Require any path), but you should be depending on the package that provides that path. There must be a reason you are not doing this?