%global irr_version 1.9.0mt15 %global alt_name minetest %global rel 1 # Version in CMakeLists.txt in minetest directory %global git_date 20250104 %global git_hash 5bcb7983e %global git_ver 5.11.0 %global src_name %{alt_name}-%{git_date}-%{git_hash}.tar.xz %global gamedate 20241221 %global gamehash 9bcf2d4 %global gamever 5.8.0 %global gamename %{alt_name}_game-%{gamedate}-%{gamehash}.tar.xz Name: luanti Version: %{git_ver}^%{git_date}g%{git_hash} Release: %{rel}%{?dist} Summary: Multiplayer infinite-world block sandbox with survival mode License: LGPLv2+ and CC-BY-SA URL: https://luanti.org/ Source0: %{url}/%{src_name} ##Source1: %{name}.desktop Source2: %{name}@.service Source3: %{name}.rsyslog Source4: %{name}.logrotate Source5: %{name}.README Source6: %{gamename} Source7: http://www.gnu.org/licenses/lgpl-2.1.txt Source8: default.conf ##Patch0: %{name}-gcc11.patch ##Patch1: metainfo.patch %if 0%{?rhel} ExclusiveArch: %{ix86} x86_64 %else # LuaJIT arches ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64 %endif BuildRequires: make automake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake >= 2.6.0 #BuildRequires: irrlicht-devel BuildRequires: bzip2-devel gettext-devel sqlite-devel zlib-devel libzstd-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: jsoncpp-devel BuildRequires: libcurl-devel BuildRequires: luajit-devel BuildRequires: leveldb-devel BuildRequires: gmp-devel BuildRequires: libappstream-glib BuildRequires: freetype-devel BuildRequires: openssl-libs BuildRequires: spatialindex-devel BuildRequires: doxygen BuildRequires: ncurses-devel BuildRequires: libogg-devel BuildRequires: libXxf86vm-devel BuildRequires: kernel-devel BuildRequires: pkgconfig(sdl2) Requires: %{name}-server = %{version}-%{release} #Drop after f42 Provides: %{name}-data-game = %{version}-%{release} Obsoletes: %{name}-data-game < 5.8.0-1 Requires: hicolor-icon-theme Provides: bundled(irrlicht) = %{irr_version} Obsoletes: %{alt_name} < %{version}-%{release} Obsoletes: %{alt_name} < %{version}-%{release} %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: luanti multiplayer server Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Requires: %{name}-data-common = %{version}-%{release} %description server luanti multiplayer server. This package does not require X Window System. %package data-common Summary: luanti common data between client and server %description data-common luanti common data. This package is shared between luanti server and client. %prep %autosetup -p1 -n minetest cp %{SOURCE7} 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 %ifarch aarch64 %define _lto_cflags %{nil} %endif %cmake -DBUILD_SERVER=TRUE -DENABLE_SYSTEM_JSONCPP=ON -DBUILD_UNITTESTS=TRUE %cmake_build %install %cmake_install ## Add desktop file ## desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} # Systemd unit file mkdir -p %{buildroot}%{_unitdir}/ install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir} # /etc/rsyslog.d/minetest.conf mkdir -p %{buildroot}%{_sysconfdir}/rsyslog.d/ install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/rsyslog.d/%{name}.conf # /etc/logrotate.d/luanti mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/ install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-server # /var/lib/luanti directory for server data files install -d -m 0775 %{buildroot}%{_sharedstatedir}/%{name}/ install -d -m 0775 %{buildroot}%{_sharedstatedir}/%{name}/default/ install -d -m 0775 %{buildroot}%{_sharedstatedir}/%{name}/.luanti/ install -d -m 0775 %{buildroot}%{_sharedstatedir}/%{name}/.luanti/games/ pushd %{buildroot}%{_sharedstatedir}/%{name}/.luanti/games/ tar xf %{SOURCE6} popd # /etc/luanti/default.conf install -d -m 0775 %{buildroot}%{_sysconfdir}/%{name}/ install -m 0664 minetest.conf.example %{buildroot}%{_sysconfdir}/%{name}/default.conf # /etc/sysconfig/default.conf install -d -m 0775 %{buildroot}%{_sysconfdir}/sysconfig/%{name}/ install -m 0664 %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/%{name} cp -p %{SOURCE5} README.fedora # Move doc directory back to the sources mkdir __doc mv %{buildroot}%{_datadir}/doc/%{name}/* __doc rm -rf %{buildroot}%{_datadir}/doc/%{name} %find_lang %{name} ##appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml %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 "luanti multiplayer server" %{name} exit 0 %post server %systemd_post %{name}@default.service %preun server %systemd_preun %{name}@default.service %postun server %systemd_postun_with_restart %{name}@default.service %files -f %{name}.lang %license doc/lgpl-2.1.txt %doc README.fedora %{_bindir}/%{name} %{_bindir}/%{alt_name} %{_datadir}/%{name}/client %{_datadir}/%{name}/fonts %{_datadir}/%{name}/textures ##%%{_datadir}/applications/%{name}.desktop %{_datadir}/applications/net.%{alt_name}.%{alt_name}.desktop %{_datadir}/icons/hicolor/*/apps/%{name}.png %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{_mandir}/man6/%{name}.* %{_metainfodir}/*.metainfo.xml %files server %license doc/lgpl-2.1.txt %doc README.md doc/protocol.txt README.fedora %{_bindir}/%{name}server %{_bindir}/%{alt_name}server %{_unitdir}/%{name}@.service %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-server %config(noreplace) %{_sysconfdir}/rsyslog.d/%{name}.conf %attr(-,luanti,luanti)%{_sharedstatedir}/%{name}/ %attr(-,luanti,luanti)%{_sysconfdir}/%{name}/ %attr(-,luanti,luanti)%{_sysconfdir}/sysconfig/%{name}/ %{_mandir}/man6/%{name}server.* %files data-common %license doc/lgpl-2.1.txt %{_datadir}/%{name}/builtin %changelog %autochangelog