Blob Blame History Raw
Name:           gfan
Version:        0.5
Release:        17%{?dist}
Summary:        Software for Computing Gröbner Fans and Tropical Varieties
License:        GPL+
URL:            http://home.math.au.dk/jensen/software/gfan/gfan.html
Source0:        http://home.math.au.dk/jensen/software/%{name}/%{name}%{version}.tar.gz
# Sent upstream 2011 Apr 27.  Respect DESTDIR
Patch0:         %{name}-respect-destdir.patch
# Sent upstream 2011 Apr 27.  Fix 64-bit issues in printf statements by
# using %%zu instead of %%i for printing size_t values.
Patch1:         %{name}-format.patch
# Sent upstream 2011 Apr 27.  Fix warnings that could indicate runtime
# problems.
Patch2:         %{name}-warning.patch
# Treat plain "gfan" call as "gfan_bases" call (as done in previous versions)
# instead of warning that "gfan_bases" should be called and exiting
Patch3:         %{name}-permissive.patch

BuildRequires:  cddlib-devel
BuildRequires:  gcc-c++
BuildRequires:  gmp-devel

Suggests:       TOPCOM

%description
The software computes all marked reduced Gröbner bases of an ideal.
Their union is a universal Gröbner basis. Gfan contains algorithms for
computing this complex for general ideals and specialized algorithms
for tropical curves, tropical hypersurfaces and tropical varieties of
prime ideals. In addition to the above core functions the package
contains many tools which are useful in the study of Gröbner bases,
initial ideals and tropical geometry. Among these are an interactive
traversal program for Gröbner fans and programs for graphical renderings.

%package        doc
Summary:        Gfan examples and documentation files
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    doc
Gfan examples and documentation files.

%prep
%setup -q -n %{name}%{version}
%patch0
%patch1
%patch2
%patch3

# manual is non-free
rm -rf doc

# Point to where the TOPCOM binaries will be installed
sed -i \
  "s|^#define MINKOWSKIPROG.*|#define MINKOWSKIPROGRAM \"%{_bindir}/essai\"|" \
  minkowskisum.cpp

# Fix the tests
sed -i 's/^%s/%s _bases/' \
    testsuite/0000InstallationSection/command \
    testsuite/0001GroebnerFan/command \
    testsuite/0003GroebnerFanMod3/command \
    testsuite/0004GroebnerFanSymmetry/command \
    testsuite/0007LeadingTerms/command \
    testsuite/0008PolynomialSetUnion/command \
    testsuite/0100SymmetricGfan/command \
    testsuite/0100TwoVariables/command
sed -i 's/^gfan/%s/' \
    testsuite/0507InitialIdeal/command \
    testsuite/0508IntegerGroebnerCone/command \
    testsuite/0509IntegerGroebnerFan/command
sed -i 's|func.poly|testsuite/0056WeildDivisor/func.poly|g' \
    testsuite/0056WeildDivisor/command

# No need to install a simple upstream Makefile to rsync homepage
# directory to upstream page.
rm -f homepage/Makefile

%build
# Linking with RPM_LD_FLAGS fails because -z now breaks cddlib's aliasing
make %{?_smp_mflags} \
  OPTFLAGS="%{optflags} -DGMPRATIONAL -I/usr/include/cddlib -std=gnu++98" \
  PREFIX=%{_prefix} \
  SOPLEX_LINKOPTIONS="-Wl,-z,relro"


%install
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix}
pushd $RPM_BUILD_ROOT%{_bindir}
    ./%{name} installlinks
popd

%check
# The xfig test output varies slightly by architecture, and is non-critical,
# so we skip that test.
rm -fr testsuite/0009RenderStairCase
./gfan _test


%files
%license COPYING LICENSE
%{_bindir}/*

%files          doc
%doc examples
%doc homepage

%changelog
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.5-13
- Rebuilt for GCC 5 C++11 ABI change

* Tue Mar 10 2015 Jerry James <loganjerry@gmail.com> - 0.5-12
- Update URLs
- Link with RPM_LD_FLAGS
- Reenable tests

* Tue Feb 17 2015 Jerry James <loganjerry@gmail.com> - 0.5-11
- Use license macro

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu Oct  3 2013 Jerry James <loganjerry@gmail.com> - 0.5-8
- Update the project and source URLs
- Minor spec file cleanups

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Jul 6 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5-5
- Disable back %%check as it fails only in ix86.

* Thu Jul 5 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.5-4
- Use gfan itself to create symlinks.
- Create -doc subpackage and install the homepage dir as documentation.
- Reenable %%check.
- Add -permissive patch for sagemath interface.

* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
- Rebuilt for c++ ABI breakage

* Mon Jan  9 2012 Jerry James <loganjerry@gmail.com> - 0.5-2
- Rebuild for GCC 4.7

* Thu Oct 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.5-1.2
- rebuild with new gmp without compat lib

* Tue Oct 11 2011 Peter Schiffer <pschiffe@redhat.com> - 0.5-1.1
- rebuild with new gmp

* Mon Apr 25 2011 Jerry James <loganjerry@gmail.com> - 0.5-1
- New upstream release.
- Drop BuildRoot tag, clean script, and clean at start of install script.
- Build against shared cddlib now that it is available.
- Fix some broken tests.
- Still cannot run the testsuite, as the tests will pass on one build attempt
  and then fail on another.  There is a Heisenbug somewhere....

* Tue Dec  8 2009 Michael Schwendt <mschwendt@fedoraproject.org> - 0.3-7
- Explicitly BR cddlib-static in accordance with the Packaging
  Guidelines (cddlib-devel is still static-only).

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Conrad Meyer <konrad@tylerc.org> - 0.3-5
- Include the right place for headers (fix FTBFS).

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Dec 30 2008 Conrad Meyer <konrad@tylerc.org> - 0.3-3
- Fix License tag.
- Fix build section.
- Remove doc/ in prep stage as it is non-free.

* Fri Dec 12 2008 Conrad Meyer <konrad@tylerc.org> - 0.3-2
- BR texlive-latex.

* Sat Dec 6 2008 Conrad Meyer <konrad@tylerc.org> - 0.3-1
- Initial package.