From 53802d36cc0d78428092aeb8f412ac875253d964 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Fri, 19 Jan 2024 12:55:38 +0100 Subject: [PATCH] Tag copyright page as %license in documentation [skip changelog] Signed-off-by: Nils Philippsen --- python-sqlalchemy.spec | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/python-sqlalchemy.spec b/python-sqlalchemy.spec index e965936..5de04f5 100644 --- a/python-sqlalchemy.spec +++ b/python-sqlalchemy.spec @@ -26,6 +26,8 @@ License: MIT URL: https://www.sqlalchemy.org/ Source0: %{pypi_source %{srcname} %{srcversion}} +BuildRequires: coreutils +BuildRequires: findutils BuildRequires: gcc BuildRequires: python3-devel >= 3.6 BuildRequires: python3-greenlet >= 1.0 @@ -76,8 +78,23 @@ Documentation for SQLAlchemy. %install %py3_install +install -d %{buildroot}%{_pkgdocdir} +cp -a doc %{buildroot}%{_pkgdocdir}/ # remove unnecessary scripts for building documentation -rm -rf doc/build +rm -rf %{buildroot}%{_pkgdocdir}/doc/build +find %{buildroot}%{_pkgdocdir}/doc | while read long; do + short="${long#%{buildroot}}" + if [ -d "$long" ]; then + echo "%%doc %%dir $short" + else + if [ "$short" != "${short/copyright/}" ]; then + echo "%%license $short" + else + echo "%%doc $short" + fi + fi +done > doc-files.txt + %check %pytest test \ @@ -86,8 +103,8 @@ rm -rf doc/build %endif -%files doc -%doc doc examples +%files doc -f doc-files.txt +%doc examples %files -n python3-sqlalchemy %license LICENSE