# Generated from game_2d-0.0.3.gem by gem2rpm -*- rpm-spec -*-
%global gem_name game_2d

Name: rubygem-%{gem_name}
Version: 0.0.3
Release: 1%{?dist}
Summary: Client/server sandbox game using Gosu and REnet
License: MIT
URL: https://github.com/sereneiconoclast/game_2d
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby >= 1.9.3
# BuildRequires: rubygem(rr) >= 1.1.2
# BuildRequires: rubygem(rr) < 1.2
# BuildRequires: rubygem(rspec) >= 3.1.0
# BuildRequires: rubygem(rspec) < 3.2
BuildArch: noarch

%description
Built on top of Gosu, an engine for making 2-D games.  Gosu provides the means
to handle the graphics, sound, and keyboard/mouse events.  It doesn't provide
any sort of client/server network architecture for multiplayer games, nor a
system for tracking objects in game-space.  This gem aims to fill that gap.
Originally I tried using Chipmunk as the physics engine, but its outcomes were
too unpredictable for the client to anticipate the server.  It was also hard
to
constrain in the ways I wanted.  So I elected to build something
integer-based.
In the short term, I'm throwing anything into this gem that interests me. 
There
are reusable elements (GameSpace, Entity, ServerPort), and game-specific
elements (particular Entity subclasses with custom behaviors).  Longer term, I
could see splitting it into two gems.  This gem, game_2d, would retain the
reusable platform classes.  The other classes would move into a new gem
specific
to the game I'm developing, as a sort of reference implementation.


%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
%setup -q -n %{gem_name}-%{version}

%build
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec

# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/


mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* \
        %{buildroot}%{_bindir}/

find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x

%check
pushd .%{gem_instdir}
# rspec spec
popd

%files
%dir %{gem_instdir}
%{_bindir}/game_2d_client.rb
%{_bindir}/game_2d_server.rb
%exclude %{gem_instdir}/.gitignore
%license %{gem_instdir}/LICENSE.txt
%{gem_instdir}/bin
%{gem_libdir}
%{gem_instdir}/media
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%{gem_instdir}/game_2d.gemspec
%{gem_instdir}/spec

%changelog
* Tue Apr 19 2022 mockbuilder - 0.0.3-1
- Initial package