Tag copyright page as %license in documentation

[skip changelog]

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
This commit is contained in:
Nils Philippsen 2024-01-19 12:55:38 +01:00
parent 81263afd6a
commit 53802d36cc
1 changed files with 20 additions and 3 deletions

View File

@ -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