aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-12-30 10:02:39 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2014-12-30 10:35:07 +0100
commit1e340f85df7db29ca1db6bf1350bf046c5023fbb (patch)
tree91d26492588ccb01f26d09237717d6593124c1b5
parente36d9c05404d489f0ae12e62568553216a925f5f (diff)
downloadaports-1e340f85df7db29ca1db6bf1350bf046c5023fbb.tar.bz2
aports-1e340f85df7db29ca1db6bf1350bf046c5023fbb.tar.xz
main/minetest: various fixes
- fix segfault due to JIT and PaX. Use shared lua instead of luajit - clean up init.d script. rename to minitest-server - use shared irrlicht - move pre-install script to -server subpackage - start with gameid 'minimal' by default for testing
-rw-r--r--main/minetest/APKBUILD58
-rw-r--r--main/minetest/minetest-server.confd6
-rw-r--r--main/minetest/minetest-server.initd35
-rw-r--r--main/minetest/minetest-server.pre-install3
-rw-r--r--main/minetest/minetest.confd9
-rw-r--r--main/minetest/minetest.initd37
-rw-r--r--main/minetest/minetest.pre-install3
-rw-r--r--main/minetest/shared-irrlicht.patch23
-rw-r--r--main/minetest/shared-lua.patch37
9 files changed, 143 insertions, 68 deletions
diff --git a/main/minetest/APKBUILD b/main/minetest/APKBUILD
index 3b788734e3..c3e02f2b17 100644
--- a/main/minetest/APKBUILD
+++ b/main/minetest/APKBUILD
@@ -2,19 +2,24 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=minetest
pkgver=0.4.11
-pkgrel=0
+pkgrel=1
pkgdesc="An infinite-world block sandbox game and a game engine"
url="http://minetest.net/"
arch="all"
-install="$pkgname.pre-install"
+install="$pkgname-server.pre-install"
license="LGPL2.1 CCBY-SA3.0"
depends="$pkgname-common"
+pkgusers="minetest"
+pkggroups="minetest"
makedepends="sqlite-dev bzip2-dev openssl-dev irrlicht-dev cmake libvorbis-dev
- libjpeg-turbo-dev libpng-dev openal-soft-dev libogg-dev mesa-dev sqlite-dev
- luajit-dev hiredis-dev"
+ libjpeg-turbo-dev libpng-dev openal-soft-dev libogg-dev mesa-dev
+ sqlite-dev lua5.1-dev hiredis-dev"
source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/minetest/${pkgname}/tar.gz/${pkgver}
- $pkgname.confd
- $pkgname.initd
+ minetest-server.confd
+ minetest-server.initd
+
+ shared-lua.patch
+ shared-irrlicht.patch
"
subpackages="$pkgname-doc $pkgname-common $pkgname-server"
@@ -37,9 +42,11 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \
-DCUSTOM_DOCDIR="/usr/share/doc/${pkgname}" \
-DCUSTOM_SHAREDIR="/usr/share/${pkgname}" \
+ -DDISABLE_LUAJIT=1 \
-DBUILD_CLIENT=1 \
-DBUILD_SERVER=0 \
-DENABLE_REDIS=0 \
+ -DENABLE_CURL=0 \
-DRUN_IN_PLACE=0 \
..
make || return 1
@@ -49,9 +56,11 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \
-DCUSTOM_DOCDIR="/usr/share/doc/minetest" \
-DCUSTOM_SHAREDIR="/usr/share/minetest" \
+ -DDISABLE_LUAJIT=1 \
-DBUILD_CLIENT=0 \
-DBUILD_SERVER=1 \
-DENABLE_REDIS=1 \
+ -DENABLE_CURL=0 \
-DRUN_IN_PLACE=0 \
..
make || return 1
@@ -59,9 +68,13 @@ build() {
common() {
arch="noarch"
+ install -o minetest -g minetest -d "$subpkgdir"/var/lib/minetest \
+ || return 1
mkdir -p "${subpkgdir}/usr/share/minetest"
- mv "${pkgdir}/usr/share/minetest/builtin" "${subpkgdir}/usr/share/minetest" || return 1
- mv "${pkgdir}/usr/share/minetest/games" "${subpkgdir}/usr/share/minetest" || return 1
+ mv "${pkgdir}/usr/share/minetest/builtin" \
+ "${subpkgdir}/usr/share/minetest" || return 1
+ mv "${pkgdir}/usr/share/minetest/games" \
+ "${subpkgdir}/usr/share/minetest" || return 1
}
package() {
@@ -72,20 +85,27 @@ package() {
server(){
mkdir -p "${subpkgdir}/usr/bin"
cd "${_builddir}"
- install -m644 -D $pkgname.conf.example "$subpkgdir"/etc/$pkgname/$pkgname.conf
- install -D -m755 "$srcdir"/$pkgname.initd \
- "$subpkgdir"/etc/init.d/$pkgname || return 1
- install -D -m644 "$srcdir"/$pkgname.confd \
- "$subpkgdir"/etc/conf.d/$pkgname || return 1
+ install -m644 -D $pkgname.conf.example \
+ "$subpkgdir"/etc/$pkgname/$pkgname.conf || return 1
+ install -D -m755 "$srcdir"/minetest-server.initd \
+ "$subpkgdir"/etc/init.d/minetest-server || return 1
+ install -D -m644 "$srcdir"/minetest-server.confd \
+ "$subpkgdir"/etc/conf.d/minetest-server || return 1
cp bin/minetestserver ${subpkgdir}/usr/bin
}
md5sums="c84858129b822a246f4b66a4a425d0fb minetest-0.4.11.tar.gz
-89529d4af9bddc6504979404d609bb96 minetest.confd
-3da0c6a91862cdbfe70665a6ed300085 minetest.initd"
+505dcc499ba84632cc3a5db97e9d56b5 minetest-server.confd
+e450cb79ca74345149bf1c18f3c3ad98 minetest-server.initd
+9abfd27a3f46b4b004ed9418eef8820a shared-lua.patch
+83ef89fa320627dffa464f113c3169e6 shared-irrlicht.patch"
sha256sums="aefcd25589be923e5a9f4343f5062984438ee6f1dd617bce1ae6eef9b71e4240 minetest-0.4.11.tar.gz
-f1d54fc223b5330d7b6cf20e2a0b96cfb4f56ee236072d9379c63b0b11452178 minetest.confd
-7489226264d91452e6048d8ff99e0c9451f3b9976c22c502722d6b280a489bd5 minetest.initd"
+b8b02cdb070037fe4a0d01279edb9598ecfaa8bedf66ed991c6a00f2edbc5d7b minetest-server.confd
+7b6a9bc535c8fbdd82e29256a5d2a4c4256635a6231c6c3824f9c01df6672552 minetest-server.initd
+444d406183c3e5c6139386bfc870faef7062067a2a1cb3250c3ef41f02ff9b94 shared-lua.patch
+12d03fb8f9523028dacd5fd45d74dfe901b6d659698cf90aafa8f164018f28cc shared-irrlicht.patch"
sha512sums="8dcc531d41c86b9c66723a35d3dd8757e6f7c79a609330fcd826c8f83929ea957ab6eecbb3bbc1fef532fdcacd61928a359b4296d39f445ce901a389a8e4c63c minetest-0.4.11.tar.gz
-98c4cf9b9957f69a0ceae771b7c2173fb4c7e4ad636081b6cb52168cb7a26f7f7f61c885718a2241c6f6d652d8d43bc5989b5fab95e3bf9dce4dd423c6ca3ab0 minetest.confd
-5fe9de23f90cecbe74a6d096de3c6bb2bacc376cdcd412ce36586e2bdac31906a97804d3c59a5f1cc9942b4305ac2ba77caad74a78c4ccd03d1fba00244ca6b1 minetest.initd"
+7bca17dc0bd59db9c07c160677498aa09297026104e922bf93b7629c274d0aebd226af60c5e82f49ffe3cc5c1e4448e3798b6c2a44144fc6eca4d3aaed3384bb minetest-server.confd
+5dd13febee19f2360269a505a0bd0e99bdee3af1532e8ffc51d4be627a1ca686f7ca44d923e13c88e76812a4bc2e4fdb964375e4db0dbff6cd523a83c88d1f47 minetest-server.initd
+0716ea12458533b5687d84ac6b3047d8b257b9c1ccef807586dee7ef392ffbd19157e04a63c67ce3d3f221111c5ff12c02e8f9b224a31a7653ebd3f073487e79 shared-lua.patch
+d737d076db32bf62df73f6568f7423511ee27573c08fb975c8d876f7cd56a8f942804ed667b9988f3048cb1efdb52fca0ae9a4f1ff1e912607c7d3765b6149e7 shared-irrlicht.patch"
diff --git a/main/minetest/minetest-server.confd b/main/minetest/minetest-server.confd
new file mode 100644
index 0000000000..dfd2f8acf9
--- /dev/null
+++ b/main/minetest/minetest-server.confd
@@ -0,0 +1,6 @@
+#USER="minetest"
+#GROUP="games"
+#LOG="/var/lib/minetest/minetestd.log"
+#CONFIG="/etc/minetest/minetest.conf"
+#ARGS=""
+GAMEID="minimal"
diff --git a/main/minetest/minetest-server.initd b/main/minetest/minetest-server.initd
new file mode 100644
index 0000000000..0551c61a2f
--- /dev/null
+++ b/main/minetest/minetest-server.initd
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+
+description="Minetest server"
+
+pidfile="/var/run/$SVCNAME.pid"
+command="/usr/bin/minetestserver"
+
+start_stop_daemon_args="--user ${USER:-minetest} --group ${GROUP:-games}
+ --make-pidfile --pidfile $pidfile --background --quiet --wait 300"
+command_args="$ARGS"
+
+
+depend() {
+ need net
+ after firewall
+}
+
+optional_command_arg() {
+ if [ -n "$2" ]; then
+ command_args="$command_args $1 $2"
+ fi
+}
+
+start_pre() {
+ optional_command_arg --log $LOG
+ optional_command_arg --config $CONFIG
+ optional_command_arg --gameid $GAMEID
+}
+
+reload() {
+ ebegin "Reloading $SVCNAME"
+ start-stop-daemon --signal HUP \
+ --exec "$EXEC" --pidfile "$pidfile"
+ eend $?
+}
diff --git a/main/minetest/minetest-server.pre-install b/main/minetest/minetest-server.pre-install
new file mode 100644
index 0000000000..f995e427d6
--- /dev/null
+++ b/main/minetest/minetest-server.pre-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+adduser -s /sbin/nologin -D -h /var/lib/minetest minetest games 2>/dev/null
+exit 0
diff --git a/main/minetest/minetest.confd b/main/minetest/minetest.confd
deleted file mode 100644
index 5142f00bcb..0000000000
--- a/main/minetest/minetest.confd
+++ /dev/null
@@ -1,9 +0,0 @@
-USER="minetest"
-GROUP="games"
-PID="/var/run/minetest.pid"
-EXEC="/usr/bin/minetestserver"
-LOG="/var/lib/minetest/minetestd.log"
-CONFIG="/etc/minetest/minetest.conf"
-# Optional arguments, see man minetest
-# HINT: emerge games-mud/minetest-mod and use ARGS="--gameid minetest-mod" to enable pretty textures
-ARGS=""
diff --git a/main/minetest/minetest.initd b/main/minetest/minetest.initd
deleted file mode 100644
index cf47b81a54..0000000000
--- a/main/minetest/minetest.initd
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/sbin/runscript
-
-description="Minetest server"
-
-depend() {
- need net
-}
-
-start() {
- ebegin "Starting $SVCNAME"
- start-stop-daemon \
- --start \
- --user $USER \
- --group $GROUP \
- --make-pidfile \
- --pidfile $PID \
- --background \
- --quiet \
- --exec $EXEC -- "--config $CONFIG --logfile $LOG $ARGS"
- eend $?
-}
-
-stop() {
- ebegin "Stopping $SVCNAME"
- start-stop-daemon \
- --stop \
- --quiet \
- --pidfile $PID
- eend $?
-}
-
-reload() {
- ebegin "Reloading $SVCNAME"
- start-stop-daemon --signal HUP \
- --exec "$EXEC" --pidfile "$PID"
- eend $?
-}
diff --git a/main/minetest/minetest.pre-install b/main/minetest/minetest.pre-install
deleted file mode 100644
index 72a562bd68..0000000000
--- a/main/minetest/minetest.pre-install
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-adduser -s /bin/false -D -h /var/lib/minetest minetest games 2>/dev/null
-exit 0
diff --git a/main/minetest/shared-irrlicht.patch b/main/minetest/shared-irrlicht.patch
new file mode 100644
index 0000000000..b552c09370
--- /dev/null
+++ b/main/minetest/shared-irrlicht.patch
@@ -0,0 +1,23 @@
+commit 11d35e62fe13b47c5b34139559e650dfe6ebbd84
+Author: hasufell <julian.ospald@googlemail.com>
+Date: Sat Jun 8 13:40:30 2013 +0200
+
+ CMAKE: use shared lib from Irrlicht
+
+diff --git a/cmake/Modules/FindIrrlicht.cmake b/cmake/Modules/FindIrrlicht.cmake
+index bd00422..4632993 100644
+--- a/cmake/Modules/FindIrrlicht.cmake
++++ b/cmake/Modules/FindIrrlicht.cmake
+@@ -50,10 +50,11 @@ else()
+ /usr/include/irrlicht
+ )
+
+- FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.a Irrlicht
++ FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.so Irrlicht
+ PATHS
+ /usr/local/lib
+ /usr/lib
++ /usr/lib64
+ )
+ endif()
+
diff --git a/main/minetest/shared-lua.patch b/main/minetest/shared-lua.patch
new file mode 100644
index 0000000000..c31c8514ea
--- /dev/null
+++ b/main/minetest/shared-lua.patch
@@ -0,0 +1,37 @@
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -215,8 +215,6 @@
+ message (STATUS "LuaJIT headers: ${LUA_INCLUDE_DIR}")
+ else (NOT ${DISABLE_LUAJIT} MATCHES "1")
+ message (STATUS "LuaJIT detection disabled! (DISABLE_LUAJIT=1)")
+- set(LUA_LIBRARY "")
+- set(LUA_INCLUDE_DIR "")
+ endif (NOT DISABLE_LUAJIT)
+
+ set(USE_LUAJIT 0)
+@@ -267,11 +265,22 @@
+ endif (VALID_LUAJIT_VERSION)
+ endif (LUA_LIBRARY AND LUA_INCLUDE_DIR)
+
++OPTION(WITH_BUNDLED_LUA "Use bundled lua")
++
+ if(NOT USE_LUAJIT)
+ message (STATUS "LuaJIT not found, using bundled Lua.")
+- set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
+- set(LUA_LIBRARY "lua")
+- add_subdirectory(lua)
++ if (WITH_BUNDLED_LUA)
++ set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
++ set(LUA_LIBRARY "lua")
++ add_subdirectory(lua)
++ else (WITH_BUNDLED_LUA)
++ find_package(Lua51)
++ if(LUA51_FOUND)
++ message (STATUS "Lua51 found")
++ else(LUA51_FOUND)
++ message (FATAL_ERROR "Lua51 not found!")
++ endif(LUA51_FOUND)
++ endif(WITH_BUNDLED_LUA)
+ endif(NOT USE_LUAJIT)
+
+ mark_as_advanced(LUA_LIBRARY)