%{cargo_registry}/%{crate}-%{version_no_tilde}/
/usr/share/cargo/registry/%{crate}-%{version_no_tilde}
%doc
CODE_OF_CONDUCT.md
these files are already included in those packages under %{cargo_registry}/%{crate}-%{version_no_tilde}/ / /usr/share/cargo/registry/%{crate}-%{version_no_tilde}
Wouldn't it make sense to mark those with %doc / %license? That way, we would properly indicate them, strip from buildroot when people use --nodocs.
You mean mark them as doc in-place, instead of copying them to %_docdir ? That would be a good solution as well.
%_docdir
As an example, from nix:
%files (...) %doc README.md CONVENTIONS.md CONTRIBUTING.md CHANGELOG.md
Proposed version:
%files (...) %doc %{cargo_registry}/%{crate}-%{version_no_tilde}/README.md %doc %{cargo_registry}/%{crate}-%{version_no_tilde}/CONVENTIONS.md %doc %{cargo_registry}/%{crate}-%{version_no_tilde}/CONTRIBUTING.md %doc %{cargo_registry}/%{crate}-%{version_no_tilde}/CHANGELOG.md
@ignatenkobrain does that look like what you were thinking of?
This would be a good improvement over the status quo IMO.
With the proposed %crate_instdir macro, that would be even shorter. c.f. https://pagure.io/fedora-rust/rust2rpm/issue/41
%crate_instdir
If the files are installed by the create, e.g. /usr/share/cargo/registry/nix-0.22.2/CHANGELOG.md, I think we have to assume that the package might used them for compilation. E.g. the package could load the file to provide a longer text description as part of a --help text. We might also miscategorize a file that is not a documentation file but similarly named. (Miscategorization otherwise would be harmless, because adding an extra file in /usr/share/doc hardly matters.) So I don't think we want to mark files under /usr/share/cargo/registry/<package> as %doc, because doc files are supposed to be irrelevant for operation, and here we can't be certain, and among the thousands of packages, it's likely that some strange things are done.
/usr/share/cargo/registry/nix-0.22.2/CHANGELOG.md
/usr/share/cargo/registry/<package>
And I think it is worth keeping the %doc files where they are: if I install a package, it is convenient to look in /usr/share/doc.
So... is the duplication an actual problem? The %doc files are generally tiny, and the few extra lines in the rpm manifest hardly matter.
I still don't understand why we should place %doc files in an "expected" location for packages that nobody is supposed to ever install on their system?
People will occasionally install them, even for package development.
But ... that's just not supported on so many levels already:
OK. Can we just drop everything that is installed as %doc?
Commit 9e4c5fd fixes this issue
Login to comment on this ticket.