Permalink
Browse files

fix up the ebuild

inherit user explicitly, use games group, move user-creation to pkg_setup,
set paths for the conf.d file, move doinitd to src_install,
make script installation dependant on useflags, print some more elog
  • Loading branch information...
hasufell
hasufell committed Nov 3, 2012
1 parent 3f2c095 commit bf20ed7e5f2d98f4fd3f5b9efe1e34534e1141a0
Showing with 32 additions and 6 deletions.
  1. +32 −6 games-action/minetest/minetest-0.4.3.ebuild
@@ -3,9 +3,9 @@
# $Header: $
EAPI=4
-inherit eutils cmake-utils gnome2-utils vcs-snapshot games
+inherit eutils cmake-utils gnome2-utils vcs-snapshot user games
-DESCRIPTION="An InfiniMiner/Minecraft inspired game."
+DESCRIPTION="An InfiniMiner/Minecraft inspired game"
HOMEPAGE="http://c55.me/minetest/"
SRC_URI="http://github.com/celeron55/minetest/tarball/${PV} -> ${P}.tar.gz"
@@ -35,6 +35,14 @@ DEPEND="${RDEPEND}
>=dev-games/irrlicht-1.7
nls? ( sys-devel/gettext )"
+pkg_setup() {
+ games_pkg_setup
+
+ if use server || use dedicated ; then
+ enewuser ${PN} -1 -1 /var/lib/${PN} ${GAMES_GROUP}
+ fi
+}
+
src_unpack() {
vcs-snapshot_src_unpack
}
@@ -45,6 +53,12 @@ src_prepare() {
"${FILESDIR}"/${P}-lua.patch
rm -r src/{jthread,lua,sqlite} || die
+
+ # set paths
+ sed \
+ -e "s#@BINDIR@#${GAMES_BINDIR}#g" \
+ -e "s#@GROUP@#${GAMES_GROUP}#g" \
+ "${FILESDIR}"/minetestserver.confd > "${T}"/minetestserver.confd || die
}
src_configure() {
@@ -66,25 +80,37 @@ src_compile() {
src_install() {
cmake-utils_src_install
+
+ if use server || use dedicated ; then
+ newinitd "${FILESDIR}"/minetestserver.initd minetest-server
+ newconfd "${T}"/minetestserver.confd minetest-server
+ fi
+
prepgamesdirs
}
pkg_preinst() {
games_pkg_preinst
gnome2_icon_savelist
-
- enewgroup minetest
- enewuser minetest -1 -1 /var/lib/minetest "minetest,games"
- doinitd "${FILESDIR}/minetestserver.init"
}
pkg_postinst() {
games_pkg_postinst
gnome2_icon_cache_update
if ! use dedicated ; then
+ elog
elog "optional dependencies:"
elog " games-action/minetest_game (official mod)"
+ elog
+ fi
+
+ if use server || use dedicated ; then
+ elog
+ elog "Configure your server via /etc/conf.d/minetest-server"
+ elog "The user \"minetest\" is created with /var/lib/${PN} homedir."
+ elog "Default logfile is ~/minetest-server.log"
+ elog
fi
}

0 comments on commit bf20ed7

Please sign in to comment.