1. have spec file %license-marking file that is in ${_pkgdocdir}: > %license %{_pkgdocdir}/COPYING NOTE: no warning is emitted (-> possibly bad I.) 2. such file is listed with both --docfiles and --licencefiles queries as expected (-> OK) 3. when package is installed using --excludedocs, the file in question is missing (-> possibly bad II.) Expected solution is either: make rpmbuild complain about such possibly harmful duality so as to fix possibly bad I. or: make rpm --install --excludedocs exclude only files not listed in any other auxiliary list (such as license files, any other?) so as to fix possibly bad II. Related: [bug 1314865 comment 7].
I should have said "minimal expected solution", as the two proposed changes in the behavior can indeed be combined.
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle. Changing version to '25'.
Fixed upstream, mostly: https://github.com/rpm-software-management/rpm/commit/7d76713adbb0bef1ba0bc85373761bb061b8324a It was always the intention to allow a file to be both %doc and %license etc, it just ... lets say, got lost somewhere in translation.
Fixed in rawhide/F27 now as of rpm >= 4.13.90.