summaryrefslogtreecommitdiff
blob: ab964184ea151d5b715a5ec1bad5ff90dfea90f5 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-arch/upx-ucl/upx-ucl-3.03.ebuild,v 1.4 2009/10/12 17:06:59 halcy0n Exp $

inherit eutils toolchain-funcs flag-o-matic

LZMA_VER=4.57
MY_P="${P/-ucl/}-src"
DESCRIPTION="upx is the Ultimate Packer for eXecutables."
HOMEPAGE="http://upx.sourceforge.net"
SRC_URI="http://upx.sourceforge.net/download/${MY_P}.tar.bz2
	mirror://sourceforge/sevenzip/lzma${LZMA_VER/.}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"

IUSE=""

DEPEND=">=dev-libs/ucl-1.02
	dev-lang/perl
	!app-arch/upx"

S="${WORKDIR}/${MY_P}"

src_unpack() {
	unpack ${MY_P}.tar.bz2
	cd "${S}"
	epatch "${FILESDIR}"/${PN}-glibc210.patch
	mkdir "${WORKDIR}"/lzma-${LZMA_VER}
	cd "${WORKDIR}"/lzma-${LZMA_VER}
	unpack lzma${LZMA_VER/.}.tar.bz2
}

src_compile() {
	use sparc && append-flags "-D__BIG_ENDIAN__"

	tc-export CXX
	emake UPX_LZMADIR="${WORKDIR}"/lzma-${LZMA_VER} all || die
}

src_install() {
	newbin src/upx.out upx

	dodoc BUGS NEWS PROJECTS README* THANKS TODO doc/upx.doc doc/*.txt
	dohtml doc/upx.html
	doman doc/upx.1
}