# Polymake intentionally leaves symbols undefined in the plugins, but Fedora's # hardening flags disable RTLD_LAZY, resulting in undefined symbol errors while # building the documentation. %undefine _hardened_build # In addition, we have to not tell the linker to require all symbols to be # defined, else the plugin builds fail. %undefine _strict_symbol_defs_build # Polymake installs python files into nonstandard locations %global _python_bytecompile_extra 0 # Build with the bundled version of jreality. This currently includes bundled # versions of several other Java projects (e.g., bsh, janino, jinput), and also # itextpdf 5.3.2, whose license is problematic. %bcond_with jreality Name: polymake Version: 3.2r3 Release: 7%{?dist} %global polydir %{_libdir}/%{name} %global majver %(cut -dr -f1 <<< %{version}) Summary: Algorithms on convex polytopes and polyhedra License: GPLv2+ URL: http://polymake.org/ Source0: http://polymake.org/lib/exe/fetch.php/download/%{name}-%{version}.tar.bz2 # Man page written by Jerry James from text found in the sources. Therefore, # the copyright and license are the same as for the sources. Source1: %{name}.1 # This patch will not be sent upstream, since it is Fedora-specific. Link # against existing system libraries instead of building them from source, # and do not use -rpath. Patch0: %{name}-fedora.patch # Do not use the hardening flags. See above. Patch1: %{name}-no-hardening.patch # Fix detection of LattE Patch2: %{name}-latte.patch %if %{with jreality} BuildRequires: ant %endif BuildRequires: boost-devel BuildRequires: cddlib-devel BuildRequires: cmake BuildRequires: eigen3-static BuildRequires: gcc-c++ BuildRequires: gmp-devel %if %{with jreality} BuildRequires: java-devel BuildRequires: jpackage-utils %endif BuildRequires: libnauty-devel BuildRequires: libnormaliz-devel BuildRequires: libxml2-devel BuildRequires: lrslib-devel BuildRequires: mpfr-devel BuildRequires: ninja-build BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl(Archive::Tar) BuildRequires: perl(ExtUtils::Embed) BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Gtk2) BuildRequires: perl(JSON) BuildRequires: perl(Math::BigInt) BuildRequires: perl(Math::Trig) BuildRequires: perl(MongoDB) BuildRequires: perl(SVG) BuildRequires: perl(Term::ReadKey) BuildRequires: perl(Term::ReadLine::Gnu) BuildRequires: perl(XML::LibXSLT) BuildRequires: perl(XML::SAX::Base) BuildRequires: perl(XML::Writer) BuildRequires: permlib-devel BuildRequires: ppl-devel BuildRequires: python3-devel BuildRequires: Singular-devel BuildRequires: sympol-devel BuildRequires: xhtml1-dtds # Both packages are required for normal operation Requires: %{name}-singular%{?_isa} = %{version}-%{release} # Don't expose private perl interfaces %global __provides_exclude perl\\\(Geomview.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Graphviz.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Metapost.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(PerlIO.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Postscript.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Povray.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Sage\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Sketch.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(SplitsTree.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(ThreeJS.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(TikZ.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Visual.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(application\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(_.*\\\) # Exclude private perl interfaces that we don't Provide %global __requires_exclude perl\\\(Visual::Drawing\\\) %global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::file_utils\.pl\\\) %global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::regex\.pl\\\) %global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::utils\.pl\\\) %global __requires_exclude %{__requires_exclude}|perl\\\(namespaces::.*\\\) %description Polymake is a tool to study the combinatorics and the geometry of convex polytopes and polyhedra. It is also capable of dealing with simplicial complexes, matroids, polyhedral fans, graphs, tropical objects, and so forth. Polymake can use various computational packages if they are installed. Those available from Fedora are: 4ti2, azove, gfan, latte-integrale, normaliz, ocaml-tplib-tools, qhull, Singular, TOPCOM, and vinci. Polymake can interface with various visualization packages if they are installed. Install one or more of the tools from the following list: evince, geomview, graphviz, gv, and okular. %package singular Summary: Files needed to build Singular's polymake plugin %if %{with jreality} Requires: java Requires: jpackage-utils %endif Requires: gcc-c++ Requires: glibc-devel%{?_isa} Requires: libgcc%{?_isa} Requires: make Requires: mpfr-devel Requires: perl(:MODULE_COMPAT_%{perl_version}) Requires: perl-interpreter = 4:%{perl_version} Requires: perl(Term::ReadLine::Gnu) Recommends: 4ti2 Recommends: azove Recommends: gfan Recommends: latte-integrale Recommends: normaliz Recommends: ocaml-tplib-tools Recommends: qhull Recommends: Singular Recommends: TOPCOM Recommends: vinci Suggests: evince Suggests: geomview Suggests: graphviz Suggests: gv Suggests: okular Suggests: sketch # Add some provides the automatic generator missed Provides: perl(PolyDB::DatabaseCursor) Provides: perl(Polymake::ConfigureStandalone) Provides: perl(Polymake::Core::RuleFilter) Provides: perl(Polymake::Core::ShellHelpers) Provides: perl(Polymake::Core::ShellMock) Provides: perl(Polymake::Namespaces) Provides: perl(Polymake::Test::Validation) %description singular This package contains all of polymake except its Singular dependencies, for the purpose of building new versions of Singular without pulling an old version into the buildroot. %package doc Summary: Documentation for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description doc This package contains documentation for %{name}. %prep %setup -q -n %{name}-%{majver} %patch0 -b .fedora %patch1 %patch2 fixtimestamp() { touch -r $1.orig $1 rm -f $1.orig } # Adapt to the Fedora version of sympol sed -i.orig "s|yal/||;s|symmetrygroupconstruction/||" \ bundled/sympol/apps/polytope/src/sympol_interface.cc fixtimestamp bundled/sympol/apps/polytope/src/sympol_interface.cc # Fix "error: -Wformat-security ignored without -Wformat" and reduce # overlinkage. sed -e 's/ -Wno-format//' \ -e 's/\($LDsharedFLAGS=\)\(.*\);/\1"\2 -Wl,--as-needed";/' \ -i support/configure.pl # Help polymake find the 4ti2 tools sed -i.orig "/global variables/i\$ENV{'PATH'} = \"\$ENV{PATH}:%{_libdir}/4ti2/bin\";\n" perl/polymake touch -r perl/polymake.orig perl/polymake rm perl/polymake.orig # We do not want to use env sed -i.orig 's,/usr/bin/env python3.*,/usr/bin/python3,' \ resources/jupyter-polymake/setup.py fixtimestamp resources/jupyter-polymake/setup.py %ifarch %{arm} # The ARM builders almost always run out of memory while building polymake. # Reduce the optimization and debug levels for the problematic file in an # effort to avoid this. cat > apps/polytope/build_flags.pl << EOF # input for generate_ninja_targets.pl ( 'rel_int_point.cc' => '-O1 -g', ) EOF %endif # Fix the path to xsubpp sed -i 's,\${ExtUtils}/xsubpp,%{_bindir}/xsubpp,' support/rules.ninja # Build verbosely sed -i 's,\${NINJA},& -v,' Makefile %build export LC_ALL=C.UTF-8 export CFLAGS="%{optflags} -I%{_includedir}/eigen3 -I%{_includedir}/nauty -Wno-unused-local-typedefs -fno-delete-null-pointer-checks" export CXXFLAGS="$CFLAGS" export LDFLAGS="$RPM_LD_FLAGS -ldl" if [ %{__isa_bits} = "32" ]; then LDFLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads $LDFLAGS" fi export Arch=%{_arch} # NOT an autoconf-generated configure script; do not use %%configure. ./configure --build=%{_arch} --prefix=%{_prefix} --libdir=%{_libdir} \ --without-native \ --with-singular=%{_prefix} \ --with-lrs=%{_prefix} \ --with-cdd-include=%{_includedir}/cddlib/ \ --with-cdd-lib=%{_libdir} \ --with-permlib=%{_prefix} \ --with-sympol-include=%{_includedir}/sympol/ \ --with-sympol-lib=%{_libdir} \ --with-nauty-src=%{_prefix} \ %if %{with jreality} --with-java=%{java_home} \ %else --without-java \ %endif --libexecdir=%{polydir} --without-javaview # No, really, we can't have the hardening flags on sed -i 's| -Wl,-z,now -specs=.*redhat-hardened-ld||g' build.%{_arch}/config.ninja # FIXME: infrequent failures with %%{?_smp_mflags}, plus memory is tight make all %install export Arch=%{_arch} make install DESTDIR=%{buildroot} # Build the documentation mkdir doc ln -s build.%{_arch} build perl/polymake --script generate_docs doc # Copy files, don't symlink to their position in the build directory for fil in docstyle.css functions.js images style.css; do rm -f doc/$fil cp -a xml/documentation/$fil doc done # Install the man page mkdir -p %{buildroot}%{_mandir}/man1 sed "s/@VERSION@/%{version}/" %{SOURCE1} > %{buildroot}%{_mandir}/man1/%{name}.1 touch -r %{SOURCE1} %{buildroot}%{_mandir}/man1/%{name}.1 # Do not install app sources rm -fr %{buildroot}%{_datadir}/%{name}/apps/*/src # Fix permissions chmod 0755 %{buildroot}%{_bindir}/* chmod 0755 %{buildroot}%{_libdir}/lib* chmod 0755 %{buildroot}%{_datadir}/%{name}/resources/host-agent/bin/env chmod 0755 %{buildroot}%{_datadir}/%{name}/resources/host-agent/server.pl chmod 0755 %{buildroot}%{_datadir}/%{name}/resources/jupyter-polymake/setup.py chmod 0755 %{buildroot}%{_datadir}/%{name}/resources/polymake-in-container.sh find %{buildroot}%{polydir} -name \*.so | xargs chmod 0755 # Byte compile the python %py_byte_compile %{__python3} %{buildroot}%{_datadir}/%{name}/resources/jupyter-polymake %py_byte_compile %{__python3} %{buildroot}%{_datadir}/%{name}/resources/jupyter-polymake/jupyter_kernel_polymake %ldconfig_scriptlets %files %{_bindir}/%{name} %{polydir}/lib/ideal.so %{polydir}/bundled/singular %{_mandir}/man1/%{name}.1* %files singular %{_bindir}/%{name}-config %{_includedir}/%{name}/ %{_libdir}/lib%{name}* %{_datadir}/%{name}/ %{polydir}/ %exclude %{polydir}/lib/ideal.so %exclude %{polydir}/bundled/singular %files doc %doc doc/* %changelog * Wed Oct 17 2018 Jerry James - 3.2r3-7 - Call the right count program from latte-integrale * Sat Oct 13 2018 Jerry James - 3.2r3-6 - Rebuild for cddlib 0.94j * Fri Aug 10 2018 Jerry James - 3.2r3-5 - perl(MongoDB) is now available on all arches - Reverse the sense of the main package and the singular subpackage, so that users who install "polymake" get a working package. The singular subpackage, perversely, has no dependency on Singular. It is to be used to build Singular; otherwise, the Singular BR on polymake pulls in the old version of Singular, which is often broken due to an soname bump. * Sat Aug 4 2018 Jerry James - 3.2r3-4 - Fix separation of Singular dependencies into subpackage * Fri Jul 13 2018 Fedora Release Engineering - 3.2r3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Sat Jun 30 2018 Jitka Plesnikova - 3.2r3-2 - Perl 5.28 re-rebuild of bootstrapped packages * Sat Jun 2 2018 Jerry James - 3.2r3-1 - New upstream version - Drop upstreamed -lrs-system-fix and -gcc7 patches - Add -no-hardening patch to fix FTBFS - BR gmp-devel, ninja-build, perl(JSON), and permlib-devel * Wed May 2 2018 Jerry James - 3.1-12 - Rebuild for perl 5.26.2 * Fri Mar 2 2018 Jerry James - 3.1-11 - Turn off _strict_symbol_defs_build so the plugins will build * Fri Feb 09 2018 Fedora Release Engineering - 3.1-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Sat Sep 30 2017 Jerry James - 3.1-9 - Rebuild for cddlib and normaliz 3.4.0 * Wed Sep 27 2017 Jitka Plesnikova - 3.1-8 - Rebuild for Perl 5.26.1 * Thu Aug 03 2017 Fedora Release Engineering - 3.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 3.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Thu Jul 13 2017 Petr Pisar - 3.1-5 - perl dependency renamed to perl-interpreter * Wed Jun 07 2017 Jitka Plesnikova - 3.1-4 - Perl 5.26 rebuild * Mon May 15 2017 Fedora Release Engineering - 3.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild * Thu Apr 6 2017 Jerry James - 3.1-2 - Rebuild with Singular support * Wed Apr 5 2017 Jerry James - 3.1-1 - New upstream release * Fri Mar 3 2017 Jerry James - 3.0r2-8 - Rebuild for ppl 1.2 - Drop -ppl patch - Add -gcc7 patch to fix FTBFS - Reduce debug level on 32-bit ARM to try to avoid memory exhaustion * Sat Feb 11 2017 Fedora Release Engineering - 3.0r2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Fri Jan 27 2017 Jonathan Wakely - 3.0r2-6 - Rebuilt for Boost 1.63 * Sat Jan 21 2017 Jerry James - 3.0r2-5 - Help polymake find the LattE and 4ti2 tools - Add Requires needed for polymake to compile tools at runtime (bz 1414594) - Merge polymake-devel into main package, needed to build tools at runtime - Bring back libpolymake-apps, needed by Singular 4 (bz 1389956) * Mon Jan 16 2017 Jerry James - 3.0r2-4 - Rebuild for perl 5.24.1 * Wed Jan 11 2017 Jerry James - 3.0r2-3 - Add -magic, -ppl, and -endian patches to fix build problems - Add the option to build with a bundled version of jreality * Thu Dec 29 2016 Rich Mattes - 3.0r2-3 - Rebuild for eigen3-3.3.1 * Fri Nov 4 2016 Jerry James - 3.0r2-2 - Do not ship libpolymake-apps (bz 1389956) - Suggest sketch * Mon Jul 25 2016 Jerry James - 3.0r2-1 - New upstream release * Fri May 27 2016 Jerry James - 3.0r1-5 - Rebuild for lrslib 062 and sympol 0.1.9 * Tue May 17 2016 Jitka Plesnikova - 3.0r1-4 - Perl 5.24 rebuild * Tue May 3 2016 Jerry James - 3.0r1-3 - Rebuild for perl 5.22.2 * Thu Apr 28 2016 Jerry James - 3.0r1-2 - Build against nauty instead of bliss * Tue Apr 12 2016 Jerry James - 3.0r1-1 - New upstream release - Add Recommends and Suggests for optional tools - Bundle libnormaliz for now until the system version can catch up * Thu Feb 04 2016 Fedora Release Engineering - 2.14r1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Fri Jan 15 2016 Jonathan Wakely - 2.14r1-5 - Rebuilt for Boost 1.60 * Tue Dec 15 2015 Jerry James - 2.14r1-4 - Rebuild for perl 5.22.1 * Fri Dec 4 2015 Jerry James - 2.14r1-3 - Rebuild for lrslib 061 * Sat Oct 3 2015 Jerry James - 2.14r1-2 - Fix Requires snafu that made the package uninstallable * Fri Oct 2 2015 Jerry James - 2.14r1-1 - The 2.15 branch is not ready; go back to the latest 2.14 release * Thu Aug 27 2015 Jonathan Wakely - 2.15-0.2.beta2 - Rebuilt for Boost 1.59 * Wed Aug 26 2015 Tom Callaway - 2.15-0.1.beta2 - update to 2.15-beta2 for newer perl support * Mon Aug 10 2015 Tom Callaway - 2.14-1 - update to 2.14 * Wed Jul 29 2015 Fedora Release Engineering - 2.13-26.git20141013 - Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 * Wed Jul 22 2015 David Tardon - 2.13-25.git20141013 - rebuild for Boost 1.58 * Tue Jun 23 2015 Jerry James - 2.13-24.git20141013 - Add -perl522 patch to fix the build * Thu Jun 18 2015 Fedora Release Engineering - 2.13-24.git20141013 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat Jun 06 2015 Jitka Plesnikova - 2.13-23.git20141013 - Perl 5.22 rebuild - Disable BR Singular-devel * Mon May 18 2015 Jerry James - 2.13-22.git20141013 - Rebuild for cddlib 094h * Sat May 02 2015 Kalev Lember - 2.13-21.git20141013 - Rebuilt for GCC 5 C++11 ABI change * Sat Mar 7 2015 Jerry James - 2.13-20.git20141013 - Rebuild with Singular support * Fri Mar 6 2015 Jerry James - 2.13-19.git20141013 - Add -gcc5 patch - Disable hardening flags, which kill RTLD_LAZY - Don't try to fix undefined symbols in the plugins anymore * Thu Mar 05 2015 Jitka Plesnikova - 2.13-19.git20141013 - Rebuild for perl 5.20.2 * Wed Feb 04 2015 Petr Machata - 2.13-18.git20141013 - Bump for rebuild. * Mon Feb 2 2015 Jerry James - 2.13-17.git20141013 - Rebuild for eigen3 3.2.4, lrslib 0.5.1, and normaliz 2.12.2 * Thu Jan 29 2015 Petr Machata - 2.13-16.git20141013 - Rebuild for boost 1.57.0 * Mon Jan 19 2015 Jerry James - 2.13-15.git20141013 - Add -exit patch to fix crash on exit * Thu Jan 15 2015 Jerry James - 2.13-14.git20141013 - Rebuild for eigen3 3.2.3 * Mon Nov 10 2014 Jerry James - 2.13-13.git20141013 - Rebuild with Singular support * Mon Nov 10 2014 Jerry James - 2.13-12.git20141013 - Update to latest perpetual beta snapshot * Tue Sep 16 2014 Jerry James - 2.13-11.git20140811 - Rebuild with Singular support * Tue Sep 16 2014 Jerry James - 2.13-10.git20140811 - Rebuild for perl 5.20.1 - New -singular subpackage to reduce pain of Singular+polymake updates * Thu Sep 11 2014 Jerry James - 2.13-9.git20140811 - Rebuild with Singular support * Thu Sep 11 2014 Jerry James - 2.13-8.git20140811 - Update to perpetual beta snapshot that supports perl 5.20 (bz 1139212) * Fri Aug 29 2014 Jitka Plesnikova - 2.13-8 - Perl 5.20 rebuild - Disable BR Singular-devel when perl bootstrapping * Sun Aug 17 2014 Fedora Release Engineering - 2.13-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Fri Aug 8 2014 Jerry James - 2.13-6 - Rebuild with Singular support * Tue Aug 5 2014 Jerry James - 2.13-5 - Rebuild for libnormaliz 2.11.2 and eigen3 3.2.2 * Sat Jun 07 2014 Fedora Release Engineering - 2.13-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed May 28 2014 Jerry James - 2.13-3 - Rebuild for Singular 3-1-6 - Add configuration workarounds for Singular support * Fri May 23 2014 Petr Machata - 2.13-2 - Rebuild for boost 1.55.0 * Tue Apr 29 2014 Jerry James - 2.13-1 - New upstream release: build against rebuilt Singular * Tue Apr 29 2014 Jerry James - 2.13-0 - New upstream release: bootstrap build without Singular support * Wed Apr 2 2014 Jerry James - 2.12-15.svn20140326 - Update to latest "perpetual beta" for bug fixes - Add conditional to build without Singular support * Wed Mar 12 2014 Jerry James - 2.12-14.svn20131128 - Build with Singular support - Make transitive dependency on eigen3 (via sympol) explicit * Sat Jan 18 2014 Jerry James - 2.12-13.svn20131128 - Update Requires filters * Fri Jan 17 2014 Jerry James - 2.12-12.svn20131128 - Update to latest "perpetual beta" for bug fixes - Enable building new ppl and libnormaliz extensions * Wed Jan 8 2014 Jerry James - 2.12-11.svn20130813 - Rebuild for perl 5.18.2 - Add -format patch to fix -Werror=format-security failure * Wed Aug 14 2013 Jerry James - 2.12-10.svn20130813 - Update to latest "perpetual beta" for perl 5.18 compatibility (bz 992813) * Sun Aug 04 2013 Fedora Release Engineering - 2.12-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Wed Jul 24 2013 Petr Pisar - 2.12-8 - Perl 5.18 rebuild * Sun Jul 21 2013 Rich Mattes - 2.12-7 - Rebuild for eigen3-3.1.3 * Wed May 15 2013 Jerry James - 2.12-6 - Require version of perl used to build (bz 963486) - perl(Term::ReadLine::Gnu) dependency is not autogenerated (bz 963486) * Wed Mar 20 2013 Jerry James - 2.12-5 - Add -lrslib patch to fix a segfault (bz 923269) * Wed Feb 27 2013 Jerry James - 2.12-4 - Remove rpath and -L%%{_libdir} from polymake-config --ldflags output * Thu Jan 24 2013 Jerry James - 2.12-3 - Also need to filter perl(Graphviz) * Wed Jan 23 2013 Jerry James - 2.12-2 - Change -libs patch to also remove -rpath arguments - Filter Provides/Requires to hide private perl interfaces - Remove the broken check script and explain why * Thu Jan 10 2013 Jerry James - 2.12-1 - Initial RPM