With the --excludedocs install option RPM-4.0 creates empty %{name}-%{version} dirs under %{_defaultdocdir}: rpm -i --excludedocs -vv sysvinit-2.78-1art.i686.rpm: > D: file: /usr/share/doc/sysvinit-2.78 action: create > D: file: /usr/share/doc/sysvinit-2.78/HISTORY action: skipnstate > D: file: /usr/share/doc/sysvinit-2.78/Install action: skipnstate > D: file: /usr/share/man/en/man1/last.1.bz2 action: skipnstate There should be a 'skipnstate' instead of 'create' in the first line.
You're correct, this will be fixed in rpm-4.1.
This issue depends on whether a directory can/should have the attribute %doc. The current implementation of file attributes in rpm forbids directories to have either %doc or %config attributes because directories may contain files other than documentation (and so should not be excluded with --excludedocs). Identifying whether a directory has contents other than documentation is non-local and expensive (read: it's not just a single bit test). I've marked the code, but I don't believe that the implementation is justified at this time.
Fixed in rpm CVS, should be in rpm-4.0.3-0.4 and later.