summaryrefslogtreecommitdiff
path: root/sci-libs/primegen/primegen-0.97-r2.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-libs/primegen/primegen-0.97-r2.ebuild
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-libs/primegen/primegen-0.97-r2.ebuild')
-rw-r--r--sci-libs/primegen/primegen-0.97-r2.ebuild54
1 files changed, 54 insertions, 0 deletions
diff --git a/sci-libs/primegen/primegen-0.97-r2.ebuild b/sci-libs/primegen/primegen-0.97-r2.ebuild
new file mode 100644
index 000000000000..a71a29ef2560
--- /dev/null
+++ b/sci-libs/primegen/primegen-0.97-r2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit 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=""
+
+PATCHES=(
+ "${FILESDIR}/${P}-man.patch"
+ "${FILESDIR}/${P}-missing-headers.patch"
+)
+
+src_prepare() {
+ default
+ while IFS="" read -d $'\0' -r file
+ do
+ sed -i -e 's:\(primegen.a\):lib\1:' "${file}" || die
+ done < <(find . -type f -print0)
+ mkdir usr || die
+}
+
+src_configure() {
+ # Fixes bug #161015
+ append-flags -fsigned-char
+ echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die
+ echo "${S}/usr" > conf-home || die
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die
+}
+
+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
+}