]> Pileus Git - ~andy/sunrise/blob - dev-util/eresi/eresi-0.82_beta2.ebuild
sunrise/ net-nntp/nzbperl/Manifest: Update copyright line to satisfy repoman
[~andy/sunrise] / dev-util / eresi / eresi-0.82_beta2.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=4
6
7 inherit eutils toolchain-funcs
8
9 DESCRIPTION="The ERESI Reverse Engineering Software Interface: elfsh and friends"
10 HOMEPAGE="http://www.eresi-project.org/"
11 # Steps to regenerate archive:
12 #   svn export http://svn.eresi-project.org/svn/trunk@1283 eresi-0.82_beta2
13 #   tar cvjf eresi-0.82_beta2{.tar.bz2,}
14 # To find the latest release and the corresponding svn revision:
15 #   svn annotate \
16 #   http://svn.eresi-project.org/svn/trunk/librevm/include/revm-io.h \
17 #   | egrep 'REVM_(RELEASE|VERSION)'
18 SRC_URI="http://martin.von-gagern.net/gentoo/${P}.tar.bz2"
19
20 LICENSE="GPL-2"
21 SLOT="0"
22 KEYWORDS="~amd64 ~ppc ~x86"
23 IUSE="readline server doc"
24 REQUIRED_USE="server? ( !readline )"
25
26 DEPEND="readline? ( sys-libs/readline )"
27 RDEPEND="${DEPEND}
28         !<dev-util/elfsh-0.75"
29 # dev-util/elfsh-0.75 should be used as a transition package,
30 # depending on eresi but not installing any files of its own.
31
32 src_prepare() {
33         epatch "${FILESDIR}"/0.82_beta2-parallel-make.patch \
34         "${FILESDIR}"/0.82_beta2-drop-dprintf.patch \
35         "${FILESDIR}"/0.82_beta2-as-needed.patch \
36         "${FILESDIR}"/0.82_beta2-sed-in-Makefile.patch \
37         "${FILESDIR}"/0.82_beta2-direct-ld.patch \
38         "${FILESDIR}"/0.82_beta2-gentoo-autodetect.patch
39
40         sed -i \
41                 -e 's: -O2 : :g' \
42                 -e "s: -g3 : ${CFLAGS} -D_GNU_SOURCE :" \
43                 -e "/^LDFLAGS/s:=:=${LDFLAGS} :" \
44                 $(find -name Makefile) || die
45         sed -i \
46                 -e "s:/usr/local:${EPREFIX%/}/usr:" \
47                 configure eresi-config libasm/tools/libasm-config.template \
48                 $(find -name \*.esh)
49 }
50
51 src_configure() {
52         # non-standard configure script
53         # doesn't understand --disable-*, so don't use use_enable
54         local conf="--prefix /usr"
55         conf="${conf} --enable-32-64"
56         conf="${conf} --set-compiler $(tc-getCC)"
57         use readline && conf="${conf} --enable-readline"
58         use server && conf="${conf} --enable-network"
59         echo "./configure ${conf}"
60         ./configure  ${conf} || die "configure failed"
61 }
62
63 src_install() {
64         emake DESTDIR="${D}" install || die "emake install failed"
65         dodoc doc/{AUTHOR,CREDITS} README.FIRST || die "dodoc failed"
66         if use doc; then
67                 dodoc doc/{cerberus2,elfsh-network-0.3,elfsh-ref}.txt \
68                         doc/{graphers,libelfsh-ref,rtld-multiarch}.txt || die "dodoc failed"
69                 dodoc doc/{Changelog,ERESI.NEWHOOKS,eresirc.example} || die "dodoc failed"
70                 dodoc doc/{KERNSH.bugs,libelfsh.i} || die "dodoc failed"
71         fi
72 }