* move debian directory to misc/debian * move rmp shit distro directory the spec file and changelog * move the alpine directory in misc with a minimal started files * still there's an error on spec file for name of the tarball * all of those files it depends of the previous commit that gives init/shistemd
258 lines
7.4 KiB
RPMSpec
258 lines
7.4 KiB
RPMSpec
#
|
|
# spec file for package multicraft
|
|
#
|
|
# Copyright (c) 2022 PICCORO Lenz McKAY
|
|
#
|
|
|
|
%define minetestuser %{name}
|
|
%define minetestgroup %{name}
|
|
Name: multicraft
|
|
Version: 2.0.3
|
|
Release: 0%{?dist}
|
|
Summary: A Minetest/Minecraft based game
|
|
License: CC-BY-SA-3.0 AND LGPL-3-or-later
|
|
Group: Amusements/Games/3D/Simulation
|
|
URL: https://codeberg.org/minenux/minetest-engine-multicraft
|
|
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
|
|
%else
|
|
BuildRequires: libjpeg-devel
|
|
%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(bzip2)
|
|
BuildRequires: pkgconfig(freetype2)
|
|
BuildRequires: pkgconfig(gl)
|
|
BuildRequires: pkgconfig(jsoncpp)
|
|
BuildRequires: pkgconfig(libcurl)
|
|
BuildRequires: pkgconfig(libpng)
|
|
BuildRequires: pkgconfig(luajit)
|
|
BuildRequires: pkgconfig(openal)
|
|
BuildRequires: pkgconfig(sqlite3)
|
|
BuildRequires: pkgconfig(vorbis)
|
|
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: libcurl-devel libidn-devel
|
|
Requires: %{name}-data = %{version}
|
|
Recommends: minetest-game
|
|
Provides: minetest-runtime = %{version}
|
|
|
|
%description
|
|
An infinite-world block sandbox game and a game engine, inspired by
|
|
InfiniMiner, Minecraft and the like BUT FORKED FROM MINETEST
|
|
|
|
%package %{name}server
|
|
Summary: Multicraft server for LAN and network only
|
|
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
|
|
Recommends: multicraft-game
|
|
Provides: minetest-runtime = %{version}
|
|
%{?systemd_requires}
|
|
|
|
%description %{name}server
|
|
An infinite-world block sandbox game and a game engine, inspired by
|
|
InfiniMiner, Minecraft and the like BUT FORKED FROM MINETEST
|
|
|
|
This package contains a multicraft server.
|
|
|
|
%package data
|
|
Summary: Multicraft shared data
|
|
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
|
|
An infinite-world block sandbox game and a game engine, inspired by
|
|
InfiniMiner, Minecraft and the like.
|
|
|
|
This package contains data for multicraft and multicraftserver.
|
|
|
|
%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
|
|
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-optimization
|
|
s"
|
|
CXXFLAGS="-O3 -march=pentium3 -mtune=nocona -mfpmath=sse -fomit-frame-pointer -mmmx -msse -msse2 -mno-sse4 -mno-sse3 -fpermissive -Wall -fexpensive-optimizati
|
|
ons -fpermissive"
|
|
%endif
|
|
%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}" \
|
|
-DCUSTOM_LOCALEDIR="%{_datadir}/locale" \
|
|
-DCUSTOM_SHAREDIR="%{_datadir}/games/%{name}" \
|
|
-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 \
|
|
-DPNG_PNG_INCLUDE_DIR=$(pkg-config libpng --variable=includedir) \
|
|
-DENABLE_SPATIAL=ON \
|
|
-DENABLE_LEVELDB=ON \
|
|
-DENABLE_REDIS=ON \
|
|
-DENABLE_POSTGRESQL=ON \
|
|
%{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
|
|
|
|
# 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}/lib/%{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}/lib/%{name}/
|
|
%{_mandir}/man6/%{name}server.6%{?ext_man}
|
|
%dir %{_sysconfdir}/%{name}
|
|
%config %{_sysconfdir}/%{name}/multicraft.conf.example
|
|
# %{_unitdir}/%{name}@.service
|
|
# %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
|
# %config(noreplace) %{_sysconfdir}/rsyslog.d/%{name}.conf
|
|
|
|
%files data
|
|
%license LICENSE.txt
|
|
%doc README.*
|
|
%doc %{_docdir}/%{name}/
|
|
%{_datadir}/games/%{name}/
|
|
%dir %{_datadir}/icons/hicolor/
|
|
%{_datadir}/icons/hicolor/*/apps/%{name}.*
|
|
%dir %{_datadir}/metainfo/
|
|
%{_datadir}/metainfo/*%{name}.appdata.xml
|
|
|
|
%changelog
|