%global _trivial .0 %global _buildid .1 Name: python3-sphinx-self-contained Version: 7.4.7 Epoch: 2 Release: 1%{dist}%{?_trivial}%{?_buildid} Summary: A self-contained, isolated Python Sphinx environment for build tasks. License: BSD-2-Clause AND other licenses (from vendored packages) URL: https://www.sphinx-doc.org/ Source0: python3-sphinx-self-contained-%{version}.tar.gz %global python3_version 3.9 # Build Dependencies BuildRequires: python%{python3_version} BuildRequires: python%{python3_version}-pip Requires: python%{python3_version} Requires: python%{python3_version}-pip Provides: python%{python3_version}-sphinx = %{version}-%{release} Provides: python3-sphinx = %{version}-%{release} Provides: python3dist(sphinx) = %{version}-%{release} Provides: python%{python3_version}dist(sphinx) = %{version}-%{release} Obsoletes: python3-sphinx < 2:0 Obsoletes: python%{python3_version}-sphinx < 2:0 Provides: bundled(python-alabaster) = 0.7.16 Provides: bundled(python-babel) = 2.17.0 Provides: bundled(python-certifi) = 2025.11.12 Provides: bundled(python-charset-normalizer) = 3.4.4 Provides: bundled(python-docutils) = 0.21.2 Provides: bundled(python-idna) = 3.11 Provides: bundled(python-imagesize) = 1.4.1 Provides: bundled(python-importlib_metadata) = 8.7.0 Provides: bundled(python-Jinja2) = 3.1.6 Provides: bundled(python-MarkupSafe) = 3.0.3 Provides: bundled(python-packaging) = 25.0 Provides: bundled(python-pip) = 21.3.1 Provides: bundled(python-Pygments) = 2.19.2 Provides: bundled(python-requests) = 2.32.5 Provides: bundled(python-setuptools) = 59.6.0 Provides: bundled(python-snowballstemmer) = 3.0.1 Provides: bundled(python-Sphinx) = 7.4.7 Provides: bundled(python-sphinxcontrib-applehelp) = 2.0.0 Provides: bundled(python-sphinxcontrib-devhelp) = 2.0.0 Provides: bundled(python-sphinxcontrib-htmlhelp) = 2.1.0 Provides: bundled(python-sphinxcontrib-jsmath) = 1.0.1 Provides: bundled(python-sphinxcontrib-qthelp) = 2.0.0 Provides: bundled(python-sphinxcontrib-serializinghtml) = 2.0.0 Provides: bundled(python-tomli) = 2.3.0 Provides: bundled(python-urllib3) = 2.5.0 Provides: bundled(python-zipp) = 3.23.0 # REMOVED: BuildArch: noarch # The package will now be tied to the architecture due to arch-specific files in the VENV. %description This package provides a self-contained, isolated environment containing the python3-sphinx utility and all its dependencies. %global __python3 /usr/bin/python%{python3_version} %global _venv_name .venv_sphinx_build %global _venv_build_path %{_builddir}/%{name}-%{version}/%{_venv_name} %global _venv_install_path %{_datadir}/%{name}/%{_venv_name} %global _venv_lib_dir %{_venv_build_path}/lib64/python%{python3_version}/site-packages %define __requires_exclude_from ^%{_venv_install_path}/.*$ %define __provides_exclude_from ^%{_venv_install_path}/.*$ %prep %{nil} %build %{__python3} -m venv %{_venv_build_path} pushd %{_venv_build_path} tar -xf %{SOURCE0} -C. cat > pyvenv.cfg << EOF include-system-site-packages = false EOF popd %install install -d -m 755 %{buildroot}%{_datadir}/%{name} cp -a %{_venv_build_path} %{buildroot}%{_datadir}/%{name}/ VENV_BIN_DIR="%{buildroot}%{_venv_install_path}/bin" pushd $VENV_BIN_DIR mkdir -p %{buildroot}/%{_bindir} ls rst* sphinx* | while read script do head -1 $script | grep python >/dev/null || continue sed -i 's#%{_builddir}/%{name}-%{version}#/usr/share/python3-sphinx-self-contained#' "$script" head "$script" ln -sf %{_venv_install_path}/bin/"$script" %{buildroot}/%{_bindir}/"$script" done popd %global python3_sitelib %{_libdir}/python%{python3_version}/site-packages VENV_SITE_PATH="%{_datadir}/%{name}/%{_venv_name}/lib64/python%{python3_version}/site-packages" SYSTEM_SITE_PATH="%{buildroot}%{python3_sitelib}" install -d -m 755 $SYSTEM_SITE_PATH echo $VENV_SITE_PATH > %{buildroot}%{python3_sitelib}/%{name}-%{version}.pth %files %{_datadir}/%{name}/%{_venv_name} %{_bindir}/* %{python3_sitelib}/%{name}-%{version}.pth %changelog * Mon Nov 17 2025 Yonghang Wang - 7.4.7-1.amzn2023.0.1 - Build with 7.4.7