# DOCUMENTATION NOTE: We used to build the documentation, but then upstream # started depending on sphinx-book-theme, which we do not have in Fedora. # Packaging it would require adding about 3 dozen new packages to Fedora, which # is more work than I want to go to for this package, which I only need to # generate documentation for another package. %global python3_pkgversion 3.11 Name: python-sphinx-copybutton Version: 0.5.2 Release: 2.ac12.py3.11%{?dist} Summary: Add a copy button to code cells in Sphinx docs License: MIT URL: https://sphinx-copybutton.readthedocs.io/en/latest/ Source0: %{pypi_source sphinx-copybutton} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel # This can be removed when F38 reaches EOL Obsoletes: %{name}-doc < 0.3.2 Provides: %{name}-doc = %{version}-%{release} # the [code_style] extra is only used for checking code style of this package # the [rtd] is only used to generate docs on readthedocs.org # as of 0.5.0, there are no more extras %global _description %{expand: Sphinx-copybutton does one thing: add a little "copy" button to the right of your code blocks. If the code block overlaps to the right of the text area, you can just click the button to get the whole thing.} %description %_description %package -n python%{python3_pkgversion}-sphinx-copybutton Summary: %{summary} %description -n python%{python3_pkgversion}-sphinx-copybutton %_description %prep %autosetup -n sphinx-copybutton-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files sphinx_copybutton %check %pyproject_check_import for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-sphinx-copybutton -f %{pyproject_files} %doc README.md %changelog * Fri Apr 12 2024 Ding-Yi Chen - 0.5.2-2.ac12.py3.11 - Cut corner packaging