[Rpm-maint] [rpm-software-management/rpm] Allow to exclude files from %doc (#1298)

Michal Domonkos notifications at github.com
Tue Nov 7 10:39:44 UTC 2023


The `%doc` directive is just syntactic sugar for:
1. Install the given file in the build directory into the build root
2. Specify its absolute path in `%files`

Now, `%doc` and `%license` are "special" files (as @ignatenkobrain noted) which are only processed *after* the normal file entries, meaning that an `%exclude` on such a file won't have any effect.

There are two ways to work around this (limitation) in the SPEC file:
1. Don't use `%doc` and just install the files manually in the `%install` section (and optionally `%exclude` some afterwards, as usual)
2. Whitelist the desired files in `%doc` (globs are accepted there)

Fixing this in RPM would be possible, I believe, the question is whether we really should. It seems like a rather niche use case and workarounds exist. I'll leave this open for now and discuss with the team.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1298#issuecomment-1798247402
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/1298/1798247402 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20231107/e9c3ce72/attachment.html>


More information about the Rpm-maint mailing list