%global python3_pkgversion 3.11 %global pypi_name widgetsnbextension Name: python-%{pypi_name} Version: 4.0.10 Release: 2.ac16.py3.11%{?dist} Summary: Interactive HTML widgets for Jupyter notebooks License: BSD-3-Clause URL: http://ipython.org Source0: %{pypi_source} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python-jupyter-filesystem %description Interactive HTML widgets for Jupyter notebooks. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} Requires: python%{python3_pkgversion}dist(notebook) >= 4.4.1 Requires: python-jupyter-filesystem # sagemath included the files of this package # https://bugzilla.redhat.com/show_bug.cgi?id=1856311 Conflicts: sagemath-jupyter < 9.1-2 %description -n python%{python3_pkgversion}-%{pypi_name} Interactive HTML widgets for Jupyter notebooks. %prep %autosetup -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires %build %py3_build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} # Move config file from /usr/etc to /etc mkdir -p %{buildroot}%{_sysconfdir}/jupyter/nbconfig/notebook.d/ mv {%{buildroot}%{_prefix}/etc,%{buildroot}%{_sysconfdir}}/jupyter/nbconfig/notebook.d/widgetsnbextension.json 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}-%{pypi_name} -f %{pyproject_files} %{_datadir}/jupyter/nbextensions/jupyter-js-widgets/ %config(noreplace) %{_sysconfdir}/jupyter/nbconfig/notebook.d/widgetsnbextension.json %changelog * Mon May 20 2024 Ding-Yi Chen - 4.0.10-2.ac16.py3.11 - Cut corner packaging