summaryrefslogtreecommitdiff
blob: d87d9347c4f79b6b1bcf3485cf95f924cd9f0e76 (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-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit perl-module toolchain-funcs

MY_P="${P/_beta/b}"
DESCRIPTION="Portable (un)packer for Unreal Tournament's Umod files"
HOMEPAGE="http://www.oldunreal.com/wiki/index.php?title=UmodPack"
SRC_URI="mirror://gentoo/${MY_P}-allinone.tar.gz"

LICENSE="Artistic"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DEPEND="virtual/perl-IO-Compress
	dev-perl/Archive-Zip
	dev-perl/Tie-IxHash"

RDEPEND="${DEPEND}"

S="${WORKDIR}/${MY_P}"
PATCHES=( "${FILESDIR}"/${PN}-fixes.patch )
DIST_TEST="do"

src_prepare() {
	default

	# Remove bundled Perl modules.
	rm -rf {Archive-Zip,Compress-Zlib,Tie-IxHash,Tk}* || die
}

src_compile() {
	perl-module_src_compile

	cd umr-* || die
	emake DEBUG=0 CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
}

src_test() {
	local line
	perl-module_src_test | while read line; do
		cat <<< "${line}"
		[[ ${line} =~ ^not\ ok\ [0-9] ]] && die "test failed"
	done
}

src_install() {
	perl-module_src_install

	cd umr-* || die
	dobin umr
	newdoc README README-umr
	newdoc TODO TODO-umr
}