| 1 |
# Copyright 1999-2013 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-libs/dmalloc/dmalloc-5.5.2-r4.ebuild,v 1.10 2012/07/08 16:07:24 armin76 Exp $ |
| 4 |
|
| 5 |
EAPI=4 |
| 6 |
|
| 7 |
inherit autotools eutils multilib |
| 8 |
|
| 9 |
DESCRIPTION="A Debug Malloc Library" |
| 10 |
HOMEPAGE="http://dmalloc.com" |
| 11 |
SRC_URI="http://dmalloc.com/releases/${P}.tgz" |
| 12 |
|
| 13 |
LICENSE="CC-BY-SA-3.0" |
| 14 |
SLOT="0" |
| 15 |
KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd" |
| 16 |
IUSE="static-libs threads" |
| 17 |
|
| 18 |
DEPEND="sys-apps/texinfo" |
| 19 |
RDEPEND="" |
| 20 |
|
| 21 |
DOCS=( NEWS README docs/NOTES docs/TODO ) |
| 22 |
|
| 23 |
src_prepare() { |
| 24 |
# - Build objects twice, once -fPIC for shared. |
| 25 |
# - Use DESTDIR. |
| 26 |
# - Fix SONAME and NEEDED. |
| 27 |
epatch "${FILESDIR}"/${P}-Makefile.in.patch |
| 28 |
# - Broken test, always returns false. |
| 29 |
epatch "${FILESDIR}"/${P}-cxx.patch |
| 30 |
# - Add threads support. |
| 31 |
use threads && epatch "${FILESDIR}"/${P}-threads.patch |
| 32 |
# Respect CFLAGS/LDFLAGS. #337429 |
| 33 |
sed -i Makefile.in \ |
| 34 |
-e '/libdmalloc/ s:$(CC):& $(CFLAGS) $(LDFLAGS):g' \ |
| 35 |
|| die "sed Makefile.in" |
| 36 |
# - Run autoconf for -cxx.patch. |
| 37 |
eautoconf |
| 38 |
} |
| 39 |
|
| 40 |
src_configure() { |
| 41 |
econf --enable-cxx --enable-shlib $(use_enable threads) |
| 42 |
} |
| 43 |
|
| 44 |
src_compile() { |
| 45 |
default |
| 46 |
|
| 47 |
cd docs |
| 48 |
makeinfo dmalloc.texi || die |
| 49 |
} |
| 50 |
|
| 51 |
src_test() { |
| 52 |
emake heavy |
| 53 |
} |
| 54 |
|
| 55 |
src_install() { |
| 56 |
default |
| 57 |
|
| 58 |
newdoc ChangeLog.1 ChangeLog |
| 59 |
insinto /usr/share/doc/${PF} |
| 60 |
doins docs/dmalloc.pdf |
| 61 |
dohtml RELEASE.html docs/dmalloc.html |
| 62 |
doinfo docs/dmalloc.info |
| 63 |
|
| 64 |
# add missing symlinks, lazy |
| 65 |
dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so |
| 66 |
dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so.${PV%%.*} |
| 67 |
|
| 68 |
for lib in cxx th thcxx; do |
| 69 |
dosym lib${PN}${lib}.so.${PV} /usr/$(get_libdir)/lib${PN}${lib}.so |
| 70 |
dosym lib${PN}${lib}.so.${PV} \ |
| 71 |
/usr/$(get_libdir)/lib${PN}${lib}.so.${PV%%.*} |
| 72 |
done |
| 73 |
|
| 74 |
if ! use static-libs; then |
| 75 |
rm "${D}"/usr/$(get_libdir)/lib${PN}*.a || die |
| 76 |
fi |
| 77 |
} |