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

EAPI=7

CMAKE_IN_SOURCE_BUILD="yes"
inherit cmake-utils user

DESCRIPTION="The Dungeons of Moria, a single player roguelike game, also known as Umoria"
HOMEPAGE="https://umoria.org/"
SRC_URI="https://github.com/dungeons-of-moria/umoria/archive/v${PV}.tar.gz -> ${P}.tar.gz"

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

RDEPEND=">=sys-libs/ncurses-6.0:0="
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

S="${WORKDIR}/umoria-${PV}"

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

pkg_setup(){
	enewgroup gamestat 36
}

src_prepare() {
	cmake-utils_src_prepare
	sed -i "s/@PF@/${PF}/" src/config.cpp || die
}

src_install() {
	newbin umoria/umoria moria

	insinto /usr/share/moria
	doins data/*.txt

	insinto /var/lib/moria
	doins data/scores.dat
	fowners root:gamestat /var/lib/moria/scores.dat
	fperms g+w /var/lib/moria/scores.dat

	doman "${FILESDIR}"/${PN}.6
	dodoc -r AUTHORS README.md docs

	# The game binary will look for plain text LICENSE
	insinto /usr/share/doc/${PF}
	doins LICENSE
	docompress -x /usr/share/doc/${PF}/LICENSE
}

pkg_postinst() {
	elog
	elog "Please add users to the 'gamestat' group, so they can run Moria:"
	elog "  usermod -aG gamestat <user>"
	elog
}