summaryrefslogtreecommitdiff
blob: be54175c6c62371dd1c87b38917fe409c8f6d7f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit flag-o-matic toolchain-funcs

DESCRIPTION="libmelf is a library interface for manipulating ELF object files"
HOMEPAGE="http://www.hick.org/code/skape/libmelf/"
SRC_URI="http://www.hick.org/code/skape/${PN}/${P}.tar.gz"

LICENSE="Artistic"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="static-libs"

DEPEND=""
RDEPEND="${DEPEND}"

PATCHES=(
	# This patch was gained from the elfsign-0.2.2 release
	"${FILESDIR}"/${PN}-0.4.1-unfinal-release.patch
	# Cleanup stuff
	"${FILESDIR}"/${PN}-0.4.0-r1-gcc-makefile-cleanup.patch
)

src_prepare() {
	default

	# * QA Notice: The following shared libraries lack a SONAME
	# * /usr/lib64/libmelf.so
	sed 's/\(-shared -fPIC\)/\1 -Wl,-soname,libmelf.so/' -i configure || die
}

src_configure() {
	tc-export CC AR RANLIB
	append-flags -fPIC
	default
}

src_compile() {
	emake OPTFLAGS="${CFLAGS}"
}

src_install() {
	dobin tools/elfres

	dolib.so libmelf.so
	use static-libs && dolib.a libmelf.a

	insinto /usr/include
	doins melf.h stdelf.h

	HTML_DOCS=( docs/html/. )
	einstalldocs
}