From d5274d9a519012976a856a609ff430480324f811 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Mar 19 2019 03:58:25 +0000 Subject: New upstream version. Add python3-JuPyMake and -jupyter subpackages. --- diff --git a/polymake-config b/polymake-config new file mode 100644 index 0000000..f6ff887 --- /dev/null +++ b/polymake-config @@ -0,0 +1,40 @@ +#!/bin/sh + +for i in $*; do + case $i in + --cc) + echo_cc=yes + ;; + --cflags) + echo_cflags=yes + ;; + --includes) + echo_includes=yes + ;; + --ldflags) + echo_ldflags=yes + ;; + --libs) + echo_libs=yes + ;; + *) + exit 1 + ;; + esac; +done + +if test "$echo_cc" = "yes"; then + echo "/usr/bin/g++" +fi +if test "$echo_cflags" = "yes"; then + echo "-g" +fi +if test "$echo_includes" = "yes"; then + echo "-I@buildroot@/usr/include" +fi +if test "$echo_ldflags" = "yes"; then + echo "-L@buildroot@@libdir@" +fi +if test "$echo_libs" = "yes"; then + echo "-lpolymake -lpolymake-apps -lmpfr -lgmp -lpthread -lxml2 -lz -llzma -lm -ldl" +fi diff --git a/polymake-fedora.patch b/polymake-fedora.patch index ba30978..8681413 100644 --- a/polymake-fedora.patch +++ b/polymake-fedora.patch @@ -1,5 +1,5 @@ ---- bundled/cdd/support/configure.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/cdd/support/configure.pl 2018-11-17 17:48:40.679799989 -0700 +--- bundled/cdd/support/configure.pl.orig 2019-02-12 16:05:25.000000000 -0700 ++++ bundled/cdd/support/configure.pl 2019-03-06 18:52:58.205539413 -0700 @@ -52,7 +52,6 @@ sub proceed { my $cdd_lib=Polymake::Configure::get_libdir($cdd_path, "cddgmp"); if (-f "$cdd_lib/libcddgmp.$Config::Config{so}" ) { @@ -16,9 +16,9 @@ $cdd_path .= "lib: $cdd_lib"; } ---- bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc 2018-11-17 17:48:40.679799989 -0700 -@@ -134,7 +134,7 @@ inline bool int_quotient(long long& Quot +--- bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc.orig 2019-02-12 16:05:25.000000000 -0700 ++++ bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc 2019-03-06 18:52:58.217539376 -0700 +@@ -136,7 +136,7 @@ inline bool int_quotient(long long& Quot #endif #endif @@ -27,8 +27,8 @@ #if defined(__GNUC__) #if defined(__clang__) ---- bundled/libnormaliz/support/configure.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/libnormaliz/support/configure.pl 2018-11-17 17:48:40.680799986 -0700 +--- bundled/libnormaliz/support/configure.pl.orig 2019-02-12 16:05:25.000000000 -0700 ++++ bundled/libnormaliz/support/configure.pl 2019-03-06 18:52:58.218539373 -0700 @@ -136,6 +136,7 @@ int main (int argc, char *argv[]) $message .= " [OpenMP support disabled]"; } @@ -37,8 +37,8 @@ $LIBS="-lnormaliz"; $message = "$nmz_version @ ".($nmz_path//"system") } ---- bundled/lrs/support/configure.pl.orig 2018-11-17 17:48:40.681799983 -0700 -+++ bundled/lrs/support/configure.pl 2018-11-17 17:50:36.678464180 -0700 +--- bundled/lrs/support/configure.pl.orig 2019-02-12 16:05:25.000000000 -0700 ++++ bundled/lrs/support/configure.pl 2019-03-06 18:52:58.218539373 -0700 @@ -65,7 +65,7 @@ sub proceed { } @@ -48,8 +48,8 @@ } elsif (-f "$lrs_lib/lib$lrs_libname.a" ) { $LDFLAGS = "-L$lrs_lib"; } else { ---- bundled/nauty/apps/graph/src/build_flags.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/nauty/apps/graph/src/build_flags.pl 2018-11-17 17:48:40.681799983 -0700 +--- bundled/nauty/apps/graph/src/build_flags.pl.orig 2019-02-12 16:05:25.000000000 -0700 ++++ bundled/nauty/apps/graph/src/build_flags.pl 2019-03-06 18:52:58.218539373 -0700 @@ -1,25 +1,11 @@ # input for generate_ninja_targets.pl @@ -84,8 +84,8 @@ + } ) + : () ) ---- bundled/nauty/support/configure.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/nauty/support/configure.pl 2018-11-17 17:48:40.682799980 -0700 +--- bundled/nauty/support/configure.pl.orig 2019-02-12 16:05:25.000000000 -0700 ++++ bundled/nauty/support/configure.pl 2019-03-06 18:52:58.219539369 -0700 @@ -13,7 +13,7 @@ # GNU General Public License for more details. #------------------------------------------------------------------------------- @@ -134,19 +134,8 @@ + return $UseBundled ? "bundled" : ($nautysrc//"system"); } ---- bundled/ppl/support/configure.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/ppl/support/configure.pl 2018-11-17 17:48:40.682799980 -0700 -@@ -55,7 +55,7 @@ sub proceed { - } - if ($ppl_lib) { - if (-f "$ppl_lib/libppl.$Config::Config{so}") { -- $LDFLAGS = "-L$ppl_lib -Wl,-rpath,$ppl_lib"; -+ $LDFLAGS = "-L$ppl_lib"; - } elsif ("$ppl_lib/libppl.a") { - die "PPL found at $ppl_path is built without shared libraries.\n"; - } else { ---- bundled/singular/support/configure.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/singular/support/configure.pl 2018-11-17 17:48:40.682799980 -0700 +--- bundled/singular/support/configure.pl.orig 2019-02-12 16:05:25.000000000 -0700 ++++ bundled/singular/support/configure.pl 2019-03-06 18:52:58.220539366 -0700 @@ -42,7 +42,7 @@ sub singular_config_approach { # yes we need it twice ... chomp ($singular_prefix = `$singular_config --prefix`); @@ -166,19 +155,19 @@ chomp ($LIBS=`$pkg_config --libs-only-l Singular`); return $pc_singular_prefix; } ---- bundled/sympol/apps/polytope/src/build_flags.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/sympol/apps/polytope/src/build_flags.pl 2018-11-17 17:48:40.683799977 -0700 +--- bundled/sympol/apps/polytope/src/build_flags.pl.orig 2019-03-06 18:52:58.221539363 -0700 ++++ bundled/sympol/apps/polytope/src/build_flags.pl 2019-03-06 18:54:48.889192901 -0700 @@ -10,7 +10,7 @@ if ($ConfigFlags{'bundled.sympol.UseBund 'raycomputationcdd.cpp' => '-DGMPRATIONAL ${bundled.cdd.CFLAGS}', 'raycomputationlrs.cpp' => '-DGMP -DMA ${bundled.lrs.CFLAGS}', - $ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/ -- ? ( CXXFLAGS => '-I${root}/include/external/permlib' ) : (), -+ ? ( CXXFLAGS => '-I/usr/include/permlib' ) : (), + CXXFLAGS => '-Wno-shadow' . ($ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/ +- ? ' -I${root}/include/external/permlib' : ''), ++ ? ' -I/usr/include/permlib' : ''), }, ) } else { ---- bundled/sympol/support/configure.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ bundled/sympol/support/configure.pl 2018-11-17 17:48:40.683799977 -0700 +--- bundled/sympol/support/configure.pl.orig 2019-02-12 16:05:25.000000000 -0700 ++++ bundled/sympol/support/configure.pl 2019-03-06 18:52:58.221539363 -0700 @@ -146,6 +146,7 @@ int main() { undef $LIBS; $CXXFLAGS = '-I${root}/bundled/sympol/external/sympol'; @@ -187,9 +176,9 @@ $LIBS="-lsympol"; } ---- perl/polymake-config.orig 2018-11-01 08:13:59.000000000 -0600 -+++ perl/polymake-config 2018-11-17 17:54:11.965840946 -0700 -@@ -130,9 +130,6 @@ while (defined ($_=shift)) { +--- perl/polymake-config.orig 2019-02-12 16:05:25.000000000 -0700 ++++ perl/polymake-config 2019-03-06 18:52:58.222539360 -0700 +@@ -139,9 +139,6 @@ while (defined ($_=shift)) { } elsif ($_ eq "--ldflags") { my $ldflags=$ConfigFlags{LDFLAGS}; @@ -199,7 +188,7 @@ my $add_rpath=1; # collect standard library paths of the C++ compiler and exclude them from the result -@@ -154,9 +151,6 @@ while (defined ($_=shift)) { +@@ -163,9 +160,6 @@ while (defined ($_=shift)) { $ldflags="$ConfigFlags{ARCHFLAGS} $ldflags -flat_namespace"; } else { $ldflags .= " -Wl,-E"; @@ -208,19 +197,19 @@ - } } $ldflags=~s/^\s+//; $ldflags=~s/\s+$//; $ldflags=~s/\s{2,}/ /g; - if ($debug_asked=defined($debug)) { ---- support/configure.pl.orig 2018-11-01 08:13:59.000000000 -0600 -+++ support/configure.pl 2018-11-17 17:48:40.685799971 -0700 -@@ -456,7 +456,7 @@ sub parse_command_line { + +--- support/configure.pl.orig 2019-02-12 16:05:25.000000000 -0700 ++++ support/configure.pl 2019-03-06 18:55:42.626024657 -0700 +@@ -460,7 +460,7 @@ sub parse_command_line { } } - $CXXOPT =$vars{CXXOPT} // "-O3"; + $CXXOPT =$vars{CXXOPT} // "-O2"; - $CXXDEBUG =$vars{CXXDEBUG} // ""; + $CXXDEBUG =$vars{CXXDEBUG} // "-g"; $CFLAGS =$vars{CFLAGS} // ""; $CXXFLAGS =$vars{CXXFLAGS} // $CFLAGS; -@@ -670,7 +670,7 @@ sub determine_cxx_library { +@@ -688,7 +688,7 @@ sub determine_cxx_library { } $CFLAGS .= " -I$options{toolchain}/include"; $CXXFLAGS .= " -I$options{toolchain}/include"; @@ -229,7 +218,7 @@ } if ($options{libcxx} eq ".true.") { -@@ -1051,10 +1051,6 @@ sub locate_gmp_and_mpfr_libraries { +@@ -1073,10 +1073,6 @@ sub locate_gmp_and_mpfr_libraries { $CXXFLAGS .= " -I$GMP/include"; my $libdir=get_libdir($GMP, "gmp"); $LDFLAGS .= " -L$libdir"; @@ -240,7 +229,7 @@ } my $MPFR=$options{mpfr}; -@@ -1063,10 +1059,6 @@ sub locate_gmp_and_mpfr_libraries { +@@ -1085,10 +1081,6 @@ sub locate_gmp_and_mpfr_libraries { $CXXFLAGS .= " -I$MPFR/include"; my $libdir=get_libdir($MPFR, "mpfr"); $LDFLAGS .= " -L$libdir"; diff --git a/polymake-jupymake.patch b/polymake-jupymake.patch new file mode 100644 index 0000000..21801c6 --- /dev/null +++ b/polymake-jupymake.patch @@ -0,0 +1,23 @@ +--- resources/JuPyMake/JuPyMake.cpp.orig 2019-02-12 16:05:25.000000000 -0700 ++++ resources/JuPyMake/JuPyMake.cpp 2019-03-11 20:55:50.028569517 -0600 +@@ -137,12 +137,6 @@ struct module_state { + static struct module_state _state; + #endif + +-static PyObject * error_out(PyObject *m) { +- struct module_state *st = GETSTATE(m); +- PyErr_SetString(st->error, "something bad happened"); +- return NULL; +-} +- + static PyMethodDef JuPyMakeMethods[] = { + {"ExecuteCommand",(PyCFunction)ExecuteCommand, METH_VARARGS, + "Runs a polymake command"}, +@@ -200,7 +194,6 @@ extern "C" void initJuPyMake(void) + + if (module == NULL) + INITERROR; +- struct module_state *st = GETSTATE(module); + JuPyMakeError = PyErr_NewException(const_cast("JuPyMake.PolymakeError"), NULL, NULL ); + Py_INCREF( JuPyMakeError ); + diff --git a/polymake-latte.patch b/polymake-latte.patch index e733b92..7b96662 100644 --- a/polymake-latte.patch +++ b/polymake-latte.patch @@ -1,5 +1,5 @@ ---- apps/polytope/rules/latte.rules.orig 2018-02-16 03:27:51.000000000 -0700 -+++ apps/polytope/rules/latte.rules 2018-04-15 14:44:53.015053208 -0600 +--- apps/polytope/rules/latte.rules.orig 2019-02-12 16:05:25.000000000 -0700 ++++ apps/polytope/rules/latte.rules 2019-03-06 19:00:03.643216653 -0700 @@ -23,7 +23,7 @@ CREDIT latte custom $latte_count; diff --git a/polymake-no-hardening.patch b/polymake-no-hardening.patch index c413bab..79c6c1f 100644 --- a/polymake-no-hardening.patch +++ b/polymake-no-hardening.patch @@ -1,6 +1,6 @@ ---- support/configure.pl.orig 2018-11-17 17:48:40.685799971 -0700 -+++ support/configure.pl 2018-11-17 17:54:51.057727807 -0700 -@@ -976,6 +976,7 @@ int main() { +--- support/configure.pl.orig 2019-03-06 18:55:42.626024657 -0700 ++++ support/configure.pl 2019-03-06 18:59:33.784308363 -0700 +@@ -997,6 +997,7 @@ int main() { } $LDsharedFLAGS=$Config::Config{lddlflags}; @@ -8,7 +8,7 @@ if ($^O eq "darwin") { # MacOS magic again: remove multi-architecture options for fat binaries -@@ -1005,6 +1006,8 @@ int main() { +@@ -1026,6 +1027,8 @@ int main() { if ($options{callable} ne ".none.") { $LDcallableFLAGS="$LDsharedFLAGS $Config::Config{ldflags}"; @@ -17,20 +17,21 @@ $LDsonameFLAGS = "-Wl,-soname,"; } else { $LDcallableFLAGS="none"; -@@ -1668,10 +1671,15 @@ sub write_perl_specific_configuration_fi - $no_warn .= " -Wno-literal-suffix"; - } +@@ -1713,11 +1716,16 @@ sub write_perl_specific_configuration_fi + # Xcode 10 deeply hides perl headers at unpredictable locations, it requires a special clang option to find them + my $includePerlCore = defined($XcodeVersion) && v_cmp($XcodeVersion, "10.0") >= 0 && $Config::Config{perlpath} eq "/usr/bin/perl" ? "-iwithsysroot " : "-I"; + my $GlueFLAGS=$Config::Config{ccflags}; + $GlueFLAGS =~ s/ -specs=\\S+redhat-hardened-cc1//g; + my $PerlFLAGS=$Config::Config{ccdlflags}; + $PerlFLAGS =~ s/ -specs=\\S+redhat-hardened-ld//g; + $PerlFLAGS =~ s/ -Wl,-z,now//g; + print $conf <<"---"; PERL=$Config::Config{perlpath} --CXXglueFLAGS=-I$Config::Config{archlibexp}/CORE $Config::Config{ccflags} -DPerlVersion=$PerlVersion $no_warn +-CXXglueFLAGS=$includePerlCore$Config::Config{archlibexp}/CORE $Config::Config{ccflags} -DPerlVersion=$PerlVersion $no_warn -LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $Config::Config{ccdlflags} -+CXXglueFLAGS=-I$Config::Config{archlibexp}/CORE $GlueFLAGS -DPerlVersion=$PerlVersion $no_warn ++CXXglueFLAGS=$includePerlCore$Config::Config{archlibexp}/CORE $GlueFLAGS -DPerlVersion=$PerlVersion $no_warn +LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $PerlFLAGS ExtUtils=$Config::Config{privlib}/ExtUtils --- diff --git a/polymake-tempref.patch b/polymake-tempref.patch new file mode 100644 index 0000000..24ebbc4 --- /dev/null +++ b/polymake-tempref.patch @@ -0,0 +1,14 @@ +--- lib/core/include/Rational.h.orig 2019-02-12 16:05:25.000000000 -0700 ++++ lib/core/include/Rational.h 2019-03-09 10:38:40.991057582 -0700 +@@ -1351,9 +1351,9 @@ public: + return result; + } + friend +- Rational&& operator>> (Rational&& a, long k) ++ Rational operator>> (Rational&& a, long k) + { +- return std::move(a >> k); ++ return a >> k; + } + friend + Rational operator>> (const Rational& a, int k) diff --git a/polymake.spec b/polymake.spec index e691a9f..e122d49 100644 --- a/polymake.spec +++ b/polymake.spec @@ -7,8 +7,13 @@ # defined, else the plugin builds fail. %undefine _strict_symbol_defs_build -# Polymake installs python files into nonstandard locations -%global _python_bytecompile_extra 0 +# JuPyMake version and release numbers +%global jupymakever 0.8 +%global jupymakerel 1%{?dist} + +# jupyter-polymake version and release numbers +%global jupyterpmver 0.16 +%global jupyterpmrel 1%{?dist} # Build with the bundled version of jreality. This currently includes bundled # versions of several other Java projects (e.g., bsh, janino, jinput), and also @@ -16,8 +21,8 @@ %bcond_with jreality Name: polymake -Version: 3.2r4 -Release: 3%{?dist} +Version: 3.3 +Release: 1%{?dist} %global polydir %{_libdir}/%{name} %global majver %(cut -dr -f1 <<< %{version}) @@ -29,6 +34,9 @@ Source0: http://polymake.org/lib/exe/fetch.php/download/%{name}-%{version # 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 +# Fake polymake-config script to use while building the Jupyter packages. +# The real polymake-config is nonfunctional until it is installed. +Source2: %{name}-config # 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. @@ -37,6 +45,10 @@ Patch0: %{name}-fedora.patch Patch1: %{name}-no-hardening.patch # Fix detection of LattE Patch2: %{name}-latte.patch +# Do not return a reference to a temporary +Patch3: %{name}-tempref.patch +# Fix some warnings in the JuPyMake code +Patch4: %{name}-jupymake.patch %if %{with jreality} BuildRequires: ant @@ -76,36 +88,18 @@ BuildRequires: perl(XML::Writer) BuildRequires: permlib-devel BuildRequires: ppl-devel BuildRequires: python3-devel +BuildRequires: python3dist(ipykernel) +BuildRequires: python3dist(ipython) +BuildRequires: python3dist(jupyter-client) +BuildRequires: python3dist(pexpect) BuildRequires: Singular-devel BuildRequires: sympol-devel +BuildRequires: TOPCOM 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 @@ -120,7 +114,7 @@ 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 +%package singular Summary: Files needed to build Singular's polymake plugin %if %{with jreality} @@ -163,23 +157,66 @@ Provides: perl(Polymake::Core::ShellMock) Provides: perl(Polymake::Namespaces) Provides: perl(Polymake::Test::Validation) -%description singular +# 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\\\(X3d.*\\\) +%global __provides_exclude %{__provides_exclude}|perl\\\(application\\\) +%global __provides_exclude %{__provides_exclude}|perl\\\(namespaces\\\) + +# 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 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 +%package doc Summary: Documentation for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} -%description doc +%description doc This package contains documentation for %{name}. +%package -n python3-JuPyMake +Summary: Documentation for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Version: %{jupymakever} +Release: %{jupymakerel} + +%description -n python3-JuPyMake +This package contains a basic interface to call polymake from python. +It is intended for use in a Jupyter interface. + +%package jupyter +Summary: Jupyter kernel for %{name} +Requires: python-jupyter-filesystem +Requires: python3-JuPyMake = %{jupymakever}-%{jupymakerel} +License: WTFPL +Version: %{jupyterpmver} +Release: %{jupyterpmrel} +BuildArch: noarch + +%description jupyter +This package contains a Jupyter kernel for polymake. + %prep -%setup -q -n %{name}-%{majver} -%patch0 -b .fedora -%patch1 -%patch2 +%autosetup -p0 -n %{name}-%{majver} fixtimestamp() { touch -r $1.orig $1 @@ -191,12 +228,6 @@ 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 @@ -285,16 +316,44 @@ rm -fr %{buildroot}%{_datadir}/%{name}/apps/*/src 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/bin/polymake 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 +find %{buildroot}%{polydir} -name \*.so -exec chmod 0755 {} \+ + +# We install JuPyMake and jupyter-polymake in the python directories +rm -fr %{buildroot}%{_datadir}/%{name}/resources/{JuPyMake,jupyter-polymake} + +# We cannot build JuPyMake and jupyter-polymake until we have an installed tree +pushd resources/JuPyMake +export PATH=$PATH:$PWD +sed "s,@buildroot@,%{buildroot},;s,@libdir@,%{_libdir}," %{SOURCE2} \ + > polymake-config +chmod a+x polymake-config +%py3_build +%py3_install +rm polymake-config +popd + +pushd resources/jupyter-polymake +%py3_build +%py3_install +popd + +# Move the jupyter kernel files to where they should go +mkdir -p %{buildroot}%{_datadir}/jupyter/kernels/polymake +mv %{buildroot}%{python3_sitelib}/jupyter_kernel_polymake/resources/* \ + %{buildroot}%{_datadir}/jupyter/kernels/polymake +rmdir %{buildroot}%{python3_sitelib}/jupyter_kernel_polymake/resources + +# Since JuPyMake is executed once in the buildroot to move all the files where +# they are supposed to go, the buildroot string ends up in the debug file for +# JuPyMake, which makes the build fail. However: +# (1) No file other than the debug file contains a buildroot string; and +# (2) I don't know how to get it out of the debug file without doing +# significant damage to that file. +# So we do this instead: +export QA_SKIP_BUILD_ROOT=1 %files %{_bindir}/%{name} @@ -303,18 +362,54 @@ find %{buildroot}%{polydir} -name \*.so | xargs chmod 0755 %{_mandir}/man1/%{name}.1* %files singular +%license COPYING %{_bindir}/%{name}-config %{_includedir}/%{name}/ %{_libdir}/lib%{name}* %{_datadir}/%{name}/ -%{polydir}/ -%exclude %{polydir}/lib/ideal.so -%exclude %{polydir}/bundled/singular +%dir %{polydir}/ +%dir %{polydir}/bundled/ +%{polydir}/bundled/atint +%{polydir}/bundled/cdd +%{polydir}/bundled/libnormaliz +%{polydir}/bundled/lrs +%{polydir}/bundled/nauty +%{polydir}/bundled/ppl +%{polydir}/bundled/sympol +%{polydir}/config.ninja +%dir %{polydir}/lib/ +%{polydir}/lib/common.so +%{polydir}/lib/fan.so +%{polydir}/lib/fulton.so +%{polydir}/lib/graph.so +%{polydir}/lib/group.so +%{polydir}/lib/libpolymake-apps* +%{polydir}/lib/matroid.so +%{polydir}/lib/polytope.so +%{polydir}/lib/topaz.so +%{polydir}/lib/tropical.so +%{polydir}/perlx/ +%{polydir}/shared %files doc %doc doc/* +%files -n python3-JuPyMake +%doc resources/JuPyMake/example.py resources/JuPyMake/README.md +%license resources/JuPyMake/GPLv2 resources/JuPyMake/LICENSE +%{python3_sitearch}/JuPyMake* + +%files jupyter +%doc resources/jupyter-polymake/README.md +%license resources/jupyter-polymake/LICENSE +%{_datadir}/jupyter/kernels/%{name}/ +%{python3_sitelib}/jupyter_kernel_polymake* + %changelog +* Mon Mar 18 2019 Jerry James - 3.3-1 +- New upstream version +- Add python3-JuPyMake and -jupyter subpackages + * Sat Feb 02 2019 Fedora Release Engineering - 3.2r4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index 0f18235..eb36b0c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (polymake-3.2r4.tar.bz2) = 5179a3b9d812c51940c959ac315890bc73b899d4358ebc7b62ac0fca4c59982b3abf4868b3df4d7331f17c010a965a7870addbd9de6b0205ef9d77202e60ed1e +SHA512 (polymake-3.3.tar.bz2) = dfb48569df61860e622cbe5d3ab183ae0fc75e6eabd2ff77276df0543d927dd87e0c47923ea0ea303cec0b731da78422232d0bbe98b9b087022ade7b5117b2d6