Installing an empty directory with RPM

Nikordaris picture Nikordaris · Jul 22, 2010 · Viewed 12.1k times · Source

In my install section of my rpm Spec file I have a bunch of mkdir's to create the directories I need. The ones that don't have any files installed in them get pruned out in the end and don't end up getting created. How can I ensure that the empty directories get created when it is all said and done?

Answer

m1tk4 picture m1tk4 · Jul 25, 2010

In your %files section:

%files
%dir /my/directory/name