Skip to content

Commit

Permalink
fix up the ebuild
Browse files Browse the repository at this point in the history
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 committed Nov 3, 2012
1 parent 3f2c095 commit bf20ed7
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions games-action/minetest/minetest-0.4.3.ebuild
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# $Header: $ # $Header: $


EAPI=4 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/" HOMEPAGE="http://c55.me/minetest/"
SRC_URI="http://github.com/celeron55/minetest/tarball/${PV} -> ${P}.tar.gz" SRC_URI="http://github.com/celeron55/minetest/tarball/${PV} -> ${P}.tar.gz"


Expand Down Expand Up @@ -35,6 +35,14 @@ DEPEND="${RDEPEND}
>=dev-games/irrlicht-1.7 >=dev-games/irrlicht-1.7
nls? ( sys-devel/gettext )" 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() { src_unpack() {
vcs-snapshot_src_unpack vcs-snapshot_src_unpack
} }
Expand All @@ -45,6 +53,12 @@ src_prepare() {
"${FILESDIR}"/${P}-lua.patch "${FILESDIR}"/${P}-lua.patch


rm -r src/{jthread,lua,sqlite} || die 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() { src_configure() {
Expand All @@ -66,25 +80,37 @@ src_compile() {


src_install() { src_install() {
cmake-utils_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 prepgamesdirs
} }


pkg_preinst() { pkg_preinst() {
games_pkg_preinst games_pkg_preinst
gnome2_icon_savelist gnome2_icon_savelist

enewgroup minetest
enewuser minetest -1 -1 /var/lib/minetest "minetest,games"
doinitd "${FILESDIR}/minetestserver.init"
} }


pkg_postinst() { pkg_postinst() {
games_pkg_postinst games_pkg_postinst
gnome2_icon_cache_update gnome2_icon_cache_update


if ! use dedicated ; then if ! use dedicated ; then
elog
elog "optional dependencies:" elog "optional dependencies:"
elog " games-action/minetest_game (official mod)" 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 fi
} }


Expand Down

0 comments on commit bf20ed7

Please sign in to comment.