games-roguelike/moria: use 'gamestat' group for accessing data files
authorStefan Strogin <stefan.strogin@gmail.com>
Tue, 5 Feb 2019 11:55:53 +0000 (13:55 +0200)
committerJames Le Cuirot <chewi@gentoo.org>
Tue, 5 Feb 2019 21:42:32 +0000 (21:42 +0000)
Closes: https://bugs.gentoo.org/677204
Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/10986
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
games-roguelike/moria/moria-5.7.10.ebuild

index a5e1c54cf230ebbf3895c0a040fbf524be6c08bc..1f337859cbc4d9845d008e0ec1a9a32a43ab01dd 100644 (file)
@@ -4,7 +4,7 @@
 EAPI=7
 
 CMAKE_IN_SOURCE_BUILD="yes"
-inherit cmake-utils
+inherit cmake-utils user
 
 DESCRIPTION="The Dungeons of Moria, a single player roguelike game, also known as Umoria"
 HOMEPAGE="https://umoria.org/"
@@ -23,6 +23,10 @@ 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
@@ -36,7 +40,7 @@ src_install() {
 
        insinto /var/lib/moria
        doins data/scores.dat
-       fowners root:games /var/lib/moria/scores.dat
+       fowners root:gamestat /var/lib/moria/scores.dat
        fperms g+w /var/lib/moria/scores.dat
 
        doman "${FILESDIR}"/${PN}.6
@@ -47,3 +51,10 @@ src_install() {
        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
+}