summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2009-09-11 19:12:02 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2009-09-11 19:12:02 +0000
commitd70b325d751a21d860065cb0b373e219f37ec265 (patch)
tree3cdc06fd2db037da3543a71cea4e1e1f06e1cda1 /sci-libs/primegen/primegen-0.97-r1.ebuild
parentamd64 stable, bug #267081 (diff)
downloadgentoo-2-d70b325d751a21d860065cb0b373e219f37ec265.tar.gz
gentoo-2-d70b325d751a21d860065cb0b373e219f37ec265.tar.bz2
gentoo-2-d70b325d751a21d860065cb0b373e219f37ec265.zip
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)
Diffstat (limited to 'sci-libs/primegen/primegen-0.97-r1.ebuild')
-rw-r--r--sci-libs/primegen/primegen-0.97-r1.ebuild52
1 files changed, 52 insertions, 0 deletions
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
+}