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

EAPI=7

inherit toolchain-funcs

DESCRIPTION="A color ncurses tetris clone"
HOMEPAGE="http://www.earth.li/projectpurple/progs/seatris.html"
SRC_URI="http://www.earth.li/projectpurple/files/${P}.tar.gz"

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

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

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

src_prepare() {
	default

	sed -i \
		-e "s:/var/lib/games:/var/lib/${PN}:" \
		scoring.h seatris.6 || die
}

src_configure() {
	tc-export CC
	econf
}

src_compile() {
	emake LIBS="$( $(tc-getPKG_CONFIG) --libs ncurses )"
}

src_install() {
	dobin seatris

	doman seatris.6
	dodoc ACKNOWLEDGEMENTS HISTORY README TODO example.seatrisrc

	dodir /var/lib/${PN}
	touch "${ED}"/var/lib/${PN}/seatris.score || die
	fperms 660 /var/lib/${PN}/seatris.score

	fowners -R root:gamestat /var/lib/${PN} /usr/bin/${PN}
	fperms g+s /usr/bin/${PN}
}