1
0

fix sound build as auto on RPM for sus,rhel,centos

This commit is contained in:
mckaygerhard 2023-01-03 16:50:27 -04:00
parent f6e0c35ab3
commit 29f9699d71
2 changed files with 61 additions and 22 deletions

View File

@ -18,11 +18,33 @@ 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://codeberg.org/minenux/minetest-game-minetest.git ./games/minetest_game && \
RUN apk add --no-cache git build-base \
bzip2-dev \
cmake \
gmp-dev \
curl-dev \
freetype-dev \
gettext-dev \
hiredis-dev \
libjpeg-turbo-dev \
irrlicht-dev \
libogg-dev \
libpng-dev \
libvorbis-dev \
libxi-dev \
luajit-dev \
jsoncpp-dev \
mesa-dev \
openal-soft-dev \
openssl-dev \
samurai \
postgresql-dev \
sqlite-dev \
zlib-dev \
zstd-dev \
libxxf86vm-dev \
ca-certificates && \
git clone --depth=1 -b master https://codeberg.org/minenux/minetest-game-minetest.git ./games/minetest_game && \
rm -fr ./games/minetest_game/.git
WORKDIR /usr/src/
@ -30,7 +52,7 @@ 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_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=0 && \
make -j2 && \
@ -40,11 +62,31 @@ WORKDIR /usr/src/multicraft
RUN mkdir build && \
cd build && \
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SERVER=TRUE \
-DENABLE_PROMETHEUS=TRUE \
-DBUILD_UNITTESTS=FALSE \
-DCUSTOM_BINDIR=/usr/bin \
-DCUSTOM_DOCDIR="/usr/share/doc/$pkgname" \
-DCUSTOM_SHAREDIR="/usr/share/games/$pkgname" \
-DBUILD_SERVER=ON \
-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 \
-DENABLE_SPATIAL=ON \
-DENABLE_LEVELDB=ON \
-DENABLE_REDIS=OFF \
-DENABLE_POSTGRESQL=ON \
-DJSON_INCLUDE_DIR=/usr/include/jsoncpp \
-DFREETYPE_INCLUDE_DIR_freetype2=/usr/include/freetype2 \
-DFREETYPE_INCLUDE_DIR_ft2build=/usr/include \
-DLEVELDB_INCLUDE_DIR=/usr/include/leveldb \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DBUILD_CLIENT=FALSE && \
make -j2 && \
make install
@ -52,17 +94,15 @@ RUN mkdir build && \
FROM alpine:3.14
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
adduser -D multicraft --uid 30000 -h /var/games/multicraft && \
chown -R multicraft:multicraft /var/games/multicraft
WORKDIR /var/lib/multicraft
WORKDIR /var/games/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
USER multicraft:multicraft
EXPOSE 30000/udp 30000/tcp
CMD ["/usr/local/bin/multicraftserver", "--config", "/etc/multicraft/multicraft.conf"]
CMD ["/usr/bin/multicraftserver", "--port", "30000", "--config", "/etc/multicraft/multicraft.conf", "--logfile", "/var/games/multicraft.log", "--server"]

View File

@ -199,18 +199,18 @@ LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,now"
-DPNG_PNG_INCLUDE_DIR=$(pkg-config libpng --variable=includedir) \
%{nil}
%if 0%{?fedora_version} > 32
%cmake_build
%else
%if 0%{?rhel}
make %{?_smp_mflags} VERBOSE=1
%else
%cmake_build
%endif
%install
%if 0%{?fedora_version} > 32
%cmake_install
%else
%if 0%{?rhel}
%make_install
%else
%cmake_install
%endif
# Clean up.
@ -259,7 +259,6 @@ getent passwd %{name} > /dev/null || %{_sbindir}/useradd -r -g %{multicraftgroup
%config %{_sysconfdir}/%{name}/multicraft.conf.example
%{_unitdir}/%{name}@.service
%{_sysconfdir}/logrotate.d/%{name}
# %config(noreplace) %{_sysconfdir}/rsyslog.d/%{name}.conf
%files data
%license LICENSE.txt