summaryrefslogtreecommitdiff
blob: 1fc5666fe720bcbd91dd6b341dc3af2a2d83bb21 (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
57
58
59
60
61
62
63
64
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit plocale toolchain-funcs

DESCRIPTION="Clone of a C64 game - destroy the opponent's house"
HOMEPAGE="https://github.com/kouya/tornado"
SRC_URI="https://github.com/kouya/tornado/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND="
	acct-group/gamestat
	sys-libs/ncurses:=
	virtual/libintl"
DEPEND="${RDEPEND}"
BDEPEND="
	virtual/pkgconfig
	sys-devel/gettext"

PATCHES=(
	"${FILESDIR}"/${P}-make.patch
)

src_prepare() {
	default

	sed -i "/SCOREFILE_NAME/s|/|${EPREFIX}/|" scores.h || die
}

src_compile() {
	tc-export CC PKG_CONFIG

	emake PREFIX="${EPREFIX}/usr" LOCALEPATH="${EPREFIX}/usr/share/locale"
}

src_install() {
	dobin tornado
	doman doc/man/tornado.6

	einstalldocs

	tornado_man() {
		doman -i18n=${1} doc/man/${1}/${PN}.6
	}
	local PLOCALES="de fr it nl no ru"
	plocale_for_each_locale tornado_man

	PLOCALES+=" es pt"
	local mo=($(plocale_get_locales))
	mo=("${mo[@]/%/.mo}")
	(( ${#mo[@]} )) && domo "${mo[@]/#/po/}"

	insinto /var/games
	doins ${PN}.scores

	fowners :gamestat /usr/bin/${PN} /var/games/${PN}.scores
	fperms g+s /usr/bin/${PN}
	fperms 660 /var/games/${PN}.scores
}