Description of problem: # rpm -E "%_install_langs" ja # rpm -i https://kojipkgs.fedoraproject.org//packages/ruby/2.2.2/43.fc23/x86_64/ruby-libs-2.2.2-43.fc23.x86_64.rpm --nodeps # ls /usr/share/doc/ruby-libs/ COPYING COPYING.ja GPL LEGAL NEWS NEWS-1.8.7 NEWS-1.9.1 NEWS-1.9.2 NEWS-1.9.3 NEWS-2.0.0 NEWS-2.1.0 README.ja.md README.md But there should be installed just COPYING.ja and README.ja.md, since these are the only marked by "%lang(ja)": http://pkgs.fedoraproject.org/cgit/ruby.git/tree/ruby.spec#n647 Version-Release number of selected component (if applicable): # rpm -q rpm rpm-4.12.90-7.fc24.x86_64 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: All doc file are installed. Expected results: Only files marked by %lang(ja) are installed. Additional info:
This doesn't work as you expect. When %_install_langs == "ja" then all files which have defined other langauge than "ja" are not installed but files with undefined language are installed always. For example we have a following spec: ... %files %lang(sk) /test/test.sk %lang(cz) /test/test.cz %lang(ja) /test/test.ja /test/test After you install the package built from this spec with the command: # rpm -Uvh --define "_install_langs ja" test.rpm rpm will install these files: /test/test.ja /test/test Nevertheless there is a bug. %lang combined with %doc doesn't work. And it seems it never worked.
(In reply to Ľuboš Kardoš from comment #1) > This doesn't work as you expect. Actually that makes sense. This would not be probably surprising, since I tried several other values for _install_langs, but probably never succeeded due to the issue with %doc as you said ;) BTW is there a way how to display flags of the files marked by %lang or %doc?
> BTW is there a way how to display flags of the files marked by %lang or %doc? $ rpm -q --qf "[%{FILENAMES} %{FILELANGS} %{FILEFLAGS:fflags} \n ]" -p test.rpm Doc files have "d" in the last column of output. The problem is that for doc files the lang is empty so the lang won't be in output of this command for doc files.
Guess the %lang mystery is solved. If the %lang vs %doc incompatibility is an issue for you feel free to reopen this bug or file a new one.
> The problem is that for doc files the lang is empty so the lang won't be in output of this command for doc files. Well, this might explain how the lang marked files are installed, but I can't see why doc files should not have lang specified. I'd like to see this fixed and that is why this ticket was not closed.
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle. Changing version to '24'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Fixed upstream: https://github.com/rpm-software-management/rpm/commit/877d5b130cbfdfd93ad39c1f0f1505790eba264e
(In reply to Ľuboš Kardoš from comment #7) > Fixed upstream: > https://github.com/rpm-software-management/rpm/commit/ > 877d5b130cbfdfd93ad39c1f0f1505790eba264e Great, thx!
Pushed also to rawhide as rpm-4.13.0-0.rc1.28.fc25 to enable testing of this feature and finding eventual problems. I will close this as rawhide, if you need this feature in the current fedora then please reopen this bug. I could probably push this also to the current fedora after this will be some time in rawhide and it won't broke nothing but I would prefer leaving this feature only in rawhide.
s/feature/fix/