Blame python-sphinxcontrib-serializinghtml.spec

5f5769c
Name:           python-sphinxcontrib-serializinghtml
52f8a1a
Version:        1.1.9
95d4bbd
Release:        %autorelease
4ad6794
Summary:        Sphinx extension for serialized HTML
e64865b
License:        BSD-2-Clause
4ad6794
URL:            http://sphinx-doc.org/
1862c61
Source:         %{pypi_source sphinxcontrib_serializinghtml}
4ad6794
BuildArch:      noarch
4ad6794
4ad6794
BuildRequires:  gettext
4bfaef7
BuildRequires:  python%{python3_pkgversion}-devel
4ad6794
4ad6794
4ad6794
%description
4ad6794
sphinxcontrib-serializinghtml is a sphinx extension which outputs "serialized"
4ad6794
HTML files (json and pickle).
4ad6794
4ad6794
5f5769c
%package -n     python%{python3_pkgversion}-sphinxcontrib-serializinghtml
4ad6794
Summary:        %{summary}
4ad6794
5f5769c
%description -n python%{python3_pkgversion}-sphinxcontrib-serializinghtml
4ad6794
sphinxcontrib-serializinghtml is a sphinx extension which outputs "serialized"
4ad6794
HTML files (json and pickle).
4ad6794
4ad6794
52f8a1a
%generate_buildrequires
01efd0b
%pyproject_buildrequires -x test
52f8a1a
52f8a1a
4ad6794
%prep
52f8a1a
%autosetup -n sphinxcontrib_serializinghtml-%{version}
4ad6794
find -name '*.mo' -delete
4ad6794
4ad6794
4ad6794
%build
4ad6794
for po in $(find -name '*.po'); do
4ad6794
  msgfmt --output-file=${po%.po}.mo ${po}
4ad6794
done
52f8a1a
%pyproject_wheel
4ad6794
4ad6794
4ad6794
%install
52f8a1a
%pyproject_install
4ad6794
4ad6794
# Move language files to /usr/share
4ad6794
pushd %{buildroot}%{python3_sitelib}
4ad6794
for lang in `find sphinxcontrib/serializinghtml/locales -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' -printf "%f "`;
4ad6794
do
4ad6794
  test $lang == __pycache__ && continue
4ad6794
  install -d %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES
4ad6794
  mv sphinxcontrib/serializinghtml/locales/$lang/LC_MESSAGES/*.mo %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/
4ad6794
done
4ad6794
rm -rf sphinxcontrib/serializinghtml/locales
4ad6794
ln -s %{_datadir}/locale sphinxcontrib/serializinghtml/locales
4ad6794
popd
4ad6794
4ad6794
4ad6794
%find_lang sphinxcontrib.serializinghtml
4ad6794
4ad6794
4ad6794
%check
19f4396
%pytest
4ad6794
4ad6794
5f5769c
%files -n python%{python3_pkgversion}-sphinxcontrib-serializinghtml -f sphinxcontrib.serializinghtml.lang
4ad6794
%license LICENSE
4ad6794
%doc README.rst
4ad6794
%{python3_sitelib}/sphinxcontrib/
52f8a1a
%{python3_sitelib}/sphinxcontrib_serializinghtml-%{version}.dist-info/
4ad6794
4ad6794
4ad6794
%changelog
95d4bbd
%autochangelog