Blame polymake.spec

Jerry James ba7c26
# TESTING NOTE: "make test" does not work, because the test drivers are not
Jerry James ba7c26
# distributed with the released sources.  A Subversion repository containing
Jerry James ba7c26
# all of the sources, including the test drivers, was made available recently.
Jerry James ba7c26
# Once the next release of polymake occurs, we will extract the necessary test
Jerry James ba7c26
# drivers from subversion and produce a check script.
Jerry James ba7c26
98bd21
# If a library used by both polymake and Singular is updated, neither can be
98bd21
# rebuilt, because each BRs the other and both are linked against the old
98bd21
# version of the library.  Use this to rebuild polymake without Singular
98bd21
# support, rebuild Singular, then build polymake again with Singular support.
Jerry James 51c14e
%bcond_with singular
98bd21
4ad133
# Date of the "perpetual beta" subversion snapshot
Jerry James 51c14e
#%%global svndate 20140326
Jerry James ba7c26
Jerry James ba7c26
Name:           polymake
Jerry James 51c14e
Version:        2.13
10d40b
Release:        1%{?svndate:.svn%{svndate}}%{?dist}
Jerry James ba7c26
Summary:        Algorithms on convex polytopes and polyhedra
Jerry James ba7c26
Jerry James ba7c26
License:        GPLv2+
Jerry James ba7c26
URL:            http://polymake.org/
Jerry James 51c14e
Source0:        http://polymake.org/lib/exe/fetch.php/download/%{name}-%{version}.tar.bz2
Jerry James ba7c26
# Man page written by Jerry James from text found in the sources.  Therefore,
Jerry James ba7c26
# the copyright and license are the same as for the sources.
Jerry James ba7c26
Source1:        %{name}.1
Jerry James ba7c26
# This patch will not be sent upstream, since it is Fedora-specific.  Link
Jerry James ba7c26
# against existing system libraries instead of building them from source,
Jerry James ba7c26
# and do not use -rpath.
Jerry James ba7c26
Patch0:         %{name}-fedora.patch
Jerry James aeaf3f
# This patch was sent upstream 20 Mar 2013.  Fix a call to an lrslib function
Jerry James aeaf3f
# that segfaults when given a NULL argument.
4ad133
Patch1:         %{name}-lrslib.patch
Jerry James 215e34
# Avoid -Werror=format-security failures.
Jerry James 215e34
Patch2:         %{name}-format.patch
Jerry James f50867
# Adapt to the old version of Singular in Fedora.  Remove this once the
Jerry James f50867
# Singular package is updated to version 3-1-6 or later.
Jerry James f50867
Patch3:         %{name}-singular.patch
Jerry James ba7c26
Jerry James ba7c26
BuildRequires:  bliss-devel
4ad133
BuildRequires:  boost-devel
Jerry James ba7c26
BuildRequires:  cddlib-devel
4ad133
BuildRequires:  cmake
Jerry James f50867
BuildRequires:  eigen3-static
Jerry James 74d8a2
BuildRequires:  libnormaliz-devel
Jerry James ba7c26
BuildRequires:  libxml2-devel
Jerry James ba7c26
BuildRequires:  lrslib-devel
Jerry James ba7c26
BuildRequires:  mpfr-devel
Jerry James ba7c26
BuildRequires:  perl(ExtUtils::MakeMaker)
Jerry James ba7c26
BuildRequires:  perl(Term::ReadLine::Gnu)
Jerry James ba7c26
BuildRequires:  perl(XML::LibXSLT)
Jerry James ba7c26
BuildRequires:  perl(XML::SAX::Base)
Jerry James ba7c26
BuildRequires:  perl(XML::Writer)
Jerry James 74d8a2
BuildRequires:  ppl-devel
Jerry James ba7c26
BuildRequires:  sympol-devel
Jerry James ba7c26
BuildRequires:  xhtml1-dtds
98bd21
%if %{with singular}
98bd21
BuildRequires:  Singular-devel
98bd21
%endif
Jerry James ba7c26
Jerry James ba7c26
Requires:       perl(:MODULE_COMPAT_%{perl_version})
Jerry James 5d77b3
Requires:       perl = 4:%{perl_version}
Jerry James 5d77b3
Requires:       perl(Term::ReadLine::Gnu)
Jerry James ba7c26
Jerry James ba7c26
%global sover   %(echo %{version} | cut -d. -f1-2)
Jerry James ba7c26
%global major   %(echo %{version} | cut -d. -f1)
Jerry James ba7c26
%global polydir %{_libdir}/%{name}
Jerry James ba7c26
98bd21
# Don't expose private perl interfaces
98bd21
%global __provides_exclude perl\\\(Geomview.*\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(Graphviz.*\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(Metapost.*\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(PerlIO.*\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(Postscript.*\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(Povray.*\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(Sketch.*\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(SplitsTree.*\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(application\\\)
98bd21
%global __provides_exclude %{__provides_exclude}|perl\\\(_.*\\\)
98bd21
98bd21
# Exclude private perl interfaces that we don't Provide
6304c4
%global __requires_exclude perl\\\(it\\\)
98bd21
%global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::Background\\\)
98bd21
%global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::Core::RuleFilter\\\)
98bd21
%global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::file_utils\.pl\\\)
98bd21
%global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::Namespaces\\\)
98bd21
%global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::regex\.pl\\\)
98bd21
%global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::utils\.pl\\\)
Jerry James ba7c26
Jerry James ba7c26
%description
Jerry James ba7c26
Polymake is a tool to study the combinatorics and the geometry of convex
Jerry James ba7c26
polytopes and polyhedra.  It is also capable of dealing with simplicial
Jerry James ba7c26
complexes, matroids, polyhedral fans, graphs, tropical objects, and so
Jerry James ba7c26
forth.
Jerry James ba7c26
Jerry James ba7c26
Polymake can use various computational packages if they are installed.
Jerry James ba7c26
Those available from Fedora are: 4ti2, azove, gfan, latte-integrale,
Jerry James ba7c26
normaliz, ocaml-tplib-tools, qhull, Singular, TOPCOM, and vinci.
Jerry James ba7c26
Jerry James ba7c26
Polymake can interface with various visualization packages if they are
Jerry James ba7c26
installed.  Install one or more of the tools from the following list:
Jerry James ba7c26
evince, geomview, graphviz, gv, and okular.
Jerry James ba7c26
Jerry James ba7c26
%package devel
Jerry James ba7c26
Summary:        Development files for %{name}
Jerry James ba7c26
Requires:       %{name}%{?_isa} = %{version}-%{release}
Jerry James ba7c26
Jerry James ba7c26
%description devel
Jerry James ba7c26
This package contains header files and libraries for developing
Jerry James ba7c26
plugins (applications) that use %{name}.
Jerry James ba7c26
Jerry James ba7c26
%package doc
Jerry James ba7c26
Summary:        Documentation for %{name}
Jerry James ba7c26
Requires:       %{name}%{?_isa} = %{version}-%{release}
Jerry James ba7c26
Jerry James ba7c26
%description doc
Jerry James ba7c26
This package contains documentation for %{name}.
Jerry James ba7c26
Jerry James ba7c26
%prep
Jerry James ba7c26
%setup -q
Jerry James ba7c26
%patch0
Jerry James ba7c26
%patch1
Jerry James 215e34
%patch2
Jerry James f50867
%patch3
Jerry James ba7c26
Jerry James ba7c26
# Make sure we don't build against the bundled libraries.
4ad133
rm -fr external/{cdd,lrs}
Jerry James ba7c26
Jerry James ba7c26
# Adapt to a newer version of sympol
Jerry James ba7c26
sed -i "s|yal/||;s|symmetrygroupconstruction/||" \
4ad133
    bundled/group/apps/polytope/src/sympol_interface.cc
Jerry James ba7c26
Jerry James ba7c26
%build
Jerry James f50867
export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/eigen3 -I%{_includedir}/singular -Wno-unused-local-typedefs"
4ad133
export CXXFLAGS="$CFLAGS"
Jerry James f50867
export LDFLAGS="$RPM_LD_FLAGS -Wl,--as-needed -ldl"
Jerry James ba7c26
export Arch=%{_arch}
Jerry James ba7c26
# NOT an autoconf-generated configure script; do not use %%configure.
Jerry James ba7c26
./configure --build=%{_arch} --prefix=%{_prefix} --libdir=%{_libdir} \
4ad133
  --libexecdir=%{polydir} --without-java --without-javaview
Jerry James ba7c26
make %{?_smp_mflags} all
Jerry James ba7c26
Jerry James ba7c26
# Help the debuginfo generator find generated files
Jerry James ba7c26
cd build.%{_arch}
4ad133
cp -p perlx-*linux-*/CPlusPlus.xxs lib/core/CPlusPlus.xxs
4ad133
cp -p perlx-*linux-*/CPlusPlus.cc lib/core/CPlusPlus.cc
Jerry James ba7c26
Jerry James ba7c26
%install
Jerry James ba7c26
# Don't recompile the main library with DESTDIR compiled in
Jerry James ba7c26
sed -i "/conf\.make/d" support/corelib.make
Jerry James ba7c26
Jerry James ba7c26
# The release-docs target copies docs to their installed locations
Jerry James ba7c26
export Arch=%{_arch}
Jerry James ba7c26
make install release-docs DESTDIR=%{buildroot}
Jerry James ba7c26
Jerry James ba7c26
# The apps have undefined weak symbols.  However, fixing that kills the
Jerry James ba7c26
# documentation building step for reasons I can't seem to track down.  So
Jerry James ba7c26
# instead, we wait until after the docs have been generated, then relink.
Jerry James ba7c26
sed -e 's|^Libs :=.*|& -L$(wildcard ${BuildDir}/perlx-*-linux-*) -lpolymake|' \
Jerry James ba7c26
    -i support/app.make
Jerry James ba7c26
sed -e 's|-lgmp ${LIBS}|& -L${PerlExtDir} -lpolymake|' \
Jerry James ba7c26
    -e 's|^${CoreLib} :.*|& ${CallableLib}|' \
Jerry James ba7c26
    -i support/corelib.make
Jerry James ba7c26
rm -f build.%{_arch}/lib/*.so
Jerry James ba7c26
make %{?_smp_mflags} all
Jerry James ba7c26
chmod 0755 %{buildroot}%{polydir}/lib/*.so
Jerry James ba7c26
cp -p build.%{_arch}/lib/*.so %{buildroot}%{polydir}/lib
Jerry James ba7c26
Jerry James ba7c26
# Install the man page
Jerry James ba7c26
mkdir -p %{buildroot}%{_mandir}/man1
Jerry James ba7c26
sed "s/@VERSION@/%{version}/" %{SOURCE1} > %{buildroot}%{_mandir}/man1/%{name}.1
Jerry James ba7c26
touch -r %{SOURCE1} %{buildroot}%{_mandir}/man1/%{name}.1
Jerry James ba7c26
Jerry James ba7c26
# We don't want the documentation in /usr/share/polymake
Jerry James ba7c26
mv %{buildroot}%{_datadir}/%{name}/doc .
Jerry James ba7c26
Jerry James ba7c26
# Remove stuff that shouldn't be installed
Jerry James ba7c26
rm -fr %{buildroot}%{_datadir}/%{name}/apps/*/src \
Jerry James ba7c26
  %{buildroot}%{_datadir}/%{name}/java_build \
Jerry James ba7c26
  %{buildroot}%{polydir}/perlx/*/*/auto/Polymake/Ext/{.packlist,Ext.bs} \
Jerry James ba7c26
  %{buildroot}%{polydir}/lib/jreality
Jerry James ba7c26
Jerry James ba7c26
# Fix permissions
Jerry James ba7c26
chmod 0755 %{buildroot}%{_bindir}/*
Jerry James ba7c26
chmod 0755 %{buildroot}%{_libdir}/lib*
Jerry James ba7c26
find %{buildroot}%{polydir} -name \*.so | xargs chmod 0755
Jerry James ba7c26
4ad133
# Remove the buildroot from configuration files
4ad133
sed -i 's,%{buildroot},,' %{buildroot}%{polydir}/bundled/bliss/conf.make
4ad133
sed -i 's,%{buildroot},,' %{buildroot}%{polydir}/bundled/group/conf.make
Jerry James 74d8a2
sed -i 's,%{buildroot},,' %{buildroot}%{polydir}/bundled/libnormaliz/conf.make
Jerry James 74d8a2
sed -i 's,%{buildroot},,' %{buildroot}%{polydir}/bundled/ppl/conf.make
98bd21
%if %{with singular}
Jerry James f50867
sed -i 's,%{buildroot},,' %{buildroot}%{polydir}/bundled/singular/conf.make
98bd21
%endif
4ad133
Jerry James ba7c26
%post -p /sbin/ldconfig
Jerry James ba7c26
Jerry James ba7c26
%postun -p /sbin/ldconfig
Jerry James ba7c26
Jerry James ba7c26
%files
Jerry James ba7c26
%{_bindir}/%{name}
Jerry James ba7c26
%{_mandir}/man1/%{name}.1*
4ad133
%{_libdir}/lib%{name}*.so.*
Jerry James ba7c26
%{polydir}/
Jerry James ba7c26
%{_datadir}/%{name}/
Jerry James ba7c26
%exclude %{_datadir}/%{name}/lib/
Jerry James ba7c26
Jerry James ba7c26
%files devel
Jerry James ba7c26
%{_bindir}/%{name}-config
Jerry James ba7c26
%{_includedir}/%{name}/
Jerry James ba7c26
%{_datadir}/%{name}/lib/
4ad133
%{_libdir}/lib%{name}*.so
Jerry James ba7c26
Jerry James ba7c26
%files doc
Jerry James ba7c26
%doc doc/*
Jerry James ba7c26
Jerry James ba7c26
%changelog
10d40b
* Tue Apr 29 2014 Jerry James <loganjerry@gmail.com> - 2.13-1
10d40b
- New upstream release: build against rebuilt Singular
10d40b
Jerry James 51c14e
* Tue Apr 29 2014 Jerry James <loganjerry@gmail.com> - 2.13-0
Jerry James 51c14e
- New upstream release: bootstrap build without Singular support
Jerry James 51c14e
98bd21
* Wed Apr  2 2014 Jerry James <loganjerry@gmail.com> - 2.12-15.svn20140326
98bd21
- Update to latest "perpetual beta" for bug fixes
98bd21
- Add conditional to build without Singular support
98bd21
Jerry James f50867
* Wed Mar 12 2014 Jerry James <loganjerry@gmail.com> - 2.12-14.svn20131128
Jerry James f50867
- Build with Singular support
Jerry James f50867
- Make transitive dependency on eigen3 (via sympol) explicit
Jerry James f50867
6304c4
* Sat Jan 18 2014 Jerry James <loganjerry@gmail.com> - 2.12-13.svn20131128
6304c4
- Update Requires filters
6304c4
Jerry James 74d8a2
* Fri Jan 17 2014 Jerry James <loganjerry@gmail.com> - 2.12-12.svn20131128
Jerry James 74d8a2
- Update to latest "perpetual beta" for bug fixes
Jerry James 74d8a2
- Enable building new ppl and libnormaliz extensions
Jerry James 74d8a2
Jerry James f88495
* Wed Jan  8 2014 Jerry James <loganjerry@gmail.com> - 2.12-11.svn20130813
Jerry James f88495
- Rebuild for perl 5.18.2
Jerry James 215e34
- Add -format patch to fix -Werror=format-security failure
Jerry James f88495
4ad133
* Wed Aug 14 2013 Jerry James <loganjerry@gmail.com> - 2.12-10.svn20130813
4ad133
- Update to latest "perpetual beta" for perl 5.18 compatibility (bz 992813)
4ad133
e5f4d1
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.12-9
e5f4d1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
e5f4d1
78278d
* Wed Jul 24 2013 Petr Pisar <ppisar@redhat.com> - 2.12-8
78278d
- Perl 5.18 rebuild
78278d
f14dd5
* Sun Jul 21 2013 Rich Mattes <richmattes@gmail.com> - 2.12-7
f14dd5
- Rebuild for eigen3-3.1.3
f14dd5
Jerry James 5d77b3
* Wed May 15 2013 Jerry James <loganjerry@gmail.com> - 2.12-6
Jerry James 5d77b3
- Require version of perl used to build (bz 963486)
Jerry James 5d77b3
- perl(Term::ReadLine::Gnu) dependency is not autogenerated (bz 963486)
Jerry James 5d77b3
Jerry James aeaf3f
* Wed Mar 20 2013 Jerry James <loganjerry@gmail.com> - 2.12-5
Jerry James aeaf3f
- Add -lrslib patch to fix a segfault (bz 923269)
Jerry James aeaf3f
Jerry James ba7c26
* Wed Feb 27 2013 Jerry James <loganjerry@gmail.com> - 2.12-4
Jerry James ba7c26
- Remove rpath and -L%%{_libdir} from polymake-config --ldflags output
Jerry James ba7c26
Jerry James ba7c26
* Thu Jan 24 2013 Jerry James <loganjerry@gmail.com> - 2.12-3
Jerry James ba7c26
- Also need to filter perl(Graphviz)
Jerry James ba7c26
Jerry James ba7c26
* Wed Jan 23 2013 Jerry James <loganjerry@gmail.com> - 2.12-2
Jerry James ba7c26
- Change -libs patch to also remove -rpath arguments
Jerry James ba7c26
- Filter Provides/Requires to hide private perl interfaces
Jerry James ba7c26
- Remove the broken check script and explain why
Jerry James ba7c26
Jerry James ba7c26
* Thu Jan 10 2013 Jerry James <loganjerry@gmail.com> - 2.12-1
Jerry James ba7c26
- Initial RPM