From d70b325d751a21d860065cb0b373e219f37ec265 Mon Sep 17 00:00:00 2001 From: Sebastien Fabbro Date: Fri, 11 Sep 2009 19:12:02 +0000 Subject: Fixed missing headers QA, added a test, and included the uint32.h and uint64.h in primegen.h to avoid collision with dev-db/cdb. Closing bug #248327 and bug #279295 (Portage version: 2.2_rc40/cvs/Linux x86_64) --- sci-libs/primegen/ChangeLog | 13 +++++- .../files/primegen-0.97-missing-headers.patch | 46 +++++++++++++++++++ sci-libs/primegen/metadata.xml | 12 ++++- sci-libs/primegen/primegen-0.97-r1.ebuild | 52 ++++++++++++++++++++++ 4 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 sci-libs/primegen/files/primegen-0.97-missing-headers.patch create mode 100644 sci-libs/primegen/primegen-0.97-r1.ebuild (limited to 'sci-libs') diff --git a/sci-libs/primegen/ChangeLog b/sci-libs/primegen/ChangeLog index 24f4a519a16a..a3052b49aa67 100644 --- a/sci-libs/primegen/ChangeLog +++ b/sci-libs/primegen/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sci-libs/primegen -# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/primegen/ChangeLog,v 1.7 2008/07/23 20:34:55 spock Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/primegen/ChangeLog,v 1.8 2009/09/11 19:12:02 bicatali Exp $ + +*primegen-0.97-r1 (11 Sep 2009) + + 11 Sep 2009; Sébastien Fabbro + +primegen-0.97-r1.ebuild, +files/primegen-0.97-missing-headers.patch, + metadata.xml: + Fixed missing headers QA, added a test, and included the uint32.h and + uint64.h in primegen.h to avoid collision with dev-db/cdb. Closing bug + #248327 and bug #279295 23 Jul 2008; Michał Januszewski +files/primegen-0.97-man.patch, primegen-0.97.ebuild: 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 ++#include + #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 ++#include + #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 ++#include + #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 ++#include + #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 + + extern int error_intr; + extern int error_nomem; diff --git a/sci-libs/primegen/metadata.xml b/sci-libs/primegen/metadata.xml index b229aec85b8f..9f23340da130 100644 --- a/sci-libs/primegen/metadata.xml +++ b/sci-libs/primegen/metadata.xml @@ -1,5 +1,15 @@ -sci +sci-mathematics + + 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. + 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..a48101a9f7af --- /dev/null +++ b/sci-libs/primegen/primegen-0.97-r1.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/primegen/primegen-0.97-r1.ebuild,v 1.1 2009/09/11 19:12:02 bicatali Exp $ + +EAPI=2 +inherit eutils flag-o-matic toolchain-funcs + +DESCRIPTION="A 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="~x86 ~amd64 ~ppc" +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)" > conf-ld +} + +src_test() { + [[ $(./primes 1 100000000 | md5sum ) == "4e2b0027288a27e9c99699364877c9db "* ]] || die "test failed" +} + +src_install() { + dobin primegaps primes primespeed || die "dobin failed" + doman primegaps.1 primes.1 primespeed.1 primegen.3 + dolib.a libprimegen.a || die "dolib.a failed" + # 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 || die + dodoc BLURB CHANGES README TODO +} -- cgit v1.2.3-65-gdbad