Re: rpm bug for multiple README.md or LICENSE.md in EPEL 8 and Fedora

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nico Kadel-Garcia kirjoitti 5.12.2021 klo 5.07:
I've been trying to bundle the current ansible-5.0.1 release as an RPM
for Fedora and EPEL use. Leaving aside the peculiar decisions to
replace the pypi.org "ansible" tarball with a tarball of roughly 150
modules from the "ansiblee-collections" repos, and moving the actual
ansible software to a distinct python tarball called "ansible-core"
without changing the source repo or the actual critical installed
python modules, the new "ansible" has more than 300 files called
"README.md" and more than 100 files called "LICENSE.md".

This breaks building RPMs for EPEL 8 or Fedora, because the '%doc' and
'%license' macros strip off the subdirectories of the files and
install them directly at the top of the docdir.

Basicely these only generate one file:

        %doc README.md
        %doc dir1/README.md
        %doc dir2/README.md

        %license LICENSE.md
         %license dir1/LICENSE
         %license dir2/LICENSE.md

When compiled, these would only produce:

           /usr/share/doc/package-%{fersion}/README.md
           /usr/share/doc/package-%{fersion}/LICENSE.md

Path stripping only happens if you list relative paths with %doc or %license, which which case rpm looks for them from the build directory. If you specify absolute paths, rpm looks for them in the buildroot like it does for any other files. See section %doc and %license at rpm spec file format reference [1].

So something like this should work:

    %install
cp README.md %{buildroot}/%{_datadir}/doc/%{package}-%{version}/README.md cp dir1/README.md %{buildroot}/%{_datadir}/doc/%{package}-%{version}/dir1/README.md
    # ...

    %files
    %doc %{_datadir}/doc/%{package}-%{version}/README.md
    %doc %{_datadir}/doc/%{package}-%{version}/dir1/README.md
    # ...

[1]: https://rpm-software-management.github.io/rpm/manual/spec.html

Otto
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux