# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit eutils multilib toolchain-funcs versionator MY_PV="${PV//./}" DESCRIPTION="A package abstraction library for Half-Life" HOMEPAGE="http://nemesis.thewavelength.net/index.php?p=35" SRC_URI="http://nemesis.thewavelength.net/files/files/hllib${MY_PV}.zip" LICENSE="GPL-2 LGPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="examples" DEPEND="" RDEPEND="" src_prepare() { epatch "${FILESDIR}"/libhl-2.2.0-gcc4.diff } src_compile() { emake -C HLLib all || die "Failed to build libhl" if use examples; then cd HLExtract ln -s ../lib/HLLib.h hl.h ln -s ../HLLib/libhl.so.${PV} libhl.so "$(tc-getCC)" ${CFLAGS} -I. -L. Main.c -o hlextract -lhl || die "Failed to build hlextract" fi } src_install() { dolib HLLib/libhl.so.${PV} || die 'Failed to install the shared object' dosym libhl.so.${PV} /usr/$(get_libdir)/libhl.so.$(get_version_component_range 1) || die 'Failed to link to the shared object' dosym libhl.so.${PV} /usr/$(get_libdir)/libhl.so || die 'Failed to link to the shared object' insinto /usr/include newins lib/HLLib.h hl.h || die 'Failed to install libhl header files' if use examples; then dobin HLExtract/hlextract || die 'Failed to install hlextract (USE=examples)' fi dodoc Readme.txt || die 'Failed to install documentation' }