--- /usr/portage/sci-mathematics/gmp-ecm/gmp-ecm-6.4.3-r3.ebuild 2012-11-28 10:01:27.000000000 +0000 +++ ecm-6.4.3-r4.ebuild 2012-12-29 13:38:48.856081838 +0000 @@ -7,11 +7,11 @@ HOMEPAGE="http://ecm.gforge.inria.fr/" SRC_URI="https://gforge.inria.fr/frs/download.php/30965/${P}.tar.gz" -inherit eutils +inherit autotools-utils flag-o-matic LICENSE="GPL-2" SLOT="0" -KEYWORDS="~amd64 ~x86" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" IUSE="+custom-tune +gwnum -openmp" DEPEND="dev-libs/gmp @@ -22,29 +22,40 @@ # can't be both enabled REQUIRED_USE="gwnum? ( !openmp )" -S=${WORKDIR}/ecm-${PV} +S="${WORKDIR}"/ecm-${PV} -src_configure() { - if use gwnum; then myconf="--with-gwnum=/usr/lib"; fi - # --enable-shellcmd is broken - econf $(use_enable openmp) $myconf || die +DOCS=( ChangeLog NEWS README README.lib TODO ) + +myeconfargs=( + $(use gwnum && use_with gwnum) + $(use_enable openmp) +) + +pkg_setup() { + if [[ ${CHOST} == *-linux* ]] ; then + append-ldflags "-Wl,-z,noexecstack" + fi } src_compile() { if use custom-tune; then - use amd64 && cd x86_64 - use x86 && cd pentium4 - emake -j1 || die # build libecm/libmulredc.la + use amd64 && cd "${BUILD_DIR}"/x86_64 + use x86 && cd "${BUILD_DIR}"/pentium4 + # build libecm/libmulredc.la + emake cd .. && make bench_mulredc || die sed -i -e 's:#define TUNE_MULREDC_TABLE://#define TUNE_MULREDC_TABLE:g' `readlink ecm-params.h` || die sed -i -e 's:#define TUNE_SQRREDC_TABLE://#define TUNE_SQRREDC_TABLE:g' `readlink ecm-params.h` || die ./bench_mulredc | tail -n 4 >> `readlink ecm-params.h` || die fi - emake -j1 || die + + autotools-utils_src_compile } src_install() { - emake DESTDIR="${D}" install || die - mkdir -p "${D}/usr/include/${PN}/" - cp "${S}"/*.h "${D}/usr/include/${PN}" || die "Failed to copy headers" # needed by other apps like YAFU + autotools-utils_src_install + + # needed by other apps like YAFU + insinto /usr/include/${PN} + doins "${S}"/*.h }