You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.8 KiB
56 lines
1.8 KiB
12 years ago
|
# Copyright 1999-2013 Gentoo Foundation
|
||
12 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
12 years ago
|
# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/yafu/yafu-1.34.3.ebuild,v 1.3 2013/03/08 03:05:30 patrick Exp $
|
||
|
|
||
|
EAPI=5
|
||
|
|
||
|
inherit eutils versionator
|
||
|
|
||
|
MY_PV="$(get_version_component_range 1-2)"
|
||
12 years ago
|
|
||
|
DESCRIPTION="Yet another factoring utility"
|
||
|
HOMEPAGE="http://sourceforge.net/projects/yafu/"
|
||
12 years ago
|
SRC_URI="mirror://sourceforge/${PN}/${MY_PV}/${PN}-${MY_PV}-src.zip"
|
||
12 years ago
|
|
||
|
SLOT="0"
|
||
12 years ago
|
LICENSE="public-domain"
|
||
12 years ago
|
KEYWORDS="~amd64 ~x86"
|
||
|
# nfs is overloaded, so using less confusing sieve here
|
||
12 years ago
|
IUSE="+sieve"
|
||
12 years ago
|
|
||
12 years ago
|
DEPEND="
|
||
|
dev-libs/gmp
|
||
12 years ago
|
sci-mathematics/gmp-ecm
|
||
12 years ago
|
sieve? (
|
||
|
sci-mathematics/msieve
|
||
12 years ago
|
sci-mathematics/ggnfs )"
|
||
12 years ago
|
RDEPEND="${DEPEND}"
|
||
|
|
||
|
src_prepare() {
|
||
|
# This is not nice. But then the Makefile is quite special :)
|
||
|
sed -i -e 's:../gmp/include:gmp:' Makefile || die "Failed to rectify things"
|
||
|
sed -i -e 's:../gmp-ecm/include:gmp-ecm:' Makefile || die "Failed to rectify things"
|
||
|
sed -i -e 's:LIBS += -L../:# LIBS += -L../:g' Makefile || die "Failed to rectify things"
|
||
|
sed -i -e 's:\"config.h\":<gmp-ecm/config.h>:g' top/driver.c || die "Failed to rectify things"
|
||
12 years ago
|
sed -i -e 's:# LIBS += -L../msieve/lib/linux/x86_64:LIBS += -lmsieve -lz -ldl:' Makefile || die "Failed to rectify things"
|
||
12 years ago
|
sed -i -e 's:CFLAGS = -g:#CFLAGS = -g:' Makefile || die "Failed to rectify things"
|
||
12 years ago
|
sed -i -e '/$(LIBS)$/s:$(CC):$(CC) $(LDFLAGS):g' Makefile || die
|
||
12 years ago
|
|
||
|
# proper ggnfs default path
|
||
|
sed -i -e 's~strcpy(fobj->nfs_obj.ggnfs_dir,"./");~strcpy(fobj->nfs_obj.ggnfs_dir,"/usr/bin/");~' factor/factor_common.c || die "Failed to rectify things"
|
||
12 years ago
|
}
|
||
|
|
||
|
src_compile() {
|
||
12 years ago
|
local VAR=""
|
||
12 years ago
|
# hmm, not that useful:
|
||
|
#VAR="TIMING=1 "
|
||
12 years ago
|
use sieve && VAR+="NFS=1"
|
||
|
use amd64 && emake $VAR x86_64
|
||
|
use x86 && emake $VAR x86
|
||
12 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
12 years ago
|
dobin "${S}/yafu"
|
||
|
dodoc docfile.txt README yafu.ini
|
||
12 years ago
|
}
|