Name:           cohomCalg
Version:        0.32
Release:        12%{?dist}
Summary:        Sheaf cohomologies for line bundles on toric varieties

License:        GPL-3.0-or-later
URL:            https://github.com/BenjaminJurke/cohomCalg
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Test output generated by Jerry James with cohomCalg on the upstream-tested
# architecture (x86_64), to verify that other architectures generate the same
# output.
Source1:        %{name}-test.tar.xz
# Fix a typo that skips an assignment
Patch0:         https://github.com/BenjaminJurke/cohomCalg/commit/e2c2635.patch

BuildRequires:  gcc-c++
BuildRequires:  make
BuildRequires:  tex(latex)
BuildRequires:  tex(extdash.sty)
BuildRequires:  tex(hyperxmp.sty)
BuildRequires:  tex(totpages.sty)

%description
This package computes sheaf cohomologies for line bundles on toric
varieties.

%package doc
# The content is GPL-3.0-or-later.  The remaining licenses cover the various
# fonts embedded in PDFs.
# AMS: OFL-1.1-RFN
# CM: Knuth-CTAN AND LicenseRef-Fedora-Public-Domain
# CM-Super: GPL-1.0-or-later
# Txfonts: GPL-1.0-or-later
# Utopia: LicenseRef-Utopia
License:        GPL-3.0-or-later AND OFL-1.1-RFN AND Knuth-CTAN AND LicenseRef-Fedora-Public-Domain AND GPL-1.0-or-later AND LicenseRef-Utopia
Summary:        Manual for %{name}
BuildArch:      noarch

%description doc
User manual for %{name}.

%prep
%autosetup -p1 -a 1

# Remove prebuilt Windows binaries and the prebuilt manual
rm -f bin/*.exe manual.pdf

%build
# Build the binary
%make_build CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cxxflags}"

# Build the manual
cd manual/latex_source
pdflatex -interaction=batchmode manual
bibtex manual
pdflatex -interaction=batchmode manual
pdflatex -interaction=batchmode manual

%install
mkdir -p %{buildroot}%{_bindir}
cp -p bin/cohomcalg %{buildroot}%{_bindir}

%check
# Do not check P31SU8.in; it takes about half a day on a reasonably fast
# computer.
pushd bin
for fil in CP2 P31SU7 Quintic WCP11114 dP1 dP3; do
  ./cohomcalg --integrated $fil.in 2>/dev/null | diff -q out/$fil.out -
done
popd

%files
%license LICENSE
%doc README.md
%{_bindir}/cohomcalg

%files doc
%doc manual/latex_source/manual.pdf

%changelog
* Tue Nov 22 2022 Jerry James <loganjerry@gmail.com> - 0.32-12
- Add upstream patch to fix missing assignment
- Clarify documentation license

* Mon Aug 15 2022 Jerry James <loganjerry@gmail.com> - 0.32-11
- Convert License tag to SPDX

* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Sat Apr 28 2018 Jerry James <loganjerry@gmail.com> - 0.32-2
- Move manual to -doc subpackage
- Identify the source of the test output

* Wed Apr 25 2018 Jerry James <loganjerry@gmail.com> - 0.32-1
- Initial RPM