## WIP, expect some crap in packaging ## Note: requires internet access during build procces because of Rust nightly and git-lfs ## Optimize for build time or performance %bcond_without release_build %global debug_package %{nil} %global commit 905b3ac12910e89c670b269eb6117a41039c9397 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global date 20191121 Name: veloren Version: 0.4.0 Release: 1.%{date}git%{shortcommit}%{?dist} Summary: Multiplayer voxel RPG written in Rust License: GPLv3+ URL: https://gitlab.com/veloren/veloren Source0: %{url}/-/archive/%{commit}/%{name}-%{version}.%{date}git%{shortcommit}.tar.gz # BuildRequires: cargo >= 1.40 # BuildRequires: desktop-file-utils BuildRequires: gcc # BuildRequires: git BuildRequires: git-lfs %if 0%{?el7} BuildRequires: python3 %endif # BuildRequires: rust >= 1.40 BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(atk) BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(gdk-3.0) BuildRequires: pkgconfig(gdk-pixbuf-2.0) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(pango) # Requires: hicolor-icon-theme %if 0%{?fedora} || 0%{?rhel} >= 8 Recommends: %{name}-chat-cli%{?_isa} = %{version}-%{release} Recommends: %{name}-server-cli%{?_isa} = %{version}-%{release} %endif %description Veloren is a multiplayer voxel RPG written in Rust. It is inspired by games such as Cube World, Legend of Zelda: Breath of the Wild, Dwarf Fortress and Minecraft. %package server-cli Summary: Standalone server for %{name} %if 0%{?fedora} || 0%{?rhel} >= 8 Recommends: %{name}-chat-cli%{?_isa} = %{version}-%{release} %endif %description server-cli Standalone server for %{name}. %package chat-cli Summary: Standalone chat for %{name} %if 0%{?fedora} || 0%{?rhel} >= 8 Recommends: %{name}-server-cli%{?_isa} = %{version}-%{release} %endif %description chat-cli Standalone chat for %{name}. %prep %autosetup -p1 -n %{name}-%{commit} ## Unoptimize dev/debug builds sed -i 's/opt-level = 2/opt-level = 0/' Cargo.toml ## Use recommended upstream veloren version of Rust toolchain rust_toolchain=$(cat rust-toolchain) git clone https://gitlab.com/veloren/veloren.git curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal --default-toolchain ${rust_toolchain} -y ## Sync to avoid different builds pushd %{name} git reset --hard %{commit} popd %build pushd %{name}/voxygen # VELOREN_ASSETS=assets %if %{with release_build} $HOME/.cargo/bin/cargo build --release %else $HOME/.cargo/bin/cargo build %endif popd %if %{with release_build} ## Standalone server pushd %{name}/server-cli $HOME/.cargo/bin/cargo build --release popd ## Standalone chat pushd %{name}/chat-cli $HOME/.cargo/bin/cargo build --release popd %endif %install ## Disable cargo install untul bug will been fixed in upstream # $HOME/.cargo/bin/cargo install --root=%{buildroot}%{_prefix} --path=. pushd %{name} %if %{with release_build} install -m 0755 -Dp target/release/%{name}-voxygen %{buildroot}%{_bindir}/%{name}-voxygen %else install -m 0755 -Dp target/debug/%{name}-voxygen %{buildroot}%{_bindir}/%{name}-voxygen %endif mkdir -p %{buildroot}%{_datadir}/%{name} cp -a assets %{buildroot}%{_datadir}/%{name}/ %if %{with release_build} ## Standalone server install -m 0755 -Dp target/release/%{name}-server-cli %{buildroot}%{_bindir}/%{name}-server-cli ## Standalone chat install -m 0755 -Dp target/release/%{name}-chat-cli %{buildroot}%{_bindir}/%{name}-chat-cli %endif popd %files %license LICENSE %doc README.md %{_bindir}/%{name}-voxygen %{_datadir}/%{name}/ %if %{with release_build} %files server-cli %license LICENSE %doc README.md %{_bindir}/%{name}-server-cli %files chat-cli %license LICENSE %doc README.md %{_bindir}/%{name}-chat-cli %endif %changelog * Thu Nov 21 2019 Artem Polishchuk - 0.4.0-1.20191121git905b3ac - Update to latest git snapshot * Wed Nov 13 2019 Artem Polishchuk - 0.4.0-1.20191112giteb7b55d - Update to latest git snapshot - Add chat-cli package - Minor packaging fixes * Mon Nov 11 2019 Artem Polishchuk - 0.4.0-1.20191109git5fe1eec - Update to latest git snapshot - Thanks @ElXreno for help with debugging build * Sat Sep 07 2019 Artem Polishchuk - 0.3.0-2.20190907git92c0edc - Update to latest git snapshot * Fri Mar 29 2019 Artem Polishchuk - 0.3.0-1.20190906gitd41d020 - Initial package