1
0

274 lines
8.2 KiB
RPMSpec

#
# spec file for package multicraft
#
# Copyright (c) 2022 PICCORO Lenz McKAY
#
%define multicraftuser %{name}
%define multicraftgroup %{name}
Name: multicraft
Version: 2.0.3
Release: 0%{?dist}
Summary: minetest voxel game engine with easy modding and game creation
License: CC-BY-SA-3.0 AND LGPL-3-or-later
Group: Amusements/Games/3D/Simulation
URL: https://multicraft.world
Source0: %{name}_%{version}.orig.tar.gz
#Source1: https://github.com/multicraft/irrlicht/archive/%{irrlichtmt_version}/irrlicht-%{irrlichtmt_version}.tar.gz
#Patch0: minetest-fix-luajit-include-path.patch
%if 0%{?rhel}
ExclusiveArch: %{ix86} x86_64
# LuaJIT arches
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64 ppc64le
%endif
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gmp-devel
BuildRequires: hicolor-icon-theme
BuildRequires: irrlicht-devel luajit-devel
BuildRequires: libXxf86vm-devel
BuildRequires: libpng-devel
%if 0%{?rhel}
BuildRequires: bzip2-devel gettext-devel sqlite-devel libzstd-devel
BuildRequires: libjpeg-turbo-devel mesa-libGL-devel libvorbis-devel
%else
BuildRequires: libjpeg-devel libidn-devel libvorbis-devel openal-soft-devel
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(vorbis)
%endif
BuildRequires: ncurses-devel
BuildRequires: pkgconfig systemd
BuildRequires: spatialindex-devel
BuildRequires: systemd-rpm-macros
%if 0%{?suse_version} > 1400
BuildRequires: update-desktop-files
BuildRequires: gettext-tools
%else
BuildRequires: desktop-file-utils
%endif
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(jsoncpp)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(luajit)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(zlib)
BuildRequires: leveldb-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(hiredis)
BuildRequires: postgresql-devel
%if 0%{?suse_version} > 1400
BuildRequires: postgresql-server-devel
%endif
BuildRequires: openssl-devel
BuildRequires: libcurl-devel
Requires: %{name}-data = %{version}
Provides: minetest-runtime = %{version}
Provides: minetest-engine
%description
Multicraft is a fork from minetest, a voxel game written from scratch and licensed
under the LGPL (version 2.1 or later). It supports both survival and creative
modes along with multiplayer support, dynamic lighting, and an "infinite" map
generator.
This is the graphics player client with multiprotocol for any minetest engine,
the textures and other graphical files and the standard mods. Use this to
play as singleplayer or to connect to play in multiplayer modes.
This multicraft features and permit to use and serve
to both older and newer minetest games
%package %{name}server
Summary: voxel game engine based on minetest - server multiplayer
License: LGPL-2.1-or-later
Group: Amusements/Games/3D/Simulation
Requires: %{name}-data = %{version}
%if 0%{?suse_version} > 1400
Requires(pre): shadow
%endif
%if 0%{?fedora_version} > 34
Requires(pre): shadow
%endif
Provides: minetest-runtime = %{version}
Provides: minetest-server
%{?systemd_requires}
%description %{name}server
Multicraft is a fork from minetest, a voxel game written from scratch and licensed
under the LGPL (version 2.1 or later). It supports both survival and creative
modes along with multiplayer support, dynamic lighting, and an "infinite" map
generator.
These are the server flavour with multiprotocol for any minetest engine, such as
the textures and other graphical files and the standard mods. Use this to
provide and deploy a service where players can connect over a network.
This multicraft features and permit to use and serve
to both older and newer minetest games
%package data
Summary: voxel game engine based on minetest - common data files
License: CC-BY-SA-3.0 AND LGPL-2.1-or-later
Group: Amusements/Games/3D/Simulation
Requires: google-arimo-fonts
Requires: google-cousine-fonts
Requires: google-droid-fonts
BuildArch: noarch
%description data
Multicraft is a fork from minetest, a voxel game written from scratch and licensed
under the LGPL (version 2.1 or later). It supports both survival and creative
modes along with multiplayer support, dynamic lighting, and an "infinite" map
generator.
These are the files used by both client and server packages, such as
the textures and other graphical files and the standard mods.
This is a improved upgrade over 5.2 series due 5.X one superset and changed
the protocol of network.
This multicraft features and permit to use and serve
to both older and newer minetest games
%if 0%{?fedora_version} > 32
%global debug_package %{nil}
%endif
%prep
%autosetup -p1
# way to patch only in some version of rmp shit distros
# %if 0%{?sle_version} > 0 && 0%{?sle_version} <= 150400
# %patch0 -p1
# %patch1 -p1
# %endif
# cd lib
# tar -xzf %{SOURCE3}
# mv irrlicht-%{irrlichtmt_version} irrlichtmt
# cd ..
# Purge bundled jsoncpp, lua and gmp libraries.
rm -rf 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
CXXFLAGS="-O3 -fomit-frame-pointer -Wall -ffp-contract=off -fpermissive"
LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,now"
%ifarch aarch64
%define _lto_cflags %{nil}
%endif
%cmake \
%ifarch aarch64
%if 0%{?suse_version} > 1550
-DCMAKE_CXX_FLAGS="%{optflags} -mbranch-protection=none" \
%endif
%endif
-DCUSTOM_DOCDIR="%{_docdir}/%{name}-data" \
-DCUSTOM_LOCALEDIR="%{_datadir}/locale" \
-DCUSTOM_SHAREDIR="%{_datadir}/games/%{name}" \
-DBUILD_SERVER=ON \
-DBUILD_CLIENT=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=ON \
-DENABLE_POSTGRESQL=ON \
-DPNG_PNG_INCLUDE_DIR=$(pkg-config libpng --variable=includedir) \
%{nil}
%if 0%{?rhel}
make %{?_smp_mflags} VERBOSE=1
%else
%cmake_build
%endif
%install
%if 0%{?rhel}
%make_install
%else
%cmake_install
%endif
# Clean up.
%fdupes %{buildroot}%{_datadir}/
install -Dpm 0644 multicraft.conf.example %{buildroot}%{_sysconfdir}/%{name}/multicraft.conf.example
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}/
# %find_lang %{name}
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
desktop-file-validate %{_datadir}/applications/net.minetest.multicraft.desktop
%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
%pre %{name}server
getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{multicraftgroup}
getent passwd %{name} > /dev/null || %{_sbindir}/useradd -r -g %{multicraftgroup} -d %{_localstatedir}/games/%{name} -s /sbin/nologin -c "user for %{name}server" %{multicraftuser}
%service_add_pre %{name}@.service
%post %{name}server
%service_add_post %{name}@.service
%preun %{name}server
%service_del_preun %{name}@.service
%postun %{name}server
%service_del_postun %{name}@.service
%files
%{_bindir}/%{name}
%{_datadir}/applications/net.minetest.multicraft.desktop
%{_mandir}/man6/%{name}.6%{?ext_man}
%files %{name}server
%{_bindir}/%{name}server
%attr(0755,%{multicraftuser},%{multicraftgroup}) %{_localstatedir}/games/%{name}/
%{_mandir}/man6/%{name}server.6%{?ext_man}
%dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/multicraft.conf.example
%{_unitdir}/%{name}@.service
%{_sysconfdir}/logrotate.d/%{name}
%files data
%license LICENSE.txt
%doc README.*
%doc %{_docdir}/%{name}-data/*
%{_datadir}/games/%{name}
%dir %{_datadir}/icons/hicolor/
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%dir %{_datadir}/metainfo/
%{_datadir}/metainfo/*%{name}.appdata.xml
%changelog