Blob Blame History Raw
Name:           gfan
Version:        0.5
Release:        1%{?dist}
Summary:        Software for Computing Gröbner Fans and Tropical Varieties
Group:          Applications/Engineering
License:        GPL+
URL:            http://www.math.tu-berlin.de/~jensen/software/gfan/gfan.html
Source0:        http://www.math.tu-berlin.de/~jensen/software/gfan/gfan%{version}.tar.gz
# Sent upstream 2011 Apr 27.  Respect DESTDIR
Patch0:         gfan-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:         gfan-format.patch
# Sent upstream 2011 Apr 27.  Fix warnings that could indicate runtime
# problems.
Patch2:         gfan-warning.patch

BuildRequires:  cddlib-devel
BuildRequires:  gmp-devel


%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.


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

# 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


%build
make %{?_smp_mflags} \
  OPTFLAGS="%{optflags} -DGMPRATIONAL -I/usr/include/cddlib" \
  PREFIX=%{_prefix}


%install
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix}
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/%{name}
mv $RPM_BUILD_ROOT%{_bindir}/gfan_* $RPM_BUILD_ROOT%{_libexecdir}/%{name}/
pushd $RPM_BUILD_ROOT%{_libexecdir}/%{name}/
  for symlink in gfan_*; do
    rm $symlink
    ln -s ../../bin/%{name} $symlink
  done
popd


%check
./gfan _test


%files
%defattr(-,root,root,-)
%doc COPYING examples LICENSE
%{_bindir}/%{name}
%{_libexecdir}/%{name}


%changelog
* 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.
- Add check script, which requires fixing some broken tests.

* 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.