Compare commits
2 Commits
7385d3de42
...
076330bac6
Author | SHA1 | Date | |
---|---|---|---|
076330bac6 | |||
dad9ed70f3 |
@ -130,7 +130,7 @@ elseif(UNIX) # Linux, BSD etc
|
|||||||
set(ICONDIR "unix/icons")
|
set(ICONDIR "unix/icons")
|
||||||
set(LOCALEDIR "locale")
|
set(LOCALEDIR "locale")
|
||||||
else()
|
else()
|
||||||
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share")
|
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
|
||||||
set(BINDIR "${CMAKE_INSTALL_PREFIX}/games")
|
set(BINDIR "${CMAKE_INSTALL_PREFIX}/games")
|
||||||
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
|
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
|
||||||
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
|
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
|
||||||
@ -242,7 +242,8 @@ if(UNIX AND NOT APPLE)
|
|||||||
DESTINATION "${ICONDIR}/hicolor/128x128/apps"
|
DESTINATION "${ICONDIR}/hicolor/128x128/apps"
|
||||||
RENAME "multicraft.png")
|
RENAME "multicraft.png")
|
||||||
install(FILES "doc/multicraftserver.confd" DESTINATION "${ETCDIR}/conf.d" RENAME "${PROJECT_NAME}server")
|
install(FILES "doc/multicraftserver.confd" DESTINATION "${ETCDIR}/conf.d" RENAME "${PROJECT_NAME}server")
|
||||||
install(FILES "doc/multicraftserver.defaults" DESTINATION "${ETCDIR}/defaults" RENAME "${PROJECT_NAME}server")
|
install(FILES "doc/multicraftserver.defaults" DESTINATION "${ETCDIR}/default" RENAME "${PROJECT_NAME}server")
|
||||||
|
install(FILES "doc/multicraftserver.defaults" DESTINATION "${ETCDIR}/sysconfig" RENAME "${PROJECT_NAME}server")
|
||||||
if(NOT RUN_IN_PLACE)
|
if(NOT RUN_IN_PLACE)
|
||||||
install(FILES "doc/multicraftserver.init" DESTINATION "${ETCDIR}/init.d" RENAME "${PROJECT_NAME}server")
|
install(FILES "doc/multicraftserver.init" DESTINATION "${ETCDIR}/init.d" RENAME "${PROJECT_NAME}server")
|
||||||
# install(FILES "doc/multicraftserver.initd" DESTINATION "${CMAKE_INSTALL_PREFIX}/etc/init.d" RENAME "${PROJECT_NAME}server")
|
# install(FILES "doc/multicraftserver.initd" DESTINATION "${CMAKE_INSTALL_PREFIX}/etc/init.d" RENAME "${PROJECT_NAME}server")
|
||||||
|
79
Dockerfile
79
Dockerfile
@ -1,68 +1,29 @@
|
|||||||
FROM alpine:3.14
|
FROM alpine:3.18
|
||||||
|
|
||||||
ENV MINETEST_GAME_VERSION stable-5.2
|
|
||||||
|
|
||||||
COPY .git /usr/src/multicraft/.git
|
|
||||||
COPY CMakeLists.txt /usr/src/multicraft/CMakeLists.txt
|
|
||||||
COPY README.md /usr/src/multicraft/README.md
|
|
||||||
COPY multicraft.conf.example /usr/src/multicraft/multicraft.conf.example
|
|
||||||
COPY builtin /usr/src/multicraft/builtin
|
|
||||||
COPY cmake /usr/src/multicraft/cmake
|
|
||||||
COPY doc /usr/src/multicraft/doc
|
|
||||||
COPY fonts /usr/src/multicraft/fonts
|
|
||||||
COPY lib /usr/src/multicraft/lib
|
|
||||||
COPY misc /usr/src/multicraft/misc
|
|
||||||
COPY po /usr/src/multicraft/po
|
|
||||||
COPY src /usr/src/multicraft/src
|
|
||||||
COPY textures /usr/src/multicraft/textures
|
|
||||||
|
|
||||||
WORKDIR /usr/src/multicraft
|
|
||||||
|
|
||||||
RUN apk add --no-cache git build-base irrlicht-dev cmake bzip2-dev libpng-dev \
|
|
||||||
jpeg-dev libxxf86vm-dev mesa-dev sqlite-dev libogg-dev \
|
|
||||||
libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev \
|
|
||||||
gmp-dev jsoncpp-dev postgresql-dev luajit-dev ca-certificates && \
|
|
||||||
git clone --depth=1 -b ${MINETEST_GAME_VERSION} https://github.com/minetest/minetest_game.git ./games/minetest_game && \
|
|
||||||
rm -fr ./games/minetest_game/.git
|
|
||||||
|
|
||||||
WORKDIR /usr/src/
|
|
||||||
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
|
|
||||||
mkdir prometheus-cpp/build && \
|
|
||||||
cd prometheus-cpp/build && \
|
|
||||||
cmake .. \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DENABLE_TESTING=0 && \
|
|
||||||
make -j2 && \
|
|
||||||
make install
|
|
||||||
|
|
||||||
|
RUN apk add --no-cache git build-base cmake pkgconf gettext-dev bzip2-dev curl-dev libnl3-dev rtmpdump-dev libidn-dev ncurses-dev freetype-dev mesa-dev gmp-dev irrlicht-dev libjpeg-turbo-dev jsoncpp-dev leveldb-dev luajit-dev lua5.1-dev libogg-dev openal-soft-dev libpng-dev postgresql-dev hiredis-dev sqlite-dev libvorbis-dev libxi-dev zlib-dev doxygen libxrandr-dev libx11-dev zstd-dev openssl-dev samurai
|
||||||
|
WORKDIR /usr/src
|
||||||
|
RUN cd /usr/src && \
|
||||||
|
git clone --depth=1 -b minenux https://gitlab.com/minenux/minetest-engine-multicraft2 multicraft && \
|
||||||
|
cd multicraft && \
|
||||||
|
git clone --depth=1 -b stable-5.2 https://codeberg.org/minenux/minetest-game-minetest ./games/minetest && \
|
||||||
|
rm -fr ./games/minetest/.git
|
||||||
WORKDIR /usr/src/multicraft
|
WORKDIR /usr/src/multicraft
|
||||||
RUN mkdir build && \
|
RUN mkdir build && \
|
||||||
cd build && \
|
cd build && \
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
-DCMAKE_INSTALL_PREFIX=/usr/ -DBUILD_SERVER=ON -DBUILD_CLIENT=OFF -DRUN_IN_PLACE=OFF -DENABLE_CURL=ON -DENABLE_SOUND=ON -DENABLE_LUAJIT=ON -DENABLE_GETTEXT=ON -DENABLE_FREETYPE=ON -DENABLE_SYSTEM_GMP=ON -DENABLE_SYSTEM_JSONCPP=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_POSTGRESQL=ON \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DRUN_IN_PLACE=OFF -DCUSTOM_BINDIR=/usr/games -DCUSTOM_LOCALEDIR=/usr/share/locale -DCUSTOM_SHAREDIR=/usr/share/games/multicraft -DCUSTOM_EXAMPLE_CONF_DIR=/etc/multicraft .. \
|
||||||
-DBUILD_SERVER=TRUE \
|
make && \
|
||||||
-DENABLE_PROMETHEUS=TRUE \
|
|
||||||
-DBUILD_UNITTESTS=FALSE \
|
|
||||||
-DBUILD_CLIENT=FALSE && \
|
|
||||||
make -j2 && \
|
|
||||||
make install
|
make install
|
||||||
|
|
||||||
FROM alpine:3.14
|
FROM alpine:3.18
|
||||||
|
|
||||||
RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit && \
|
|
||||||
adduser -D multicraft --uid 30000 -h /var/lib/multicraft && \
|
|
||||||
chown -R multicraft:multicraft /var/lib/multicraft
|
|
||||||
|
|
||||||
WORKDIR /var/lib/multicraft
|
|
||||||
|
|
||||||
COPY --from=0 /usr/local/share/multicraft /usr/local/share/multicraft
|
|
||||||
COPY --from=0 /usr/local/bin/multicraftserver /usr/local/bin/multicraftserver
|
|
||||||
COPY --from=0 /usr/local/share/doc/multicraft/multicraft.conf.example /etc/multicraft/multicraft.conf
|
|
||||||
|
|
||||||
|
RUN apk add --no-cache libstdc++ libgcc bzip2 curl libnl3 librtmp libidn libintl libncursesw freetype mesa-gl gmp irrlicht libjpeg-turbo jsoncpp leveldb luajit lua5.1 libogg openal-soft-libs libpng libpq hiredis sqlite-libs libvorbis libxi zlib-dev libxrandr libx11 zstd && \
|
||||||
|
mkdir -p /var/games/multicraft && adduser -D multicraft --uid 30000 -h /var/games/multicraft && chown -R multicraft:multicraft /var/games/multicraft
|
||||||
|
COPY --from=0 /usr/share/games/multicraft /usr/share/games/multicraft
|
||||||
|
COPY --from=0 /usr/games/multicraftserver /usr/games/multicraftserver
|
||||||
|
COPY --from=0 /etc/multicraft/multicraft.conf /etc/multicraft/multicraft.conf
|
||||||
USER multicraft:multicraft
|
USER multicraft:multicraft
|
||||||
|
EXPOSE 40000/udp 40000/tcp
|
||||||
EXPOSE 30000/udp 30000/tcp
|
WORKDIR /var/games/multicraft
|
||||||
|
CMD ["/usr/games/multicraftserver", "--port", "40000", "--config", "/etc/multicraft/multicraft.conf", "--gameid", "minetest", "--world", "minetest"]
|
||||||
CMD ["/usr/local/bin/multicraftserver", "--config", "/etc/multicraft/multicraft.conf"]
|
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
# alpine based server default distro config file
|
# ALPINE based server default distro config file
|
||||||
|
# for apk place as /etc/conf.d/multicraftserver
|
||||||
|
# for deb place as /etc/defaults/multicraftserver
|
||||||
|
# for rpm place as /etc/sysconfig/multicraftserver
|
||||||
USER="multicraft"
|
USER="multicraft"
|
||||||
GROUP="games"
|
GROUP="games"
|
||||||
LOG="/var/log/multicraft/multicraft.log"
|
LOG="/var/log/multicraft/multicraft.log"
|
||||||
CONFIG="/etc/multicraft/multicraft.conf"
|
CONFIG="/etc/multicraft/multicraft.conf"
|
||||||
ARGS=""
|
ARGS=""
|
||||||
GAMEID="minenux"
|
GAMEID="minetest"
|
||||||
|
WORLD="default"
|
||||||
|
@ -7,4 +7,5 @@ GROUP="games"
|
|||||||
LOG="/var/log/multicraft/multicraft.log"
|
LOG="/var/log/multicraft/multicraft.log"
|
||||||
CONFIG="/etc/multicraft/multicraft.conf"
|
CONFIG="/etc/multicraft/multicraft.conf"
|
||||||
ARGS=""
|
ARGS=""
|
||||||
GAMEID="minenux"
|
GAMEID="minetest"
|
||||||
|
WORLD="default"
|
||||||
|
@ -26,18 +26,13 @@ if [ -f /etc/default/$NAME ] ; then
|
|||||||
. /etc/default/$NAME
|
. /etc/default/$NAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DAEMON_OPTS = "--logfile $LOG --config $CONFIG --gameid $GAMEID"
|
DAEMON_OPTS = "--world $WORLD --logfile $LOG --config $CONFIG --gameid $GAMEID"
|
||||||
|
|
||||||
multicraft_start() {
|
multicraft_start() {
|
||||||
start-stop-daemon \
|
start-stop-daemon --chdir /var/games/multicraft --user ${USER:-multicraft} --chuid ${USER:-multicraft} --group ${GROUP:-games} --make-pidfile --pidfile $PIDFILE --background --quiet --wait 300 \
|
||||||
--start \
|
--start \
|
||||||
--quiet \
|
|
||||||
--pidfile $PIDFILE \
|
|
||||||
--oknodo \
|
--oknodo \
|
||||||
--background \
|
|
||||||
--exec $BINARY \
|
--exec $BINARY \
|
||||||
--startas $DAEMON \
|
|
||||||
--make-pidfile --chuid $USER \
|
|
||||||
-- $DAEMON_OPTS > /dev/null 2>&1 || return 1
|
-- $DAEMON_OPTS > /dev/null 2>&1 || return 1
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -45,7 +40,6 @@ multicraft_start() {
|
|||||||
multicraft_stop() {
|
multicraft_stop() {
|
||||||
start-stop-daemon \
|
start-stop-daemon \
|
||||||
--stop \
|
--stop \
|
||||||
--quiet \
|
|
||||||
--pidfile $PIDFILE \
|
--pidfile $PIDFILE \
|
||||||
--oknodo \
|
--oknodo \
|
||||||
--exec $BINARY || return 1
|
--exec $BINARY || return 1
|
||||||
@ -78,7 +72,6 @@ case "$1" in
|
|||||||
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
|
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
|
|
||||||
echo "Usage: $0 {start|stop|restart|force-reload|status|reload}" >&2
|
echo "Usage: $0 {start|stop|restart|force-reload|status|reload}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
description="multicraftserver daemon by MinenuX"
|
description="multicraftserver daemon by MinenuX"
|
||||||
|
|
||||||
pidfile="/var/run/$SVCNAME.pid"
|
pidfile="/var/run/$SVCNAME.pid"
|
||||||
command="/usr/bin/multicraftserver"
|
command="/usr/games/multicraftserver"
|
||||||
|
|
||||||
start_stop_daemon_args="--user ${USER:-multicraft} --group ${GROUP:-games} --make-pidfile --pidfile $pidfile --background --quiet --wait 300"
|
start_stop_daemon_args="--chdir /var/games/multicraft --user ${USER:-multicraft} --group ${GROUP:-games} --make-pidfile --pidfile $pidfile --background --quiet --wait 300"
|
||||||
command_args="$ARGS"
|
command_args="$ARGS"
|
||||||
|
|
||||||
|
|
||||||
@ -21,6 +21,7 @@ optional_command_arg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_pre() {
|
start_pre() {
|
||||||
|
optional_command_arg --world $WORLD
|
||||||
optional_command_arg --logfile $LOG
|
optional_command_arg --logfile $LOG
|
||||||
optional_command_arg --config $CONFIG
|
optional_command_arg --config $CONFIG
|
||||||
optional_command_arg --gameid $GAMEID
|
optional_command_arg --gameid $GAMEID
|
||||||
|
@ -3,12 +3,13 @@ Description=multicraftserver daemon for multicraft.conf by MinenuX
|
|||||||
Documentation=man:multicraftserver(6)
|
Documentation=man:multicraftserver(6)
|
||||||
After=network.target
|
After=network.target
|
||||||
RequiresMountsFor=/var/games/multicraft
|
RequiresMountsFor=/var/games/multicraft
|
||||||
|
EnvironmentFile=-/etc/sysconfig/multicrafserver
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
User=multicraft
|
User=multicraft
|
||||||
Group=games
|
Group=games
|
||||||
ExecStart=/usr/games/multicraftserver --config /etc/multicraft/multicraft.conf --logfile /var/log/multicraft/multicraft.log
|
ExecStart=/usr/games/multicraftserver --world ${WORLD:-default} --logfile /var/log/multicraft/multicraft.log --config ${CONFIG:-/etc/multicraft/multicraft.conf} --gameid ${GAMEID:-minetest}
|
||||||
StandardOutput=null
|
StandardOutput=null
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -8,7 +8,7 @@ RequiresMountsFor=/var/games/multicraft
|
|||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
User=multicraft
|
User=multicraft
|
||||||
Group=games
|
Group=games
|
||||||
ExecStart=/usr/games/multicraftserver --config /etc/multicraft/%i.conf --logfile /var/log/multicraft/%i.log --gameid %i
|
ExecStart=/usr/games/multicraftserver --world %i --config /etc/multicraft/%i.conf --logfile /var/log/multicraft/%i.log --gameid %i
|
||||||
StandardOutput=null
|
StandardOutput=null
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user