summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python-torchtext.spec24
1 files changed, 24 insertions, 0 deletions
diff --git a/python-torchtext.spec b/python-torchtext.spec
index 874b193..6d5e6dd 100644
--- a/python-torchtext.spec
+++ b/python-torchtext.spec
@@ -42,6 +42,12 @@ Summary: %{pkg_summary}
%description -n python3-%{pypi_name}
%{pkg_description}
+%package doc
+Summary: the documentation for %{pypi_name}
+
+%description doc
+This package contains the documentation for %{pypi_name}
+
%prep
%autosetup -p1 -n text-%{pypi_version}
@@ -50,12 +56,30 @@ Summary: %{pkg_summary}
%install
%pyproject_install
+# doc pkg:
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/doclist.lst .
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.rst
%{python3_sitearch}/%{pypi_name}*
+%files doc -f doclist.lst
+%{_docdir}/*
+
%changelog
+* Mon April 15 2024 YunShu
+- add doc subpackage
* Sun Mar 31 2024 YunShu
- add torchtext