--- libzn-poly-0.8.orig/debian/libzn-poly-0.8.install +++ libzn-poly-0.8/debian/libzn-poly-0.8.install @@ -0,0 +1 @@ +libzn_poly-*.so usr/lib --- libzn-poly-0.8.orig/debian/compat +++ libzn-poly-0.8/debian/compat @@ -0,0 +1 @@ +5 --- libzn-poly-0.8.orig/debian/rules +++ libzn-poly-0.8/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +DEB_CONFIGURE_NORMAL_ARGS = --gmp-prefix="/usr" --ntl-prefix="/usr" \ + --prefix="$(DEB_DESTDIR)/usr" --cflags="$(CFLAGS)" + +common-build-arch:: + +$(DEB_MAKE_INVOKE) libzn_poly.so --- libzn-poly-0.8.orig/debian/control +++ libzn-poly-0.8/debian/control @@ -0,0 +1,24 @@ +Source: libzn-poly +Section: math +Priority: optional +Maintainer: Tim Abbott +Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27), libgmp3-dev, libntl-dev, python +Homepage: http://math.harvard.edu/~dmharvey/zn_poly/ +Standards-Version: 3.8.0 + +Package: libzn-poly-0.8 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: A library for polynomial arithmetic in Z/nZ[x] + zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n + is any modulus that fits into an unsigned long. + +Package: libzn-poly-dev +Section: libdevel +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libzn-poly-0.8 +Description: A library for polynomial arithmetic in Z/nZ[x] + zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n + is any modulus that fits into an unsigned long. + --- libzn-poly-0.8.orig/debian/control.in +++ libzn-poly-0.8/debian/control.in @@ -0,0 +1,24 @@ +Source: libzn-poly +Section: math +Priority: optional +Maintainer: Tim Abbott +Build-Depends: @cdbs@, libgmp3-dev, libntl-dev, python +Homepage: http://math.harvard.edu/~dmharvey/zn_poly/ +Standards-Version: 3.8.0 + +Package: libzn-poly-0.8 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: A library for polynomial arithmetic in Z/nZ[x] + zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n + is any modulus that fits into an unsigned long. + +Package: libzn-poly-dev +Section: libdevel +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libzn-poly-0.8 +Description: A library for polynomial arithmetic in Z/nZ[x] + zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n + is any modulus that fits into an unsigned long. + --- libzn-poly-0.8.orig/debian/changelog +++ libzn-poly-0.8/debian/changelog @@ -0,0 +1,20 @@ +libzn-poly (0.8-1.1build1) precise; urgency=low + + * No-change rebuild against current pkgbinarymangler to fix broken + md5sums. (see LP #875466) + + -- Martin Pitt Wed, 29 Feb 2012 08:42:59 +0100 + +libzn-poly (0.8-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix gcc-4.5 FTBFS on mips, due to old assembly constraints usage + (Closes: #623598). + + -- Aurelien Jarno Mon, 9 May 2011 20:57:23 +0200 + +libzn-poly (0.8-1) unstable; urgency=low + + * Initial release (Closes: #480094). + + -- Tim Abbott Tue, 27 May 2008 20:23:43 -0400 --- libzn-poly-0.8.orig/debian/copyright +++ libzn-poly-0.8/debian/copyright @@ -0,0 +1,70 @@ +This package was debianized by Tim Abbott in 2008. + +It was downloaded from http://math.harvard.edu/~dmharvey/zn_poly/ + +Upstream Author: David Harvey + +Copyright (C) 2007, 2008, David Harvey + +License: + + This package is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 or + version 3 of the License. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General Public License +versions 2 and 3 can be found in `/usr/share/common-licenses/GPL-2' +and `/usr/share/common-licenses/GPL-3', respectively. + +The Debian packaging is (C) 2008, Tim Abbott and is +licensed under the GPL, see above. + +Licensing notes: + +zn_poly incorporates small amounts of code from other projects: + + (2a) + The file "wide_arith.h" includes some assembly macros from the file + "longlong.h" in GMP 4.2.1; see http://gmplib.org/. The copyright to this + code is held by the Free Software Foundation, and it was released under + "LGPL v2.1 or later": + + This package is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU Lesser General Public +License version 2.1 can be found in +`/usr/share/common-licenses/LGPL-2.1'. + + (2b) + The file "wide_arith.h" also includes assembly macros from the file + "SPMM_ASM.h" in NTL 5.4.1; see http://www.shoup.net/ntl/. The copyright + to this code is held by Victor Shoup, and it was released under "GPL v2 or + later", see above. + + (2c) + The filer "profiler.h" contains x86 cycle counting code from the file + "profiler.h" in FLINT 1.0; see http://www.flintlib.org/. The copyright + to this code is held by William Hart, and it was released under "GPL v2 or + later", see above. --- libzn-poly-0.8.orig/debian/libzn-poly-dev.install +++ libzn-poly-0.8/debian/libzn-poly-dev.install @@ -0,0 +1,3 @@ +debian/tmp/usr/include usr/ +debian/tmp/usr/lib/*.a usr/lib/ +libzn_poly.so usr/lib/ --- libzn-poly-0.8.orig/debian/patches/series +++ libzn-poly-0.8/debian/patches/series @@ -0,0 +1,2 @@ +zn_poly_soname.patch +gcc-4.5-mips.patch --- libzn-poly-0.8.orig/debian/patches/zn_poly_soname.patch +++ libzn-poly-0.8/debian/patches/zn_poly_soname.patch @@ -0,0 +1,101 @@ +Index: libzn-poly-0.8/makemakefile.py +=================================================================== +--- libzn-poly-0.8.orig/makemakefile.py 2008-06-02 13:20:05.000000000 -0400 ++++ libzn-poly-0.8/makemakefile.py 2008-06-02 13:22:56.000000000 -0400 +@@ -146,7 +146,7 @@ + print "\trm -f *.o" + print "\trm -f libzn_poly.a" + print "\trm -f libzn_poly.dylib" +-print "\trm -f libzn_poly.so" ++print "\trm -f libzn_poly*.so*" + print "\trm -f test" + print "\trm -f tune" + for x in prof_progs: +@@ -154,7 +154,9 @@ + print "\trm -f " + x + "-ntl" + for x in example_progs: + print "\trm -f " + x +- ++print ++print "distclean: clean" ++print "\trm -f makefile" + + print + print +@@ -164,11 +166,19 @@ + print "\tar -r libzn_poly.a $(LIBOBJS)" + print "\tranlib libzn_poly.a" + print +-print "libzn_poly.dylib: $(LIBOBJS)" ++print "libzn_poly.dylib: " ++print "\trm -f *.o" ++print "\tmake shobjs" + print "\t$(CC) -single_module -fPIC -dynamiclib -o libzn_poly.dylib $(LIBOBJS) $(LIBS)" + print +-print "libzn_poly.so: $(LIBOBJS)" +-print "\t$(CC) -shared -o libzn_poly.so $(LIBOBJS) $(LIBS)" ++print "libzn_poly.so: " ++print "\trm -f *.o" ++print "\tmake shobjs" ++print "\t$(CC) -fPIC -shared -Wl,-soname,lib`cat DIRNAME`.so -o lib`cat DIRNAME`.so $(LIBOBJS) $(LIBS)" ++print "\tln -s lib`cat DIRNAME`.so libzn_poly.so" ++print ++print "shobjs: $(LIBOBJS)" ++print "shobjs: FPICFLAG = -fPIC" + + print + print +@@ -183,16 +193,16 @@ + print + for x in prof_progs: + print "%s-main.o: %s-main.c $(HEADERS)" % (x, x) +- print "\t$(CC) $(CFLAGS) $(INCLUDES) -DNDEBUG -o %s-main.o -c %s-main.c" % (x, x) ++ print "\t$(CC) $(CFLAGS) $(FPICFLAG) $(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 "\t$(CC) $(CFLAGS) $(FPICFLAG) $(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) $(INCLUDES) -DPROFILE_NTL -DNDEBUG -o %s-main-ntl.o -c %s-main.c" % (x, x) ++ print "\t$(CC) $(CFLAGS) $(FPICFLAG) $(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$(CPP) $(CPPFLAGS) $(LDFLAGS) -o %s-ntl %s-main-ntl.o $(CPP_PROFOBJS) $(CPP_LIBS)" % (x, x) ++ print "\t$(CPP) $(CPPFLAGS) $(FPICFLAG) $(LDFLAGS) -o %s-ntl %s-main-ntl.o $(CPP_PROFOBJS) $(CPP_LIBS)" % (x, x) + print + + print +@@ -218,7 +228,7 @@ + for x in lib_modules + test_modules + testprof_modules + example_progs: + print + print "%s-DEBUG.o: %s.c $(HEADERS)" % (x, x) +- print "\t$(CC) -g $(CFLAGS) $(INCLUDES) -DDEBUG -o %s-DEBUG.o -c %s.c" % (x, x) ++ print "\t$(CC) -g $(CFLAGS) $(FPICFLAG) $(INCLUDES) -DDEBUG -o %s-DEBUG.o -c %s.c" % (x, x) + + print + print +@@ -226,7 +236,7 @@ + for x in lib_modules + prof_modules + testprof_modules + tune_modules + example_progs: + print + print "%s.o: %s.c $(HEADERS)" % (x, x) +- print "\t$(CC) $(CFLAGS) $(INCLUDES) -DNDEBUG -o %s.o -c %s.c" % (x, x) ++ print "\t$(CC) $(CFLAGS) $(FPICFLAG) $(INCLUDES) -DNDEBUG -o %s.o -c %s.c" % (x, x) + + print + print +@@ -234,7 +244,7 @@ + for x in cpp_prof_modules: + print + print "%s.o: %s.c $(HEADERS)" % (x, x) +- print "\t$(CPP) $(CPPFLAGS) $(CPP_INCLUDES) -DNDEBUG -o %s.o -c %s.c" % (x, x) ++ print "\t$(CPP) $(CPPFLAGS) $(FPICFLAG) $(CPP_INCLUDES) -DNDEBUG -o %s.o -c %s.c" % (x, x) + + + ### end of file +Index: libzn-poly-0.8/DIRNAME +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ libzn-poly-0.8/DIRNAME 2008-06-02 13:20:53.000000000 -0400 +@@ -0,0 +1 @@ ++zn_poly-0.8 --- libzn-poly-0.8.orig/debian/patches/gcc-4.5-mips.patch +++ libzn-poly-0.8/debian/patches/gcc-4.5-mips.patch @@ -0,0 +1,40 @@ +Since GCC 4.4 it's not possible anymore to use the 'h' constraints for +MIPS inline assembly code when doing a multiplication. That's why +libzn-poly fails to build from source on mips and mipsel. + +That said GCC supports 32x32 => 64 multiplication on 32-bit architectures +for a lot of time, so there is no need to use assembly code for that. +The patch below fixes the problem by using standard multiplication +instead of assembly code. I have also included the code for MIPS64 using +128-bit hints for reference, though it is not used in Debian. + +--- libzn-poly-0.8.orig/wide_arith.h ++++ libzn-poly-0.8/wide_arith.h +@@ -244,14 +244,23 @@ + #if (UNSIGNED_LONG_BITS == 32) + + #define ZNP_MUL_WIDE(hi, lo, a, b) \ +- __asm__ ("multu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b)); +- ++ do { \ ++ uint64_t result; \ ++ result = (uint64_t) a * b; \ ++ hi = (uint32_t)(result >> 32); \ ++ lo = (uint32_t) result; \ ++ } while (0); + + #elif (UNSIGNED_LONG_BITS == 64) + + #define ZNP_MUL_WIDE(hi, lo, a, b) \ +- __asm__ ("dmultu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b)); +- ++ do { \ ++ typedef unsigned int uint128_t __attribute__((mode(TI))); \ ++ uint128_t result; \ ++ result = (uint128_t) a * b; \ ++ hi = (uint64_t)(result >> 64); \ ++ lo = (uint64_t) result; \ ++ } while (0); + + #endif +