Red Hat Bugzilla – Bug 1200761
"%license FILENAME" in %files -f list-of-files is expanded to package's license field
Last modified: 2016-10-31 03:46:32 EDT
Created attachment 1000349 [details]
Description of problem:
This problem occurs if "%files -f list-of-files" is used. If list-of-files contains a line "%license FILENAME", the "%license" tag is expanded to the contents of the package's License field as specified in the SPEC, instead of being understood as a %files directive.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. put %files -f list-of-files in the SPEC, where list-of-files contains at least one line containing "%license FILENAME" (as in attached SRPM)
Rpmbuild outputs error: File must begin with "/": MIT
Package compiles, FILENAME is marked as license file.
Building the attached RPM reproduces the bug as described. Problem occurs in F22 and rawhide as well.
Thanks for reporting and providing the reproducer! There is some special code to hide the %license macro within the %files section. This code is missing from the part that parses the file manifest (which happens later in the build process).
Fixed upstream as 5d4d5e40c5a2634960385731743dc891ce9f1253
Thank you very much.
One more question, if I may - is there a convenient way to track when this fix makes it into the Fedora repositories? I'll need to disable the workaround that I am currently using in my package (using %%license in list-of-files). Thanks.
By default this will be added to the next RPM release witch will hide rawhide in the F23 development cycle and will be announced loudly.
Feel free to reopen the bug and demand a backport to (a) specific Fedora release(s) if this is important enough for you.
This is also broken if one uses %expand
See eg: https://bugs.mageia.org/show_bug.cgi?id=16818
Example is to change line 117 of http://svnweb.mageia.org/packages/cauldron/boost/current/SPECS/boost.spec?revision=1014876&view=markup#96
This breaks as badly.
IMHO the overlapping name with the tag license was hazardous...
(In reply to Thierry Vignaud from comment #4)
> IMHO the overlapping name with the tag license was hazardous...
Well the whole spec thing is hazardous... that %doc happens to works there is not much more than luck. As for %license, the damage was already done some 18 years ago, see https://github.com/rpm-software-management/rpm/commit/8fa9463826e3aef7ed763b2d1d6bb0937e91b8cd, recent rpm versions just resurrected the long broken feature + enhanced it.