summaryrefslogtreecommitdiff
blob: 4aa9dc2a0d8c6397c3ed990698e1f5126d892aac (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit desktop

MY_P="ChickensForLinux-Linux-${PV}"
DESCRIPTION="Target chickens with rockets and shotguns. Funny"
HOMEPAGE="http://www.chickensforlinux.com/"
SRC_URI="http://www.chickensforlinux.com/${MY_P}.tar.gz"

LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RESTRICT="mirror bindist"

DEPEND="acct-group/gamestat
	<media-libs/allegro-5"
RDEPEND="${DEPEND}"

S=${WORKDIR}/${PN}

src_prepare() {
	default

	sed -i \
		-e "s:HighScores:/var/games//${PN}/HighScores:" \
		-e "s:....\(.\)\(_\)\(.*.4x0\)\(.\):M\4\2\x42\x6Fn\1s\2:" \
		highscore.cpp HighScores || die
	sed -i \
		-e "s:options.cfg:/etc/${PN}/options.cfg:" \
		-e "s:\"sound/:\"/usr/share/${PN}/sound/:" \
		-e "s:\"dat/:\"/usr/share/${PN}/dat/:" \
		main.cpp README || die
	sed -i \
		-e '/^CPPFLAGS/d' \
		-e 's:g++:\\$(CXX) \\$(CXXFLAGS) \\$(LDFLAGS):' \
		configure || die
}

src_configure() {
	# econf (sometimes) fails, see https://bugs.gentoo.org/588544
	bash ./configure || die
}

src_install() {
	dobin ${PN}
	insinto /usr/share/${PN}
	doins -r dat sound
	dodoc AUTHOR README
	insinto /var/games/${PN}
	doins HighScores
	insinto /etc/${PN}
	doins options.cfg
	make_desktop_entry ${PN} Chickens

	fowners root:gamestat /usr/bin/${PN} /var/games/${PN}/HighScores
	fperms 2755 /usr/bin/${PN}
	fperms 660  /var/games/${PN}/HighScores
}