aboutsummaryrefslogtreecommitdiffstats
path: root/math/primegen
diff options
context:
space:
mode:
authorlioux <lioux@FreeBSD.org>2009-03-27 20:47:38 +0800
committerlioux <lioux@FreeBSD.org>2009-03-27 20:47:38 +0800
commit42425447f7887b1ba3ad0b1f8433b6b60bdcdae0 (patch)
tree4813f820b7c358ac0eed883d556a1765399bbd06 /math/primegen
parent3699cf631f17da1d73fb47c0c5fc51c57cc14a1a (diff)
downloadfreebsd-ports-gnome-42425447f7887b1ba3ad0b1f8433b6b60bdcdae0.tar.gz
freebsd-ports-gnome-42425447f7887b1ba3ad0b1f8433b6b60bdcdae0.tar.zst
freebsd-ports-gnome-42425447f7887b1ba3ad0b1f8433b6b60bdcdae0.zip
New port primegen version 0.97: A small, fast library to generate
prime numbers in order
Diffstat (limited to 'math/primegen')
-rw-r--r--math/primegen/Makefile61
-rw-r--r--math/primegen/distinfo3
-rw-r--r--math/primegen/files/patch-eratspeed.c11
-rw-r--r--math/primegen/files/patch-primegaps.c8
-rw-r--r--math/primegen/files/patch-primes.c8
-rw-r--r--math/primegen/files/patch-primespeed.c8
-rw-r--r--math/primegen/pkg-descr10
7 files changed, 109 insertions, 0 deletions
diff --git a/math/primegen/Makefile b/math/primegen/Makefile
new file mode 100644
index 000000000000..8303ba0dbac5
--- /dev/null
+++ b/math/primegen/Makefile
@@ -0,0 +1,61 @@
+# New ports collection makefile for: primegen
+# Date created: Fri Mar 27 2009 12:04:22 UTC
+# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= primegen
+PORTVERSION= 0.97
+CATEGORIES= math
+MASTER_SITES= http://cr.yp.to/primegen/
+
+MAINTAINER= lioux@FreeBSD.org
+COMMENT= A small, fast library to generate prime numbers in order
+
+ALL_TARGET=
+MAKE_JOBS_SAFE= yes
+
+MAN1= primes.1 primegaps.1
+MAN3= primegen.3
+
+PROGRAM_FILES= primes primegaps
+HEADER_FILES= primegen.h
+LIB_FILES= libprimegen.a
+
+# programs
+PLIST_FILES+= ${PROGRAM_FILES:S,^,bin/,}
+
+# header files
+PLIST_FILES+= ${HEADER_FILES:S,^,include/,}
+
+# libraries
+PLIST_FILES+= ${LIB_FILES:S,^,lib/,}
+
+post-patch:
+ @${FIND} ${WRKSRC} -type f -exec \
+ ${REINPLACE_CMD} -E -e 's!(primegen.a)!lib\1!' {} \;
+
+do-configure:
+ @${ECHO_CMD} '${CC} ${CFLAGS} -fsigned-char -fPIC' > ${WRKSRC}/conf-cc
+ @${ECHO_CMD} '${CC}' > ${WRKSRC}/conf-ld
+ @${ECHO_CMD} '${PREFIX}' > ${WRKSRC}/conf-home
+
+do-install:
+.for file in ${PROGRAM_FILES}
+ @${INSTALL_PROGRAM} ${WRKSRC}/${file} ${PREFIX}/bin
+.endfor
+.for file in ${HEADER_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/include
+.endfor
+.for file in ${LIB_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/lib
+.endfor
+.for file in ${MAN1}
+ @${INSTALL_MAN} ${WRKSRC}/${file} ${MAN1PREFIX}/man/man1
+.endfor
+.for file in ${MAN3}
+ @${INSTALL_MAN} ${WRKSRC}/${file} ${MAN3PREFIX}/man/man3
+.endfor
+
+.include <bsd.port.mk>
diff --git a/math/primegen/distinfo b/math/primegen/distinfo
new file mode 100644
index 000000000000..9cbdb1b8d5d5
--- /dev/null
+++ b/math/primegen/distinfo
@@ -0,0 +1,3 @@
+MD5 (primegen-0.97.tar.gz) = 7f2a260e5d0c0a4f9dd2e10cc6c8b984
+SHA256 (primegen-0.97.tar.gz) = 54285baf8eed9e421ff2220a2112d38cfb20c1ebef6014ef3f0004c22c95f40d
+SIZE (primegen-0.97.tar.gz) = 31491
diff --git a/math/primegen/files/patch-eratspeed.c b/math/primegen/files/patch-eratspeed.c
new file mode 100644
index 000000000000..2a0c55daace0
--- /dev/null
+++ b/math/primegen/files/patch-eratspeed.c
@@ -0,0 +1,11 @@
+--- eratspeed.c.orig 2009-03-27 09:16:52.000000000 -0300
++++ eratspeed.c 2009-03-27 09:18:29.000000000 -0300
+@@ -1,6 +1,8 @@
+ #define B32 1001
+ #define B (B32 * 32)
+
++#include <stdio.h>
++#include <stdlib.h>
+ #include "timing.h"
+ #include "uint32.h"
+
diff --git a/math/primegen/files/patch-primegaps.c b/math/primegen/files/patch-primegaps.c
new file mode 100644
index 000000000000..ab8a6c02ce77
--- /dev/null
+++ b/math/primegen/files/patch-primegaps.c
@@ -0,0 +1,8 @@
+--- primegaps.c.orig 2009-03-27 09:17:07.000000000 -0300
++++ primegaps.c 2009-03-27 09:17:19.000000000 -0300
+@@ -1,4 +1,5 @@
+ #include <math.h>
++#include <stdio.h>
+ #include "primegen.h"
+
+ primegen pg;
diff --git a/math/primegen/files/patch-primes.c b/math/primegen/files/patch-primes.c
new file mode 100644
index 000000000000..e622618cb69f
--- /dev/null
+++ b/math/primegen/files/patch-primes.c
@@ -0,0 +1,8 @@
+--- primes.c.orig 2009-03-27 09:19:08.000000000 -0300
++++ primes.c 2009-03-27 09:19:14.000000000 -0300
+@@ -1,4 +1,5 @@
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "primegen.h"
+ #include "fs64.h"
+
diff --git a/math/primegen/files/patch-primespeed.c b/math/primegen/files/patch-primespeed.c
new file mode 100644
index 000000000000..f612e85e0127
--- /dev/null
+++ b/math/primegen/files/patch-primespeed.c
@@ -0,0 +1,8 @@
+--- primespeed.c.orig 2009-03-27 09:17:41.000000000 -0300
++++ primespeed.c 2009-03-27 09:18:54.000000000 -0300
+@@ -1,3 +1,5 @@
++#include <stdio.h>
++#include <stdlib.h>
+ #include "timing.h"
+ #include "primegen.h"
+ #include "primegen_impl.h"
diff --git a/math/primegen/pkg-descr b/math/primegen/pkg-descr
new file mode 100644
index 000000000000..d681e3e21b2c
--- /dev/null
+++ b/math/primegen/pkg-descr
@@ -0,0 +1,10 @@
+primegen is a small, fast library to generate prime numbers in
+order. It generates the 50847534 primes up to 1000000000 in just 8
+seconds on a Pentium II-350; it prints them in decimal in just 35
+seconds.
+
+primegen can generate primes up to 1000000000000000, although it
+is not optimized for primes past 32 bits. It uses the Sieve of Atkin
+instead of the traditional Sieve of Eratosthenes.
+
+WWW: http://cr.yp.to/primegen.html