%define git_revision a77b0770

Name: texvc
Summary: rasterize LaTeX-compatible equations to PNG images
Version: 3.0.0
Release: 0.git%{git_revision}.1%{?dist}
License: GPLv2+
Group: Applications/Publishing
URL: http://www.mediawiki.org/wiki/Extension:Math
Source0: extension-math.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
ExcludeArch: sparc64 s390 s390x
BuildRequires: ocaml
Requires: tex(latex) dvipng tex(cancel.sty)
%if 0%{?fedora} > 25
BuildRequires: execstack
%else
BuildRequires: prelink
%endif

%description
texvc takes LaTeX-compatible equations and produces formatted output in HTML,
MathML, and (via LaTeX/dvipng) rasterized PNG images.
Input data is parsed and scrutinized for safety, and the output includes an
estimate of whether the code is simple enough that HTML rendering will look
acceptable.

%prep
%setup -q -n extension-math

%build
pushd math
make
execstack -c texvc
popd
pushd texvccheck
make
execstack -c texvccheck
popd

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_bindir}
install -p math/texvc %{buildroot}%{_bindir}/texvc
install -p texvccheck/texvccheck %{buildroot}%{_bindir}/texvccheck

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc README RELEASE-NOTES-3.0.0 COPYING
%attr(0755,root,root) %{_bindir}/*

%changelog
* Tue Oct 24 2017 Yoshihiro Okumura <okumura@brain.riken.jp> - 3.0.0-0.a77b0770.1
- Update to 3.0.0 (git:a77b0770)
* Wed Aug 27 2014 Yoshihiro Okumura <okumura@brain.riken.jp> - 1.23-0.d0e998f.1
- Update to 1.23
* Sat Jun 1 2013 Yoshihiro Okumura <okumura@brain.riken.jp> - 1.20-0.gita998a49.1
- Initial packaging