Name: multicraft Version: 2.0.3 Release: 1%{?dist} Summary: Minenux Multicraft Minetest fork for sandbox infinite block world License: LGPLv2+ and CC-BY-SA URL: https://codeberg.org/minenux/minetest-engine-multicraft Source0: %{name}_%{version}.orig.tar.gz #Patch0001: 0001-mapper.patch %if 0%{?rhel} ExclusiveArch: %{ix86} x86_64 %else # LuaJIT arches ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64 ppc64le %endif BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake >= 3.0 BuildRequires: irrlicht-devel BuildRequires: jsoncpp-devel BuildRequires: luajit-devel BuildRequires: bzip2-devel gettext-devel sqlite-devel zlib-devel BuildRequires: libpng-devel libjpeg-turbo-devel libXxf86vm mesa-libGL-devel BuildRequires: desktop-file-utils BuildRequires: systemd BuildRequires: openal-soft-devel BuildRequires: libvorbis-devel BuildRequires: libcurl-devel libidn-devel BuildRequires: leveldb-devel BuildRequires: gmp-devel BuildRequires: libappstream-glib BuildRequires: freetype-devel Requires: %{name}-server = %{version}-%{release} Requires: %{name}-data = %{version}-%{release} Requires: hicolor-icon-theme %description Game of mining, crafting and building in the infinite world of cubic blocks with optional hostile creatures, features both single and the network multiplayer mode, mods. Public multiplayer servers are available. %package server Summary: multicraft multiplayer server only for LAN and network remote play Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Requires: %{name}-data = %{version}-%{release} %description server Game of mining, crafting and building in the infinite world of cubic blocks with optional hostile creatures, features both single and the network multiplayer mode. This is Multicraft multiplayer server only serve the game to connect to %package data Summary: multicraft common data between client and server %description data Multicraft common data. This package is shared between multicraft server and client. %if 0%{?fedora_version} > 32 %global debug_package %{nil} %endif %prep %autosetup -p1 #game datapackage are included #cp %{SOURCE4} /doc # purge bundled jsoncpp and lua, and gmp :P rm -vrf lib/jsoncpp lib/lua lib/gmp find . -name .gitignore -print -delete find . -name .travis.yml -print -delete find . -name .luacheckrc -print -delete %build %undefine _hardened_build %undefine _annotated_build %undefine _strict_symbol_defs_build CFLAGS="-O3 -fomit-frame-pointer -Wall -ffp-contract=off" CXXFLAGS="-O3 -fomit-frame-pointer -Wall -ffp-contract=off -fpermissive" LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,now" %ifarch x86_64 CFLAGS="-O3 -fomit-frame-pointer -mtune=nocona -mmmx -msse -msse2 -Wall -ffp-contract=off" CXXFLAGS="-O3 -fomit-frame-pointer -mtune=nocona -mmmx -msse -msse2 -Wall -ffp-contract=off -fpermissive" %endif %ifarch %{ix86} CFLAGS="-O3 -march=pentium3 -mtune=nocona -mfpmath=sse -fomit-frame-pointer -mmmx -msse -msse2 -mno-sse4 -mno-sse3 -fpermissive -Wall -fexpensive-optimizations" CXXFLAGS="-O3 -march=pentium3 -mtune=nocona -mfpmath=sse -fomit-frame-pointer -mmmx -msse -msse2 -mno-sse4 -mno-sse3 -fpermissive -Wall -fexpensive-optimizations -fpermissive" %endif %ifarch aarch64 %define _lto_cflags %{nil} %endif # -DFREETYPE_INCLUDE_DIR_freetype2=/usr/include/freetype2 \ # -DFREETYPE_INCLUDE_DIR_ft2build=/usr/include \ # -DLEVELDB_INCLUDE_DIR=/usr/include/leveldb \ %cmake -DENABLE_CURL=TRUE \ -DENABLE_LEVELDB=TRUE \ -DENABLE_LUAJIT=TRUE \ -DENABLE_GETTEXT=TRUE \ -DENABLE_SOUND=TRUE \ -DENABLE_SYSTEM_JSONCPP=TRUE \ -DENABLE_SYSTEM_GMP=TRUE \ -DENABLE_FREETYPE=TRUE \ -DBUILD_SERVER=TRUE \ -DBUILD_CLIENT=TRUE \ -DRUN_IN_PLACE=0 \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCUSTOM_LOCALEDIR=%{_datadir}/locale \ -DCUSTOM_SHAREDIR=%{_datadir}/games/%{name} \ -DENABLE_POSTGRESQL=1 \ -DJSON_INCLUDE_DIR=/usr/include/json \ %{nil} %if 0%{?fedora_version} > 32 %cmake_build %else make %{?_smp_mflags} VERBOSE=1 %endif %install %if 0%{?fedora_version} > 32 %cmake_install %else %make_install %endif # Add desktop file is done by install #desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} # Systemd unit file # mkdir -p %{buildroot}%{_unitdir}/ # install -m 0644 %{SOURCE3} %{buildroot}%{_unitdir} # /etc/rsyslog.d/multicraft.conf # mkdir -p %{buildroot}%{_sysconfdir}/rsyslog.d/ # install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rsyslog.d/%{name}.conf # /etc/logrotate.d/multicraft # mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/ # install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} # /var/lib/multicraft directory for server data files install -d -m 0775 %{buildroot}%{_sharedstatedir}/%{name}/ # /etc/multicraft/multicraft.conf install -d -m 0775 %{buildroot}%{_sysconfdir}/%{name}/ install -d -m 0775 %{buildroot}%{_sysconfdir}/sysconfig/%{name}/ # /etc/sysconfig/multicraft.conf # install -d -m 0775 %{buildroot}%{_sysconfdir}/sysconfig/%{name}/ # install -m 0664 %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/%{name} # Move doc directory back to the sources mkdir __doc mv %{buildroot}%{_datadir}/doc/%{name}/* __doc rm -rf %{buildroot}%{_datadir}/doc/%{name} %find_lang %{name} %post /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %postun if [ $1 -eq 0 ] ; then /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi %posttrans /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %pre server getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || \ useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \ -c "multicraft-server" %{name} exit 0 %post server %systemd_post %{name}@%{name}.service %preun server %systemd_preun %{name}@%{name}.service %postun server %systemd_postun_with_restart %{name}@%{name}.service %%files -f %%{name}.lang %files %{_bindir}/%{name} %{_datadir}/applications/*.desktop %{_mandir}/man6/%{name}.* %files server %doc README.* doc/*.txt %{_bindir}/%{name}server %{_unitdir}/%{name}@.service %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/rsyslog.d/%{name}.conf %attr(-,multicraft,multicraft)%{_sharedstatedir}/%{name}/ %attr(-,multicraft,multicraft)%{_sysconfdir}/%{name}/ %attr(-,multicraft,multicraft)%{_sysconfdir}/sysconfig/%{name}/ %{_mandir}/man6/%{name}server.* %files data %{_datadir}/games/%{name}/games %{_datadir}/games/%{name}/builtin %{_datadir}/games/%{name}/client %{_datadir}/games/%{name}/clientmods %{_datadir}/games/%{name}/fonts %{_datadir}/games/%{name}/textures %{_datadir}/icons/hicolor/*/apps/%{name}.png %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{_datadir}/metainfo/*.appdata.xml %{_datadir}/locale/*/*/%{name}.mo %changelog * Mon Dic 26 2022 PICCORO Lenz McKAY - 2.0.3-1 - Basic build of the current stable version - change all patchs to multicraft path - set all to multicraft as project sufix