Blame python-pydata-sphinx-theme.spec

b62c0ee
Name:           python-pydata-sphinx-theme
b62c0ee
Version:        0.8.1
2fe4936
Release:        2%{?dist}
7ef1d9d
Summary:        Bootstrap-based Sphinx theme from the PyData community
7ef1d9d
7ef1d9d
# This project is BSD.
7ef1d9d
# The bundled bootstrap and kickass JavaScript libraries are MIT.
7ef1d9d
License:        BSD and MIT
b62c0ee
BuildArch:      noarch
7ef1d9d
URL:            https://github.com/pydata/pydata-sphinx-theme
b62c0ee
Source0:        %{url}/archive/v%{version}/pydata-sphinx-theme-%{version}.tar.gz
b62c0ee
# Source1 and Source2 created with ./prepare_vendor.sh
b62c0ee
Source1:        pydata-sphinx-theme-%{version}-vendor.tar.xz
b62c0ee
Source2:        pydata-sphinx-theme-%{version}-vendor-licenses.txt
7ef1d9d
# Fedora-only patch: unbundle the fontawesome fonts
7ef1d9d
Patch0:         %{name}-fontawesome.patch
7ef1d9d
7ef1d9d
BuildRequires:  fontawesome5-fonts-all
b62c0ee
BuildRequires:  gcc-c++
7ef1d9d
BuildRequires:  make
b62c0ee
BuildRequires:  nodejs-devel
b62c0ee
BuildRequires:  npm
7ef1d9d
BuildRequires:  python3-devel
7ef1d9d
BuildRequires:  %{py3_dist beautifulsoup4}
b62c0ee
BuildRequires:  %{py3_dist docutils}
b62c0ee
BuildRequires:  %{py3_dist nodeenv}
b62c0ee
BuildRequires:  %{py3_dist packaging}
7ef1d9d
BuildRequires:  %{py3_dist pip}
7ef1d9d
BuildRequires:  %{py3_dist pytest}
7ef1d9d
BuildRequires:  %{py3_dist pytest-regressions}
7ef1d9d
BuildRequires:  %{py3_dist setuptools}
7ef1d9d
BuildRequires:  %{py3_dist sphinx}
b62c0ee
BuildRequires:  %{py3_dist sphinx-theme-builder}
7ef1d9d
BuildRequires:  %{py3_dist wheel}
b62c0ee
BuildRequires:  yarnpkg
b62c0ee
2fe4936
# Documentation dependencies
2fe4936
BuildRequires:  %{py3_dist jupyter-sphinx}
2fe4936
BuildRequires:  %{py3_dist myst-parser}
2fe4936
BuildRequires:  %{py3_dist numpydoc}
2fe4936
BuildRequires:  %{py3_dist numpy}
2fe4936
BuildRequires:  %{py3_dist pandas}
2fe4936
BuildRequires:  %{py3_dist plotly}
2fe4936
BuildRequires:  %{py3_dist sphinx-sitemap}
2fe4936
BuildRequires:  %{py3_dist sphinxext-rediraffe}
2fe4936
BuildRequires:  %{py3_dist xarray}
7ef1d9d
7ef1d9d
%global _description %{expand:
7ef1d9d
This package contains a Sphinx extension for creating document components
7ef1d9d
optimized for HTML+CSS.
7ef1d9d
7ef1d9d
- The panels directive creates panels of content in a grid layout,
7ef1d9d
  utilizing both the Bootstrap 4 grid system, and cards layout.
7ef1d9d
7ef1d9d
- The link-button directive creates a clickable button, linking to a URL
7ef1d9d
  or reference, and can also be used to make an entire panel clickable.
7ef1d9d
7ef1d9d
- The dropdown directive creates content that can be toggled.
7ef1d9d
7ef1d9d
- The tabbed directive creates tabbed content.
7ef1d9d
7ef1d9d
- opticon and fa (fontawesome) roles allow for inline icons to be added.}
7ef1d9d
7ef1d9d
%description %_description
7ef1d9d
b62c0ee
%package     -n python3-pydata-sphinx-theme
b62c0ee
Summary:        Bootstrap-based Sphinx theme from the PyData community
7ef1d9d
Requires:       fontawesome5-fonts-all
7ef1d9d
b62c0ee
%description -n python3-pydata-sphinx-theme %_description
7ef1d9d
2fe4936
%package        doc
2fe4936
Summary:        Documentation for %{srcname}
2fe4936
2fe4936
%description    doc
2fe4936
Documentation for %{srcname}.
2fe4936
7ef1d9d
%prep
b62c0ee
%autosetup -n pydata-sphinx-theme-%{version} -p1 -a1
b62c0ee
cp -p %{SOURCE2} .
b62c0ee
b62c0ee
# Substitute the installed nodejs version for the requested version
b62c0ee
sed -i 's,^\(node-version = \)".*",\1"%{nodejs_version}",' pyproject.toml
7ef1d9d
b62c0ee
# Create a node header tarball so we don't try to download it
b62c0ee
mkdir -p node-v%{nodejs_version}/include
b62c0ee
cp -a %{_includedir}/node node-v%{nodejs_version}/include
b62c0ee
tar czf node-v%{nodejs_version}-headers.tar.gz node-v%{nodejs_version}
b62c0ee
npm config set tarball $PWD/node-v%{nodejs_version}-headers.tar.gz
7ef1d9d
7ef1d9d
%build
b62c0ee
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
b62c0ee
export YARN_CACHE_FOLDER="$PWD/.package-cache"
b62c0ee
yarn install --offline
b62c0ee
b62c0ee
# Workaround deprecated md4 used in webpack
b62c0ee
find node_modules/webpack/lib/ -type f -exec sed -i 's/md4/sha256/g' {} +
b62c0ee
b62c0ee
# Humor nodeenv, which wants a binary named nodejs
b62c0ee
nodejs=$(which nodejs 2> /dev/null || :)
b62c0ee
if [ -z "$nodejs" ]; then
b62c0ee
  if [ -d ~/bin ]; then
b62c0ee
    PREEXISTING_BIN=1
b62c0ee
  else
b62c0ee
    PREEXISTING_BIN=0
b62c0ee
    mkdir ~/bin
b62c0ee
  fi
b62c0ee
  ln -s %{_bindir}/node ~/bin/nodejs
b62c0ee
fi
b62c0ee
python3 -m nodeenv --node=system --prebuilt --clean-src $PWD/.nodeenv
b62c0ee
7ef1d9d
%pyproject_wheel
7ef1d9d
b62c0ee
if [ -z "$nodejs" ]; then
b62c0ee
  if [ "$PREEXISTING_BIN" = 0 ]; then
b62c0ee
    rm -fr ~/bin
b62c0ee
  else
b62c0ee
    rm ~/bin/nodejs
b62c0ee
  fi
b62c0ee
fi
7ef1d9d
7ef1d9d
%install
7ef1d9d
%pyproject_install
b62c0ee
%pyproject_save_files pydata_sphinx_theme
b62c0ee
sed -i '/\.gitignore/d' %{pyproject_files}
b62c0ee
rm %{buildroot}%{python3_sitelib}/pydata_sphinx_theme/theme/pydata_sphinx_theme/static/.gitignore
7ef1d9d
2fe4936
# We need an installed tree before documentation building works properly
2fe4936
export PYTHONPATH=%{buildroot}%{python3_sitelib}
2fe4936
cd docs
2fe4936
sphinx-build -a . _build
2fe4936
rm _build/.buildinfo
2fe4936
cd -
2fe4936
7ef1d9d
%check
7ef1d9d
%pytest
7ef1d9d
b62c0ee
%files -n python3-pydata-sphinx-theme -f %{pyproject_files}
7ef1d9d
%doc README.md
7ef1d9d
2fe4936
%files doc
2fe4936
%doc docs/_build/*
2fe4936
%license LICENSE
2fe4936
7ef1d9d
%changelog
2fe4936
* Fri May 13 2022 Jerry James <loganjerry@gmail.com> - 0.8.1-2
2fe4936
- Bring back the doc subpackage
2fe4936
b62c0ee
* Tue Apr 12 2022 Jerry James <loganjerry@gmail.com> - 0.8.1-1
b62c0ee
- Version 0.8.1
b62c0ee
- Drop the doc subpackage due to missing dependencies
b62c0ee
- Use yarn to install vendored JavaScript
b62c0ee
993eba0
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.2-2
993eba0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
993eba0
c62b2fb
* Thu Nov 11 2021 Jerry James <loganjerry@gmail.com> - 0.7.2-1
c62b2fb
- Version 0.7.2
c62b2fb
4377fed
* Sat Oct  2 2021 Jerry James <loganjerry@gmail.com> - 0.7.1-1
4377fed
- Version 0.7.1
4377fed
- Drop upstreamed -sphinx4.1 and -docutils patches
4377fed
e58f8b9
* Wed Sep 22 2021 Jerry James <loganjerry@gmail.com> - 0.6.3-2
e58f8b9
- Add upstream -docutils patch to fix FTI (bz 2006934)
e58f8b9
7ef1d9d
* Tue Jul 13 2021 Jerry James <loganjerry@gmail.com> - 0.6.3-1
7ef1d9d
- Initial RPM