summaryrefslogtreecommitdiff
blob: e2257e17ad3f783d1dc8221e95cf8c7f08489185 (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
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit desktop eutils user

DESCRIPTION="Fast-paced Tetris-like puzzler"
HOMEPAGE="http://www.chroniclogic.com/triptych.htm"
SRC_URI="http://www.chroniclogic.com/demos/${PN}.tar.gz"
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
RESTRICT="bindist mirror strip"

RDEPEND=">=media-libs/libsdl-1.2[abi_x86_32,opengl,sound,video]
	virtual/opengl[abi_x86_32]
	x11-libs/libX11[abi_x86_32]
	x11-libs/libXext[abi_x86_32]"

QA_PREBUILT="opt/${PN}/${PN}
	opt/${PN}/setup"

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

DIR="/opt/${PN}"
WRITABLE=( "${EROOT}${DIR}"/{hwconfig.cfg,${PN}.{clr,cnt,scr}} )

pkg_setup() {
	enewgroup gamestat 36
}

src_prepare() {
	default
	rm -v *.dll || die
}

src_install() {
	local EXES=( ${PN} setup )

	insinto "${DIR}"
	doins -r .

	exeinto "${DIR}"
	doexe "${EXES[@]}"

	fowners root:gamestat "${EXES[@]/#/${DIR}/}" || die
	fperms g+s "${EXES[@]/#/${DIR}/}" || die

	make_wrapper ${PN} ./${PN} "${DIR}"
	make_wrapper ${PN}-setup ./setup "${DIR}"
}

pkg_postinst() {
	touch "${WRITABLE[@]}" || die
	chown root:gamestat "${WRITABLE[@]}" || die
	chmod 0664 "${WRITABLE[@]}" || die
}

pkg_prerm() {
	[[ -z ${REPLACED_BY_VERSION} ]] &&
		rm -v "${WRITABLE[@]}"
}