[ratpoints] Initial import (#817981).

pcpa pcpa at fedoraproject.org
Sat May 19 19:03:54 UTC 2012


commit eacaec568b1d74c5f91743f42da94212c429d1cb
Author: pcpa <paulo.cesar.pereira.de.andrade at gmail.com>
Date:   Sat May 19 16:03:47 2012 -0300

    Initial import (#817981).

 .gitignore             |    1 +
 ratpoints-shared.patch |   86 +++++++++++++++++++++++++++++++++++++++++++++
 ratpoints.1            |   28 +++++++++++++++
 ratpoints.spec         |   91 ++++++++++++++++++++++++++++++++++++++++++++++++
 sources                |    1 +
 5 files changed, 207 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..bd40219 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ratpoints-2.1.3.tar.gz
diff --git a/ratpoints-shared.patch b/ratpoints-shared.patch
new file mode 100644
index 0000000..e8a34d5
--- /dev/null
+++ b/ratpoints-shared.patch
@@ -0,0 +1,86 @@
+diff -up ratpoints-2.1.3/Makefile.orig ratpoints-2.1.3/Makefile
+--- ratpoints-2.1.3/Makefile.orig	2012-05-01 20:38:42.990234312 -0300
++++ ratpoints-2.1.3/Makefile	2012-05-01 20:38:44.851234426 -0300
+@@ -21,17 +21,22 @@
+ #
+ #    Michael Stoll, September 21, 2009
+ 
++MAJOR=0
+ PRIME_SIZE = 7
+ 
+ CC = gcc
+ RM = rm -f
+ INSTALL = cp
+ 
+-INSTALL_DIR = /usr/local
++PREFIX=/usr
++BINDIR=/usr/bin
++INCDIR=/usr/include
++LIBDIR=/usr/lib
++INSTALL=install
+ 
+-CCFLAGS1 = -Wall -O2 -fomit-frame-pointer -DRATPOINTS_MAX_BITS_IN_PRIME=${PRIME_SIZE} -DUSE_SSE
++CCFLAGS1 = -Wall -O2 -fomit-frame-pointer -DRATPOINTS_MAX_BITS_IN_PRIME=${PRIME_SIZE} -fPIC
+ # for gcc on Apple, may have to add '-fnested-functions' to CCFLAGS1
+-CCFLAGS2 = -lgmp -lgcc -lc -lm
++CCFLAGS2 = -lgmp -lm
+ CCFLAGS3 = -L. -lratpoints
+ CCFLAGS = 
+ 
+@@ -47,9 +52,9 @@ TEMPFILES = sift.o init.o sturm.o find_p
+             gen_find_points_h gen_init_sieve_h \
+             rptest.out sift-debug.o find_points-debug.o main.o
+ 
+-TARGETFILES = ratpoints libratpoints.a rptest ratpoints-debug
++TARGETFILES = ratpoints libratpoints.so.$(MAJOR) rptest ratpoints-debug
+ 
+-all: ratpoints libratpoints.a
++all: ratpoints libratpoints.so.$(MAJOR)
+ 
+ test: rptest testbase
+ 	time ./rptest > rptest.out
+@@ -57,14 +62,13 @@ test: rptest testbase
+ 	cmp -s testbase rptest.out || echo "Test failed!"
+ 
+ install-bin: ratpoints
+-	${INSTALL} ratpoints ${INSTALL_DIR}/bin/
+-	chmod 755 ${INSTALL_DIR}/bin/ratpoints
++	${INSTALL} -D -m755 ratpoints ${DESTDIR}${BINDIR}/ratpoints
+ 
+-install-lib: ratpoints.h libratpoints.a
+-	${INSTALL} ratpoints.h ${INSTALL_DIR}/include/
+-	chmod 644 ${INSTALL_DIR}/include/ratpoints.h
+-	${INSTALL} libratpoints.a ${INSTALL_DIR}/lib/
+-	chmod 644 ${INSTALL_DIR}/lib/libratpoints.a
++install-lib: ratpoints.h libratpoints.so.$(MAJOR)
++	${INSTALL} -D -m644 ratpoints.h ${DESTDIR}${INCDIR}/ratpoints.h
++	${INSTALL} -d ${DESTDIR}${LIBDIR}
++	${INSTALL} -m755 libratpoints.so.$(MAJOR) ${DESTDIR}${LIBDIR}
++	ln -s libratpoints.so.$(MAJOR)  ${DESTDIR}${LIBDIR}/libratpoints.so
+ 
+ install: install-bin install-lib
+ 
+@@ -83,10 +87,11 @@ distclean: clean
+ 
+ debug: ratpoints-debug
+ 
+-libratpoints.a: sift.o init.o sturm.o find_points.o
+-	ar rs libratpoints.a sift.o init.o sturm.o find_points.o
++libratpoints.so.$(MAJOR): sift.o init.o sturm.o find_points.o
++	gcc -shared -o libratpoints.so.$(MAJOR) -Wl,-soname=libratpoints.so.$(MAJOR) sift.o init.o sturm.o find_points.o
++	ln -s libratpoints.so.$(MAJOR) libratpoints.so
+ 
+-ratpoints: libratpoints.a main.c ratpoints.h
++ratpoints: libratpoints.so.$(MAJOR) main.c ratpoints.h
+ 	${CC} main.c -o ratpoints ${CCFLAGS1} ${CCFLAGS2} ${CCFLAGS3} ${CCFLAGS}
+ 
+ main.o: main.c ratpoints.h
+@@ -123,7 +128,7 @@ find_points.o: find_points.c ratpoints.h
+ find_points-debug.o: find_points.c ratpoints.h rp-private.h primes.h find_points.h
+ 	${CC} find_points.c -c -o find_points-debug.o ${CCFLAGS1} -DDEBUG ${CCFLAGS}
+ 
+-rptest: libratpoints.a rptest.c ratpoints.h testdata.h
++rptest: libratpoints.so.$(MAJOR) rptest.c ratpoints.h testdata.h
+ 	${CC} rptest.c -o rptest ${CCFLAGS1} ${CCFLAGS2} ${CCFLAGS3} ${CCFLAGS}
+ 
+ gen_init_sieve_h: gen_init_sieve_h.c ratpoints.h rp-private.h primes.h
diff --git a/ratpoints.1 b/ratpoints.1
new file mode 100644
index 0000000..3223521
--- /dev/null
+++ b/ratpoints.1
@@ -0,0 +1,28 @@
+.TH RATPOINTS "1" "May 2012" "ratpoints 2.1.3" "User Commands"
+.SH NAME
+ratpoints \- manual page for ratpoints 2.1.3
+.SH SYNOPSIS
+.B ratpoints
+\fI'a_0 a_1 \fR... \fIa_n' max_height\fR ...
+.SH OPTIONS
+[\-dl low_den] [\-du up_den]
+[\-f format] [\-fs str] [\-fm str] [\-fe str] [\-y] [\-Y]
+[[\-l low1] \fB\-u\fR up1 ... \fB\-l\fR lown [\-u upn]]
+[\-n num_primes1] [\-N num_primes2] [\-p max_primes]
+[\-F max_forbidden] [\-s] [\-S [iter]]
+[\-q] [\-v] [\-z] [\-Z] [\-1] [\-i] [\-I]
+[\-k] [\-K] [\-j] [\-J] [\-x] [\-X]
+.SH COPYRIGHT
+This is ratpoints\-2.1.3 Copyright (C) 2008,2009 by Michael Stoll.
+.PP
+This program comes with ABSOLUTELY NO WARRANTY.
+This is free software, and you are welcome to redistribute it under the
+terms of the GNU General Public License version 2 or later.
+.PP
+Please acknowledge use of this program in published work.
+.IP
+.SH "SEE ALSO"
+The full documentation for
+.B ratpoints
+is installed at
+.I /usr/share/doc/ratpoints-2.1.3/ratpoints-doc.pdf
diff --git a/ratpoints.spec b/ratpoints.spec
new file mode 100644
index 0000000..c3f6ef9
--- /dev/null
+++ b/ratpoints.spec
@@ -0,0 +1,91 @@
+%global major	0
+
+%ifarch x86_64
+%global use_sse -DUSE_SSE
+%else
+%global use_sse %{nil}
+%endif
+
+Name:		ratpoints
+Version:	2.1.3
+Release:	5%{?dist}
+Summary:	Find rational points on hyperelliptic curves
+Group:		Applications/Engineering
+License:	GPLv2+
+URL:		http://www.mathe2.uni-bayreuth.de/stoll/programs/
+Source0:	http://www.mathe2.uni-bayreuth.de/stoll/programs/%{name}-%{version}.tar.gz
+# Initially generated with help2man as:
+# LD_LIBRARY_PATH=$PWD: help2man --section=1 --no-info \
+#    --version-string="%%{version}" \
+#    -o $RPM_BUILD_ROOT/%%{_mandir}/man1/ratpoints.1 ./ratpoints
+# but edited for better formatting.
+Source1:	%{name}.1
+BuildRequires:	gmp-devel
+Patch0:		%{name}-shared.patch
+
+%description
+Ratpoints is a program that uses an optimized quadratic sieve algorithm
+in order to find rational points on hyperelliptic curves.
+
+%package	devel
+Summary:	Development files for %{name}
+Group:		Development/Libraries
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+
+%description	devel
+Header and library for development with %{name}.
+
+%prep
+%setup -q
+%patch0 -p1
+
+sed -e "s/-Wall -O2 -fomit-frame-pointer/%{optflags} %{use_sse}/" \
+   -e "s/-shared/& $RPM_LD_FLAGS -lgmp -lm/" \
+   -i Makefile
+
+%build
+make %{?_smp_mflags}
+
+%install
+make install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
+install -p -D -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_mandir}/man1/%{name}.1
+
+%check
+LD_LIBRARY_PATH=$PWD: make test
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%doc gpl-2.0.txt
+%doc ratpoints-doc.pdf
+%{_bindir}/ratpoints
+%{_libdir}/libratpoints.so.%{major}
+%{_mandir}/man1/ratpoints.1*
+
+%files		devel
+%{_includedir}/ratpoints.h
+%{_libdir}/libratpoints.so
+
+%changelog
+* Thu May 10 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 2.1.3-5
+- Revert technically incorrect changes to silence rpmlint.
+- Correct double install target in make command.
+
+* Tue May 8 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 2.1.3-4
+- Use %%name macro to follow package policy.
+- Change hyperelliptic spelling to satisfy rpmlint.
+- Move gpl-2.0.txt file to -devel package to provide documentation.
+
+* Tue May 8 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 2.1.3-3
+- Correct undefined symbols in the shared library.
+- Link with RPM_LD_FLAGS to enable partial relro.
+
+* Fri May 4 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 2.1.3-2
+- Remove unneeded build requires.
+- Prefer %%global over %%define. 
+- Remove unneeded %%defattr from spec.
+
+* Tue May 1 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 2.1.3-1
+- Initial ratpoints spec.
diff --git a/sources b/sources
index e69de29..17e1ff8 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+597fee3856ef2f80fffc0a440e926208  ratpoints-2.1.3.tar.gz


More information about the scm-commits mailing list