diff --git a/.gitignore b/.gitignore index fb0baeb..62b17f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -zn_poly-0.9.tar.gz +/zn_poly-*.tar.gz +/zn_poly-*.tar.bz2 diff --git a/sources b/sources index a168369..bb89e7e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0eeaae2524addf558de94bfbc914d22e zn_poly-0.9.tar.gz +SHA512 (zn_poly-0.9.1.tar.bz2) = 9c9d4b0f6b64be06802403a4cc1ec3ffd64dd450c3604179ea8661a10cc69b06a893dec48a8d1804ecf6194275358eda6e54a203ee70b1208ba7cc2b4dc83b5c diff --git a/zn_poly-python3.patch b/zn_poly-python3.patch new file mode 100644 index 0000000..cc8ab2a --- /dev/null +++ b/zn_poly-python3.patch @@ -0,0 +1,397 @@ +--- makemakefile.py.orig 2018-10-04 03:54:49.000000000 -0600 ++++ makemakefile.py 2018-10-07 20:53:52.853013713 -0600 +@@ -147,213 +147,213 @@ cpp_libs = libs + " -L" + ntl_lib_dir + + + import time + +-print "#" +-print "# Do not edit directly -- this file was auto-generated" +-print "# by makemakefile.py on " + time.strftime("%a, %d %b %Y %H:%M:%S +0000", +- time.gmtime()) +-print "#" +-print "# (makemakefile.py patched for Sage, 04/2012)" +-print ++print("#") ++print("# Do not edit directly -- this file was auto-generated") ++print("# by makemakefile.py on " + time.strftime("%a, %d %b %Y %H:%M:%S +0000", ++ time.gmtime())) ++print("#") ++print("# (makemakefile.py patched for Sage, 04/2012)") ++print() + +-print +-print "CC ?= gcc" +-print "CPP ?= cpp" +-print "CFLAGS = " + cflags +-print "CPPFLAGS = " + cppflags +-print "LDFLAGS = " + ldflags +-print "INCLUDES = " + includes # These are options to the C preprocessor. +-print "LIBS = " + libs # These are linker options passed to the compiler. +-print +-print "AR ?= ar" +-print "RANLIB ?= ranlib" +-print +-print "SHARED_FLAG ?= -shared" +-print "SONAME_FLAG ?= -soname" # '-h' for the Sun/Solaris linker ++print() ++print("CC ?= gcc") ++print("CPP ?= cpp") ++print("CFLAGS = " + cflags) ++print("CPPFLAGS = " + cppflags) ++print("LDFLAGS = " + ldflags) ++print("INCLUDES = " + includes) # These are options to the C preprocessor. ++print("LIBS = " + libs) # These are linker options passed to the compiler. ++print() ++print("AR ?= ar") ++print("RANLIB ?= ranlib") ++print() ++print("SHARED_FLAG ?= -shared") ++print("SONAME_FLAG ?= -soname") # '-h' for the Sun/Solaris linker + +-print +-print "CXX ?= g++" # The C++ compiler. +-print "CXXFLAGS = " + cxxflags # Options passed to the C++ compiler. +-print "CPP_INCLUDES = " + cpp_includes +-print "CPP_LIBS = " + cpp_libs ++print() ++print("CXX ?= g++") # The C++ compiler. ++print("CXXFLAGS = " + cxxflags) # Options passed to the C++ compiler. ++print("CPP_INCLUDES = " + cpp_includes) ++print("CPP_LIBS = " + cpp_libs) + +-print +-print "HEADERS = " + " ".join(install_headers + other_headers) +-print "LIBOBJS = " + " ".join([x + ".o" for x in lib_modules]) +-print "TESTOBJS = " + " ".join([x + "-DEBUG.o" for x in +- lib_modules + test_modules + testprof_modules]) +-print "PROFOBJS = " + " ".join([x + ".o" for x in +- lib_modules + prof_modules + noncpp_prof_modules + testprof_modules]) +-print "CPP_PROFOBJS = " + " ".join([x + ".o" for x in +- lib_modules + prof_modules + cpp_prof_modules + testprof_modules]) +-print "TUNEOBJS = " + " ".join([x + ".o" for x in ++print() ++print("HEADERS = " + " ".join(install_headers + other_headers)) ++print("LIBOBJS = " + " ".join([x + ".o" for x in lib_modules])) ++print("TESTOBJS = " + " ".join([x + "-DEBUG.o" for x in ++ lib_modules + test_modules + testprof_modules])) ++print("PROFOBJS = " + " ".join([x + ".o" for x in ++ lib_modules + prof_modules + noncpp_prof_modules + testprof_modules])) ++print("CPP_PROFOBJS = " + " ".join([x + ".o" for x in ++ lib_modules + prof_modules + cpp_prof_modules + testprof_modules])) ++print("TUNEOBJS = " + " ".join([x + ".o" for x in + lib_modules + tune_modules + testprof_modules + prof_modules + +- noncpp_prof_modules if x not in ("src/tuning", "profile/prof_main")]) +-print "ZN_POLY_TUNING = " + str(int(zn_poly_tuning)) +-print "ZN_POLY_VERSION = " + version +-print "ZN_POLY_ABI_VERSION = " + abi_version ++ noncpp_prof_modules if x not in ("src/tuning", "profile/prof_main")])) ++print("ZN_POLY_TUNING = " + str(int(zn_poly_tuning))) ++print("ZN_POLY_VERSION = " + version) ++print("ZN_POLY_ABI_VERSION = " + abi_version) + +-print +-print "all: libzn_poly.a" +-print +-print "test: test/test" +-print "tune: tune/tune" +-print +-print "check: test" +-print "\ttest/test -quick all" +-print +-print "install:" +-print "\tmkdir -p %s/include/zn_poly" % prefix +-print "\tmkdir -p %s/lib" % prefix +-print "\tcp libzn_poly.a %s/lib" % prefix +-print "\tcp include/zn_poly.h %s/include/zn_poly" % prefix +-print "\tcp include/wide_arith.h %s/include/zn_poly" % prefix +-print +-print "clean:" +-print "\trm -f *.o" +-print "\trm -f test/*.o" +-print "\trm -f profile/*.o" +-print "\trm -f tune/*.o" +-print "\trm -f src/tuning.c" +-print "\trm -f src/*.o" +-print "\trm -f demo/bernoulli/*.o" +-print "\trm -f libzn_poly.a" +-print "\trm -f libzn_poly.dylib" +-print "\trm -f libzn_poly*.so*" +-print "\trm -f libzn_poly*.dll.a" +-print "\trm -f cygzn_poly.dll" +-print "\trm -f test/test" +-print "\trm -f tune/tune" ++print() ++print("all: libzn_poly.a") ++print() ++print("test: test/test") ++print("tune: tune/tune") ++print() ++print("check: test") ++print("\ttest/test -quick all") ++print() ++print("install:") ++print("\tmkdir -p %s/include/zn_poly" % prefix) ++print("\tmkdir -p %s/lib" % prefix) ++print("\tcp libzn_poly.a %s/lib" % prefix) ++print("\tcp include/zn_poly.h %s/include/zn_poly" % prefix) ++print("\tcp include/wide_arith.h %s/include/zn_poly" % prefix) ++print() ++print("clean:") ++print("\trm -f *.o") ++print("\trm -f test/*.o") ++print("\trm -f profile/*.o") ++print("\trm -f tune/*.o") ++print("\trm -f src/tuning.c") ++print("\trm -f src/*.o") ++print("\trm -f demo/bernoulli/*.o") ++print("\trm -f libzn_poly.a") ++print("\trm -f libzn_poly.dylib") ++print("\trm -f libzn_poly*.so*") ++print("\trm -f libzn_poly*.dll.a") ++print("\trm -f cygzn_poly.dll") ++print("\trm -f test/test") ++print("\trm -f tune/tune") + for x in prof_progs: +- print "\trm -f " + x +- print "\trm -f " + x + "-ntl" ++ print("\trm -f " + x) ++ print("\trm -f " + x + "-ntl") + for x in demo_progs: +- print "\trm -f " + x +-print +-print "distclean: clean" +-print "\trm -f makefile" +-print +-print "dist: distclean" +-print "\ttar --exclude-vcs --exclude=.gitignore -czf zn_poly-$(ZN_POLY_VERSION).tar.gz *" ++ print("\trm -f " + x) ++print() ++print("distclean: clean") ++print("\trm -f makefile") ++print() ++print("dist: distclean") ++print("\ttar --exclude-vcs --exclude=.gitignore -czf zn_poly-$(ZN_POLY_VERSION).tar.gz *") + + +-print +-print +-print "##### library targets" +-print +-print "ifeq ($(ZN_POLY_TUNING), 1)" +-print "src/tuning.c: tune/tune" +-print "\ttune/tune > src/tuning.c" +-print "else" +-print "src/tuning.c: tune/tuning.c" +-print "\tcp tune/tuning.c src/tuning.c" +-print "endif" +-print +-print "libzn_poly.a: $(LIBOBJS)" +-print "\t$(AR) -r libzn_poly.a $(LIBOBJS)" +-print "\t$(RANLIB) libzn_poly.a" +-print +-print "# TODO: Put '-single_module -fPIC -dynamiclib' into $(SHARED_FLAG)" +-print "# and use that; also support $(SO_EXTENSION)..." +-print "libzn_poly.dylib: $(LIBOBJS)" +-print "\t$(CC) $(LDFLAGS) -single_module -fPIC -dynamiclib -o libzn_poly.dylib " \ +- "$(LIBOBJS) $(LIBS)" +-print +-print "# Left for compatibility with previous versions of Sage's 'spkg-install':" +-print "libzn_poly.dylib64: $(LIBOBJS)" +-print "\t$(CC) -m64 -single_module -fPIC -dynamiclib -o libzn_poly.dylib $(LIBOBJS) $(LIBS)" +-print +-print "cygzn_poly.dll: $(LIBOBJS)" +-print "\t$(CC) $(SHARED_FLAG) $(LDFLAGS) " \ ++print() ++print() ++print("##### library targets") ++print() ++print("ifeq ($(ZN_POLY_TUNING), 1)") ++print("src/tuning.c: tune/tune") ++print("\ttune/tune > src/tuning.c") ++print("else") ++print("src/tuning.c: tune/tuning.c") ++print("\tcp tune/tuning.c src/tuning.c") ++print("endif") ++print() ++print("libzn_poly.a: $(LIBOBJS)") ++print("\t$(AR) -r libzn_poly.a $(LIBOBJS)") ++print("\t$(RANLIB) libzn_poly.a") ++print() ++print("# TODO: Put '-single_module -fPIC -dynamiclib' into $(SHARED_FLAG)") ++print("# and use that; also support $(SO_EXTENSION)...") ++print("libzn_poly.dylib: $(LIBOBJS)") ++print("\t$(CC) $(LDFLAGS) -single_module -fPIC -dynamiclib -o libzn_poly.dylib " \ ++ "$(LIBOBJS) $(LIBS)") ++print() ++print("# Left for compatibility with previous versions of Sage's 'spkg-install':") ++print("libzn_poly.dylib64: $(LIBOBJS)") ++print("\t$(CC) -m64 -single_module -fPIC -dynamiclib -o libzn_poly.dylib $(LIBOBJS) $(LIBS)") ++print() ++print("cygzn_poly.dll: $(LIBOBJS)") ++print("\t$(CC) $(SHARED_FLAG) $(LDFLAGS) " \ + "-Wl,--out-implib,libzn_poly-$(ZN_POLY_VERSION).dll.a " \ +- "-o cygzn_poly.dll $(LIBOBJS) $(LIBS)" +-print +-print "libzn_poly-$(ZN_POLY_VERSION).dll.a: cygzn_poly.dll" +-print +-print "libzn_poly.dll.a: libzn_poly-$(ZN_POLY_VERSION).dll.a" +-print "\tln -sf libzn_poly-$(ZN_POLY_VERSION).dll.a libzn_poly.dll.a" +-print "\tln -sf libzn_poly-$(ZN_POLY_VERSION).dll.a libzn_poly-$(ZN_POLY_ABI_VERSION).dll.a" +-print +-print "libzn_poly.so: libzn_poly-$(ZN_POLY_VERSION).so" +-print "\tln -sf libzn_poly-$(ZN_POLY_VERSION).so libzn_poly.so" +-print "\tln -sf libzn_poly-$(ZN_POLY_VERSION).so libzn_poly-$(ZN_POLY_ABI_VERSION).so" ++ "-o cygzn_poly.dll $(LIBOBJS) $(LIBS)") ++print() ++print("libzn_poly-$(ZN_POLY_VERSION).dll.a: cygzn_poly.dll") ++print() ++print("libzn_poly.dll.a: libzn_poly-$(ZN_POLY_VERSION).dll.a") ++print("\tln -sf libzn_poly-$(ZN_POLY_VERSION).dll.a libzn_poly.dll.a") ++print("\tln -sf libzn_poly-$(ZN_POLY_VERSION).dll.a libzn_poly-$(ZN_POLY_ABI_VERSION).dll.a") ++print() ++print("libzn_poly.so: libzn_poly-$(ZN_POLY_VERSION).so") ++print("\tln -sf libzn_poly-$(ZN_POLY_VERSION).so libzn_poly.so") ++print("\tln -sf libzn_poly-$(ZN_POLY_VERSION).so libzn_poly-$(ZN_POLY_ABI_VERSION).so") + +-print +-print "libzn_poly-$(ZN_POLY_VERSION).so: $(LIBOBJS)" +-print "\t$(CC) $(SHARED_FLAG) $(LDFLAGS) -Wl,-soname,libzn_poly-$(ZN_POLY_ABI_VERSION).so " \ +- "-o libzn_poly-$(ZN_POLY_VERSION).so $(LIBOBJS) $(LIBS)" ++print() ++print("libzn_poly-$(ZN_POLY_VERSION).so: $(LIBOBJS)") ++print("\t$(CC) $(SHARED_FLAG) $(LDFLAGS) -Wl,-soname,libzn_poly-$(ZN_POLY_ABI_VERSION).so " \ ++ "-o libzn_poly-$(ZN_POLY_VERSION).so $(LIBOBJS) $(LIBS)") + +-print +-print +-print "##### test program" +-print +-print "test/test: $(TESTOBJS) $(HEADERS)" +-print "\t$(CC) -g $(LDFLAGS) -o test/test $(TESTOBJS) $(LIBS)" ++print() ++print() ++print("##### test program") ++print() ++print("test/test: $(TESTOBJS) $(HEADERS)") ++print("\t$(CC) -g $(LDFLAGS) -o test/test $(TESTOBJS) $(LIBS)") + +-print +-print +-print "##### profiling programs" +-print ++print() ++print() ++print("##### profiling programs") ++print() + for x in prof_progs: +- print "%s-main.o: %s-main.c $(HEADERS)" % (x, x) +- print "\t$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -DNDEBUG -o %s-main.o -c %s-main.c" \ +- % (x, x) +- print +- print "%s: %s-main.o $(PROFOBJS)" % (x, x) +- print "\t$(CC) $(CFLAGS) $(LDFLAGS) -o %s %s-main.o $(PROFOBJS) $(LIBS)" \ +- % (x, x) +- print +- print "%s-main-ntl.o: %s-main.c $(HEADERS)" % (x, x) +- print "\t$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -DPROFILE_NTL -DNDEBUG " \ +- "-o %s-main-ntl.o -c %s-main.c" % (x, x) +- print +- print "%s-ntl: %s-main-ntl.o $(CPP_PROFOBJS)" % (x, x) +- print "\t$(CXX) $(CXXFLAGS) $(LDFLAGS) -o %s-ntl %s-main-ntl.o " \ +- "$(CPP_PROFOBJS) $(CPP_LIBS)" % (x, x) +- print ++ print("%s-main.o: %s-main.c $(HEADERS)" % (x, x)) ++ print("\t$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -DNDEBUG -o %s-main.o -c %s-main.c" \ ++ % (x, x)) ++ print() ++ print("%s: %s-main.o $(PROFOBJS)" % (x, x)) ++ print("\t$(CC) $(CFLAGS) $(LDFLAGS) -o %s %s-main.o $(PROFOBJS) $(LIBS)" \ ++ % (x, x)) ++ print() ++ print("%s-main-ntl.o: %s-main.c $(HEADERS)" % (x, x)) ++ print("\t$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -DPROFILE_NTL -DNDEBUG " \ ++ "-o %s-main-ntl.o -c %s-main.c" % (x, x)) ++ print() ++ print("%s-ntl: %s-main-ntl.o $(CPP_PROFOBJS)" % (x, x)) ++ print("\t$(CXX) $(CXXFLAGS) $(LDFLAGS) -o %s-ntl %s-main-ntl.o " \ ++ "$(CPP_PROFOBJS) $(CPP_LIBS)" % (x, x)) ++ print() + +-print +-print +-print "##### tuning utility" +-print +-print "tune/tune: $(TUNEOBJS)" +-print "\t$(CC) $(CFLAGS) $(LDFLAGS) -o tune/tune $(TUNEOBJS) $(LIBS)" ++print() ++print() ++print("##### tuning utility") ++print() ++print("tune/tune: $(TUNEOBJS)") ++print("\t$(CC) $(CFLAGS) $(LDFLAGS) -o tune/tune $(TUNEOBJS) $(LIBS)") + + +-print +-print +-print "##### demo programs" ++print() ++print() ++print("##### demo programs") + for x in demo_progs: +- print +- print "%s: %s.o $(LIBOBJS)" % (x, x) +- print "\t$(CC) $(CFLAGS) $(LDFLAGS) -o %s %s.o $(LIBOBJS) $(LIBS)" % (x, x) ++ print() ++ print("%s: %s.o $(LIBOBJS)" % (x, x)) ++ print("\t$(CC) $(CFLAGS) $(LDFLAGS) -o %s %s.o $(LIBOBJS) $(LIBS)" % (x, x)) + + +-print +-print +-print "##### object files (with debug code)" ++print() ++print() ++print("##### object files (with debug code)") + for x in lib_modules + test_modules + testprof_modules + demo_progs: +- print +- print "%s-DEBUG.o: %s.c $(HEADERS)" % (x, x) +- print "\t$(CC) -g $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -DDEBUG -o %s-DEBUG.o -c %s.c" \ +- % (x, x) ++ print() ++ print("%s-DEBUG.o: %s.c $(HEADERS)" % (x, x)) ++ print("\t$(CC) -g $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -DDEBUG -o %s-DEBUG.o -c %s.c" \ ++ % (x, x)) + +-print +-print +-print "##### object files (no debug code)" ++print() ++print() ++print("##### object files (no debug code)") + for x in lib_modules + prof_modules + testprof_modules + \ + tune_modules + demo_progs: +- print +- print "%s.o: %s.c $(HEADERS)" % (x, x) +- print "\t$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -DNDEBUG -o %s.o -c %s.c" % (x, x) ++ print() ++ print("%s.o: %s.c $(HEADERS)" % (x, x)) ++ print("\t$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -DNDEBUG -o %s.o -c %s.c" % (x, x)) + +-print +-print +-print "##### object files (C++, no debug code)" ++print() ++print() ++print("##### object files (C++, no debug code)") + for x in cpp_prof_modules: +- print +- print "%s.o: %s.c $(HEADERS)" % (x, x) +- print "\t$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(CPP_INCLUDES) -DNDEBUG -o %s.o -c %s.c" \ +- % (x, x) ++ print() ++ print("%s.o: %s.c $(HEADERS)" % (x, x)) ++ print("\t$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(CPP_INCLUDES) -DNDEBUG -o %s.o -c %s.c" \ ++ % (x, x)) + + + ### end of file diff --git a/zn_poly.spec b/zn_poly.spec index 74c6f7b..a47db6c 100644 --- a/zn_poly.spec +++ b/zn_poly.spec @@ -1,16 +1,21 @@ Name: zn_poly -Version: 0.9 -Release: 19%{?dist}.2 +Version: 0.9.1 +Release: 1%{?dist} Summary: C library for polynomial arithmetic Group: Development/Libraries -# see COPYING to see, which file has which license +# All files released under "GPLv2 or GPLv3", except: +# - include/wide_arith.h is part LGPLv2+ and part GPLv2+ +# - include/profiler.h is part GPLv2+ License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ -URL: http://cims.nyu.edu/~harvey/code/zn_poly/ -Source0: http://cims.nyu.edu/~harvey/code/zn_poly/releases/zn_poly-%{version}.tar.gz +URL: https://gitlab.com/sagemath/%{name} +Source0: https://gitlab.com/sagemath/%{name}/-/archive/%{version}/%{name}-%{version}.tar.bz2 +# Adapt the makefile generator to python 3 +Patch0: %{name}-python3.patch -BuildRequires: python2 +BuildRequires: gcc BuildRequires: gmp-devel +BuildRequires: python3 %description zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is @@ -21,6 +26,7 @@ any modulus that fits into an unsigned long. Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} + %description devel zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is any modulus that fits into an unsigned long. @@ -40,23 +46,21 @@ This package contains the static library. %prep -%setup -q +%autosetup -p0 sed -i "s|typedef unsigned long ulong;|\/\/typedef unsigned long ulong;|g" include/zn_poly.h %build -python makemakefile.py --cflags="%{optflags} -fPIC" --prefix=%{_prefix} \ +python3 makemakefile.py --cflags="%{optflags} -fPIC" --prefix=%{_prefix} \ --gmp-prefix=%{_prefix} \ - --ntl-prefix=%{_prefix} \ - --flint-prefix=%{_prefix} \ + --disable-tuning \ > makefile make all libzn_poly.so libzn_poly-%{version}.so %{?_smp_mflags} %install -rm -rf %{buildroot} # install manually, because makefile does not honor DESTDIR mkdir -p %{buildroot}%{_includedir}/zn_poly/ mkdir -p %{buildroot}%{_libdir} @@ -74,15 +78,14 @@ make test ./test/test all -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig - +%ldconfig_scriptlets %files %doc COPYING gpl-?.0.txt %doc demo/bernoulli/bernoulli.c doc/REFERENCES %{_libdir}/libzn_poly-%{version}.so +%{_libdir}/libzn_poly-0.9.so %files devel @@ -95,6 +98,12 @@ make test %changelog +* Mon Oct 8 2018 Jerry James - 0.9.1-1 +- Switch to sagemath gitlab repository URLs +- New 0.9.1 release +- Use python3 instead of python2 to generate the makefile +- Minor specfile cleanups for recent guidelines changes + * Sat Jul 14 2018 Fedora Release Engineering - 0.9-19.2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild