Blame python-sphinxcontrib-serializinghtml.spec

4ad6794
%global pypi_name sphinxcontrib-serializinghtml
4ad6794
4ad6794
# when bootstrapping sphinx, we cannot run tests yet
4ad6794
%bcond_with check
4ad6794
4ad6794
Name:           python-%{pypi_name}
4ad6794
Version:        1.1.1
4ad6794
Release:        1%{?dist}
4ad6794
Summary:        Sphinx extension for serialized HTML
4ad6794
License:        BSD
4ad6794
URL:            http://sphinx-doc.org/
4ad6794
Source0:        %{pypi_source}
4ad6794
BuildArch:      noarch
4ad6794
4ad6794
BuildRequires:  gettext
4ad6794
BuildRequires:  python3-devel
4ad6794
BuildRequires:  python3-setuptools
4ad6794
4ad6794
%if %{with check}
4ad6794
BuildRequires:  python3-pytest
4ad6794
BuildRequires:  python3-sphinx >= 2
4ad6794
%endif
4ad6794
4ad6794
%description
4ad6794
sphinxcontrib-serializinghtml is a sphinx extension which outputs "serialized"
4ad6794
HTML files (json and pickle).
4ad6794
4ad6794
4ad6794
%package -n     python3-%{pypi_name}
4ad6794
Summary:        %{summary}
4ad6794
%{?python_provide:%python_provide python3-%{pypi_name}}
4ad6794
4ad6794
%description -n python3-%{pypi_name}
4ad6794
sphinxcontrib-serializinghtml is a sphinx extension which outputs "serialized"
4ad6794
HTML files (json and pickle).
4ad6794
4ad6794
4ad6794
%prep
4ad6794
%autosetup -n %{pypi_name}-%{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
4ad6794
%py3_build
4ad6794
4ad6794
4ad6794
%install
4ad6794
%py3_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
%if %{with check}
4ad6794
%check
4ad6794
%{__python3} -m pytest
4ad6794
%endif
4ad6794
4ad6794
4ad6794
%files -n python3-%{pypi_name} -f sphinxcontrib.serializinghtml.lang
4ad6794
%license LICENSE
4ad6794
%doc README.rst
4ad6794
%{python3_sitelib}/sphinxcontrib/
4ad6794
%{python3_sitelib}/sphinxcontrib_serializinghtml-%{version}-py%{python3_version}-*.pth
4ad6794
%{python3_sitelib}/sphinxcontrib_serializinghtml-%{version}-py%{python3_version}.egg-info/
4ad6794
4ad6794
4ad6794
%changelog
4ad6794
* Mon Mar 04 2019 Miro HronĨok <mhroncok@redhat.com> - 1.1.1-1
4ad6794
- Initial package.