[packages/bnlib] - new - ac patch fixes build with current autoconf - shared patch allows to build shared library

qboosh qboosh at pld-linux.org
Thu Jan 31 17:57:33 CET 2013


commit cc2f71ef021cc03bd2a67588b9203ba588c62103
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Jan 31 17:58:21 2013 +0100

    - new
    - ac patch fixes build with current autoconf
    - shared patch allows to build shared library

 bnlib-ac.patch     |  12 ++++
 bnlib-shared.patch | 167 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 bnlib.spec         | 105 +++++++++++++++++++++++++++++++++
 3 files changed, 284 insertions(+)
---
diff --git a/bnlib.spec b/bnlib.spec
new file mode 100644
index 0000000..33ee0d6
--- /dev/null
+++ b/bnlib.spec
@@ -0,0 +1,105 @@
+Summary:	BigNum multi-precision integer math library
+Summary(pl.UTF-8):	BigNum - biblioteka arytmetyki całkowitej wielokrotnej precyzji
+Name:		bnlib
+Version:	1.1.4
+Release:	1
+License:	GPL v2 or commercial
+Group:		Libraries
+Source0:	http://philzimmermann.com/bnlib/bnlib114.zip
+# Source0-md5:	1b4ff1e1f41c812db03a7c44b27d44ee
+Patch0:		%{name}-ac.patch
+Patch1:		%{name}-shared.patch
+URL:		http://philzimmermann.com/EN/bnlib/bnlib.html
+BuildRequires:	autoconf
+BuildRequires:	automake
+BuildRequires:	libtool
+BuildRequires:	unzip
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This is a multi-precision math library designed to be very portable,
+reasonably clean and easy to use, have very liberal bounds on the
+sizes of numbers that can be represented, but above all to perform
+extremely fast modular exponentiation. It has some limitations, such
+as representing positive numbers only, and supporting only odd moduli,
+which simplify it without impairing this ability.
+
+%description -l pl.UTF-8
+Ten pakiet zawiera bibliotekę matematyczną wielokrotnej precyzji,
+zaprojektowaną jako bardzo przenośna, w miarę przejrzysta i łatwa w
+użyciu, mająca liberalne ograniczenia na dopuszczalne rozmiary liczb,
+a przede wszystkim bardzo szybko wykonująca potęgowanie modulo. Ma
+pewne ograniczenia, takie jak reprezentowanie wyłącznie liczb
+dodatnich czy obsługa wyłącznie nieparzystych współczynników.
+
+%package devel
+Summary:	Header files for BigNum library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki BigNum
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+Header files for BigNum library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki BigNum.
+
+%package static
+Summary:	Static BigNum library
+Summary(pl.UTF-8):	Statyczna biblioteka BigNum
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static BigNum library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka BigNum.
+
+%prep
+%setup -q -c
+# sanitize first
+%{__rm} -r __MACOSX
+%{__mv} bnlib114/* .
+%{__rm} -r bnlib114
+%patch0 -p1
+%patch1 -p1 -b .orig
+
+# extract licensing information
+head -n29 legal.c > LEGAL
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%configure
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGES LEGAL README.bn bn.doc
+%attr(755,root,root) %{_libdir}/libbn.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libbn.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libbn.so
+%{_libdir}/libbn.la
+%{_includedir}/bn.h
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libbn.a
diff --git a/bnlib-ac.patch b/bnlib-ac.patch
new file mode 100644
index 0000000..e75fbcf
--- /dev/null
+++ b/bnlib-ac.patch
@@ -0,0 +1,12 @@
+--- bnlib-1.1.4/configure.in.orig	1999-04-22 19:51:58.000000000 +0200
++++ bnlib-1.1.4/configure.in	2013-01-31 15:59:12.546192377 +0100
+@@ -304,6 +304,9 @@
+ fi
+ # ^^ End of non-ANSI header brokenness tests (second part)
+ 
++ifdef([AC_OUTPUT_SUBDIRS],[],
++	[AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
++
+ AC_OUTPUT_SUBDIRS(test)
+ 
+ # The big bang!  Produce the output files.  This is config.cache, and
diff --git a/bnlib-shared.patch b/bnlib-shared.patch
new file mode 100644
index 0000000..e68b8e8
--- /dev/null
+++ b/bnlib-shared.patch
@@ -0,0 +1,167 @@
+--- bnlib-1.1.4/Makefile.in.orig	2000-08-03 05:37:09.000000000 +0200
++++ bnlib-1.1.4/Makefile.in	2013-01-31 17:19:03.019425863 +0100
+@@ -27,12 +27,18 @@
+ LDFLAGS	=@LDFLAGS@
+ LIBS=@LIBS@
+ RANLIB=@RANLIB@
++top_builddir=@top_builddir@
++LIBTOOL=@LIBTOOL@
++includedir=@includedir@
++libdir=@libdir@
+ 
+ # If you have a machine-specific assembly file, add it to AUXOBJS.
+ OBJS	= bn00.o lbn00.o bn.o lbnmem.o sieve.o prime.o \
+ 	  bnprint.o jacobi.o germain.o $(AUXOBJS)
+ 
+-BNLIB	= libbn.a 
++LTOBJS=$(OBJS:.o=.lo)
++
++BNLIB	= libbn.la
+ 
+ all: $(BNLIB) bntest germtest
+ 
+@@ -40,14 +46,13 @@
+ 	./bntest
+ 
+ bntest: bntest00.o $(BNLIB)
+-	$(LD) $(LDFLAGS) -o $@ bntest00.o $(BNLIB) $(LIBS)
++	$(LIBTOOL) --mode=link $(LD) $(LDFLAGS) $(CFLAGS) -o $@ bntest00.o $(BNLIB) $(LIBS)
+ 
+ germtest: germtest.o $(BNLIB)
+-	$(LD) $(LDFLAGS) -o $@ germtest.o $(BNLIB) $(LIBS)
++	$(LIBTOOL) --mode=link $(LD) $(LDFLAGS) $(CFLAGS) -o $@ germtest.o $(BNLIB) $(LIBS)
+ 
+-$(BNLIB): $(OBJS)
+-	$(AR) r $@ $?
+-	$(RANLIB) $@
++$(BNLIB): $(LTOBJS)
++	$(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $? -rpath $(libdir)
+ 
+ # Here we get tricky... if we're compiling with GCC, then GCCMAGIC1 and
+ # GCCMAGIC2 are set so that we actually do a link, but with the -r flag
+@@ -57,21 +62,9 @@
+ # has by far the most math in it, will have a call to every interesting
+ # support-library function.
+ 
+-lbn00.o: $(srcdir)/lbn00.c $(HDRS) config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ @GCCMAGIC1@ lbn00.c @GCCMAGIC2@
+-
+-lbn16.o: $(srcdir)/lbn16.c $(HDRS) config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ @GCCMAGIC1@ lbn16.c @GCCMAGIC2@
+-
+-lbn32.o: $(srcdir)/lbn32.c $(HDRS) config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ @GCCMAGIC1@ lbn32.c @GCCMAGIC2@
+-
+-lbn64.o: $(srcdir)/lbn64.c $(HDRS) config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ @GCCMAGIC1@ lbn64.c @GCCMAGIC2@
+-
+ # The default .o rule.
+-.c.o: config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ -c $<
++%.lo: %.c config.h
++	$(LIBTOOL) --mode=compile --tag=CC $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ -c $<
+ 
+ # Extra, non-obvious dependencies.  Bnlib can be compiled in three
+ # word sizes, and the *00.c files #include the right .c files based
+@@ -79,10 +72,10 @@
+ # subset of these files.  Duplicated here in case someone regenerates
+ # dependencies with cc -M and they get lost.
+ 
+-lbn00.o: lbn16.c lbn32.c lbn64.c lbn16.h lbn32.h lbn64.h 
+-bn00.o: bn16.c bn32.c bn64.c bn16.h bn32.h bn64.h \
++lbn00.lo: lbn16.c lbn32.c lbn64.c lbn16.h lbn32.h lbn64.h 
++bn00.lo: bn16.c bn32.c bn64.c bn16.h bn32.h bn64.h \
+   bninit16.c bninit32.c bninit64.c
+-bntest00.o: bntest16.c bntest32.c bntest64.c lbn16.h lbn32.h lbn64.h
++bntest00.lo: bntest16.c bntest32.c bntest64.c lbn16.h lbn32.h lbn64.h
+ 
+ # Actual build commented out to prevent confusion by people without autoconf.
+ # Do it manually for now.
+@@ -90,6 +83,11 @@
+ 	@echo "configure script is out of date; run autoconf"
+ #	autoconf
+ 
++install:
++	install -d $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
++	$(LIBTOOL) --mode=install install $(BNLIB) $(DESTDIR)$(libdir)
++	install -m644 bn.h $(DESTDIR)$(includedir)
++
+ clean:
+ 	$(RM) -f *.o *32.[ch] *64.[ch]
+ 
+@@ -128,36 +126,36 @@
+ 	@chmod a-w $@
+ 
+ ### Dependencies
+-bn.o: bn.c bn.h
+-bn00.o: bn00.c bnsize00.h lbn.h bn16.c bn32.c bn64.c lbn16.c lbn32.h \
++bn.lo: bn.c bn.h
++bn00.lo: bn00.c bnsize00.h lbn.h bn16.c bn32.c bn64.c lbn16.c lbn32.h \
+   lbn64.h lbnmem.h bn16.h bn32.h bn64.h bn.h kludge.h bninit16.c \
+   bninit32.c bninit64.c
+-bn16.o: bn16.c lbn.h lbn16.h lbnmem.h bn16.h bn.h kludge.h
+-bn32.o: bn32.c lbn.h lbn32.h lbnmem.h bn32.h bn.h kludge.h
+-bn64.o: bn64.c lbn.h lbn64.h lbnmem.h bn64.h bn.h kludge.h
+-bn68000.o: bn68000.c lbn.h lbn68000.h bn16.h bn32.h
+-bn8086.o: bn8086.c lbn.h bn64.h lbn8086.h bn32.h
+-bninit16.o: bninit16.c bn.h bn16.h
+-bninit32.o: bninit32.c bn.h bn32.h
+-bninit64.o: bninit64.c bn.h bn64.h
+-bnprint.o: bnprint.c bn.h bnprint.h kludge.h
+-bntest00.o: bntest00.c bnsize00.h lbn.h bntest16.c bntest32.c \
++bn16.lo: bn16.c lbn.h lbn16.h lbnmem.h bn16.h bn.h kludge.h
++bn32.lo: bn32.c lbn.h lbn32.h lbnmem.h bn32.h bn.h kludge.h
++bn64.lo: bn64.c lbn.h lbn64.h lbnmem.h bn64.h bn.h kludge.h
++bn68000.lo: bn68000.c lbn.h lbn68000.h bn16.h bn32.h
++bn8086.lo: bn8086.c lbn.h bn64.h lbn8086.h bn32.h
++bninit16.lo: bninit16.c bn.h bn16.h
++bninit32.lo: bninit32.c bn.h bn32.h
++bninit64.lo: bninit64.c bn.h bn64.h
++bnprint.lo: bnprint.c bn.h bnprint.h kludge.h
++bntest00.lo: bntest00.c bnsize00.h lbn.h bntest16.c bntest32.c \
+   bntest64.c cputime.h lbn16.h lbn32.h lbn64.h kludge.h
+-bntest16.o: bntest16.c cputime.h lbn16.h lbn.h kludge.h
+-bntest32.o: bntest32.c cputime.h lbn32.h lbn.h kludge.h
+-bntest64.o: bntest64.c cputime.h lbn64.h lbn.h kludge.h
+-germain.o: germain.c bn.h germain.h jacobi.h lbnmem.h sieve.h kludge.h
+-germtest.o: germtest.c bn.h germain.h sieve.h cputime.h bnprint.h
+-jacobi.o: jacobi.c bn.h jacobi.h
+-lbn00.o: lbn00.c bnsize00.h lbn.h lbn16.c lbn16.h lbn32.c lbn32.h \
++bntest16.lo: bntest16.c cputime.h lbn16.h lbn.h kludge.h
++bntest32.lo: bntest32.c cputime.h lbn32.h lbn.h kludge.h
++bntest64.lo: bntest64.c cputime.h lbn64.h lbn.h kludge.h
++germain.lo: germain.c bn.h germain.h jacobi.h lbnmem.h sieve.h kludge.h
++germtest.lo: germtest.c bn.h germain.h sieve.h cputime.h bnprint.h
++jacobi.lo: jacobi.c bn.h jacobi.h
++lbn00.lo: lbn00.c bnsize00.h lbn.h lbn16.c lbn16.h lbn32.c lbn32.h \
+   lbn64.c lbn64.h lbnmem.h kludge.h
+-lbn16.o: lbn16.c lbn.h lbn16.h lbnmem.h kludge.h
+-lbn32.o: lbn32.c lbn.h lbn32.h lbnmem.h kludge.h
+-lbn64.o: lbn64.c lbn.h lbn64.h lbnmem.h kludge.h
+-lbn68000.o: lbn68000.c lbn.h lbn68000.h
+-lbn68020.o: lbn68020.c lbn.h lbn68020.h
+-lbnmem.o: lbnmem.c lbn.h lbnmem.h kludge.h
+-lbnppc.o: lbnppc.c lbnppc.h ppcasm.h
+-prime.o: prime.c bn.h lbnmem.h prime.h sieve.h kludge.h
+-sieve.o: sieve.c bn.h sieve.h kludge.h
++lbn16.lo: lbn16.c lbn.h lbn16.h lbnmem.h kludge.h
++lbn32.lo: lbn32.c lbn.h lbn32.h lbnmem.h kludge.h
++lbn64.lo: lbn64.c lbn.h lbn64.h lbnmem.h kludge.h
++lbn68000.lo: lbn68000.c lbn.h lbn68000.h
++lbn68020.lo: lbn68020.c lbn.h lbn68020.h
++lbnmem.lo: lbnmem.c lbn.h lbnmem.h kludge.h
++lbnppc.lo: lbnppc.c lbnppc.h ppcasm.h
++prime.lo: prime.c bn.h lbnmem.h prime.h sieve.h kludge.h
++sieve.lo: sieve.c bn.h sieve.h kludge.h
+ sizetest.c: bnsize00.h
+--- bnlib-1.1.4/configure.in.orig	2013-01-31 16:00:34.612857334 +0100
++++ bnlib-1.1.4/configure.in	2013-01-31 16:22:09.572830343 +0100
+@@ -198,7 +198,7 @@
+ 
+ # Find "ranlib".  Sone systems don't have or need ranlib.  If so,
+ # ":" (do nothing) is used instead.
+-AC_PROG_RANLIB
++AC_PROG_LIBTOOL
+ 
+ dnl Checks for libraries.
+ dnl (we don't have any)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/bnlib.git/commitdiff/cc2f71ef021cc03bd2a67588b9203ba588c62103



More information about the pld-cvs-commit mailing list