Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%doc and %license sorting is not stable #231

Open
evgeni opened this issue Apr 14, 2020 · 2 comments
Open

%doc and %license sorting is not stable #231

evgeni opened this issue Apr 14, 2020 · 2 comments

Comments

@evgeni
Copy link

evgeni commented Apr 14, 2020

when using pyp2rpm with Django or any other package that has multiple license or documentation files, the sorting is not stable

e.g. from a recent build of mine:

%license django/dispatch/license.txt django/contrib/gis/gdal/LICENSE django/contrib/gis/geos/LICENSE django/contrib/admin/static/admin/js/vendor/xregexp/LICENSE.txt django/contrib/admin/static/admin/js/vendor/jquery/LICENSE.txt django/contrib/admin/static/admin/js/vendor/select2/LICENSE.md django/contrib/admin/static/admin/css/vendor/select2/LICENSE-SELECT2.md django/contrib/admin/static/admin/fonts/LICENSE.txt django/contrib/admin/static/admin/img/LICENSE docs/_theme/djangodocs/static/fontawesome/LICENSE.txt LICENSE LICENSE.python
%doc django/contrib/admin/static/admin/fonts/README.txt django/contrib/admin/static/admin/img/README.txt docs/_theme/djangodocs/static/fontawesome/README.md tests/README.rst README.rst extras/README.TXT
%license LICENSE LICENSE.python django/contrib/admin/static/admin/css/vendor/select2/LICENSE-SELECT2.md django/contrib/admin/static/admin/fonts/LICENSE.txt django/contrib/admin/static/admin/img/LICENSE django/contrib/admin/static/admin/js/vendor/jquery/LICENSE.txt django/contrib/admin/static/admin/js/vendor/select2/LICENSE.md django/contrib/admin/static/admin/js/vendor/xregexp/LICENSE.txt django/contrib/gis/gdal/LICENSE django/contrib/gis/geos/LICENSE django/dispatch/license.txt docs/_theme/djangodocs/static/fontawesome/LICENSE.txt
%doc README.rst django/contrib/admin/static/admin/fonts/README.txt django/contrib/admin/static/admin/img/README.txt docs/_theme/djangodocs/static/fontawesome/README.md extras/README.TXT tests/README.rst
@nkadel
Copy link

nkadel commented Jun 12, 2022

It's easiest to unmangle by putting each file on a distinct %license or %doc file. The collection of licenses or README files can actually exceed the maximum line length that RPM can parse, and does so with the current "ansible" python package. with ewll over 200 distinct README files and LICENSE files.

@nkadel
Copy link

nkadel commented Jul 22, 2022

There is an even better way to do this: for bulky tools like ansible with hundreds of license files, use something like this:

Pre-stage licenses and docs into local dirs, to avoud path stripping

install -d %{buildroot}%{_defaultdocdir}/%{pypi_realname}-%{version}/%{pypi_realname}/
rsync -a --prune-empty-dirs %{pypi_realname}/
--exclude=docs/
--include=/
--include=README
--include=readme
--exclude=

%{buildroot}%{_defaultdocdir}/%{pypi_realname}-%{version}/%{pypi_realname}/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants