summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sci-libs/primegen
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sci-libs/primegen')
-rw-r--r--sci-libs/primegen/Manifest1
-rw-r--r--sci-libs/primegen/files/primegen-0.97-man.patch13
-rw-r--r--sci-libs/primegen/files/primegen-0.97-missing-headers.patch46
-rw-r--r--sci-libs/primegen/metadata.xml15
-rw-r--r--sci-libs/primegen/primegen-0.97-r1.ebuild52
5 files changed, 127 insertions, 0 deletions
diff --git a/sci-libs/primegen/Manifest b/sci-libs/primegen/Manifest
new file mode 100644
index 000000000000..aa6b33db5b19
--- /dev/null
+++ b/sci-libs/primegen/Manifest
@@ -0,0 +1 @@
+DIST primegen-0.97.tar.gz 31491 SHA256 54285baf8eed9e421ff2220a2112d38cfb20c1ebef6014ef3f0004c22c95f40d SHA512 d6d8de4d9866dbbec20afd4d4b563e3383528138cd3ec849f706211045d735c28bbf7aa6931b8aa54163664e87c2e7ad028c68f407040ac88efce7856bc8b6f4 WHIRLPOOL aa5d65806af4059b3b6a50edf304a7588a5db8dc3a853452abf5348aadaed294d4d84652352bf24921ecebb305a036bf65d8f5ffb80b8fa922e75cf672382258
diff --git a/sci-libs/primegen/files/primegen-0.97-man.patch b/sci-libs/primegen/files/primegen-0.97-man.patch
new file mode 100644
index 000000000000..025b88cbabd9
--- /dev/null
+++ b/sci-libs/primegen/files/primegen-0.97-man.patch
@@ -0,0 +1,13 @@
+diff -Naurp primegen-0.97-orig/primegen.3 primegen-0.97/primegen.3
+--- primegen-0.97-orig/primegen.3 2008-07-23 22:27:52.000000000 +0200
++++ primegen-0.97/primegen.3 2008-07-23 22:26:52.000000000 +0200
+@@ -21,6 +21,9 @@ uint64 \fIbound\fR;
+ The primegen library generates prime numbers in order:
+ 2, 3, 5, 7, etc.
+ It can generate primes as large as 10^15.
++Only a static version of this library is provided, so instead of
++linking your program with -lprimegen you will have to pass the
++full path to the library (e.g. /usr/lib/primegen.a) to the compiler.
+
+ The simplest way to use primegen
+ is to call
diff --git a/sci-libs/primegen/files/primegen-0.97-missing-headers.patch b/sci-libs/primegen/files/primegen-0.97-missing-headers.patch
new file mode 100644
index 000000000000..4f919d92ee8d
--- /dev/null
+++ b/sci-libs/primegen/files/primegen-0.97-missing-headers.patch
@@ -0,0 +1,46 @@
+--- 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"
+
+--- 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;
+--- 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"
+
+--- 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"
+--- error.h.orig 2009-09-11 19:40:53.000000000 +0100
++++ error.h 2009-09-11 19:41:02.000000000 +0100
+@@ -1,7 +1,7 @@
+ #ifndef ERROR_H
+ #define ERROR_H
+
+-extern int errno;
++#include <errno.h>
+
+ extern int error_intr;
+ extern int error_nomem;
diff --git a/sci-libs/primegen/metadata.xml b/sci-libs/primegen/metadata.xml
new file mode 100644
index 000000000000..9f23340da130
--- /dev/null
+++ b/sci-libs/primegen/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-mathematics</herd>
+<longdescription lang="en">
+ 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.
+</longdescription>
+</pkgmetadata>
diff --git a/sci-libs/primegen/primegen-0.97-r1.ebuild b/sci-libs/primegen/primegen-0.97-r1.ebuild
new file mode 100644
index 000000000000..6d542515d413
--- /dev/null
+++ b/sci-libs/primegen/primegen-0.97-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Small, fast library to generate primes in order"
+HOMEPAGE="http://cr.yp.to/primegen.html"
+SRC_URI="http://cr.yp.to/primegen/${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-man.patch"
+ epatch "${FILESDIR}/${P}-missing-headers.patch"
+ find . -type f -exec \
+ sed -i -e 's:\(primegen.a\):lib\1:' {} \;
+ mkdir usr
+}
+
+src_configure() {
+ # Fixes bug #161015
+ append-flags -fsigned-char
+ echo "$(tc-getCC) ${CFLAGS}" > conf-cc
+ echo "${S}/usr" > conf-home
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
+}
+
+src_test() {
+ [[ $(./primes 1 100000000 | md5sum ) == "4e2b0027288a27e9c99699364877c9db "* ]] || die "test failed"
+}
+
+src_install() {
+ dobin primegaps primes primespeed
+ doman primegaps.1 primes.1 primespeed.1 primegen.3
+ dolib.a libprimegen.a
+ # include the 2 typedefs to avoid collision (bug #248327)
+ sed -i \
+ -e "s/#include \"uint32.h\"/$(grep typedef uint32.h)/" \
+ -e "s/#include \"uint64.h\"/$(grep typedef uint64.h)/" \
+ primegen.h || die
+ insinto /usr/include
+ doins primegen.h
+ dodoc BLURB CHANGES README TODO
+}