Blob Blame History Raw
%global githash 84c2c9672181e7ef6b9dd573cf4be301d7a77691
%global shortcommit %(c=%{githash}; echo ${c:0:7})

Name:           orthorobot
Version:        1.1
Release:        6%{?dist}
Summary:        A perspective based puzzle game

License:        WTFPL
URL:            http://stabyourself.net/orthorobot/
Source0:        https://github.com/Stabyourself/%{name}/archive/%{githash}.tar.gz#/%{name}-%{shortcommit}.tar.gz
#Source1 is a copy of the license, straight from wtfpl.net
Source1:        http://www.wtfpl.net/txt/copying
#Patch for appdata, manpage, execution script, and desktop file
Patch0:         %{name}-%{version}-appdata.patch
#Submitted upstream:
#https://github.com/Stabyourself/orthorobot/pull/2
Patch1:         %{name}-love010support.patch

BuildRequires:  desktop-file-utils
BuildRequires:  libappstream-glib
BuildArch:      noarch
Requires:       love

# List the arches that love builds on below for f26+
%if 0%{?fedora} > 25
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64 ppc64
%endif

#From the website (see URL above)
%description
Literally bridging the gap between 2D and 3D games, Ortho Robot is a
perspective based puzzle game, where you flatten the view to move
across gaps. This game is made with LOVE.

%prep
%autosetup -p1 -n %{name}-%{githash}
#Fix line encoding for license file:
sed 's/\r$//' %{SOURCE1} > ./LICENSE

%build
#love "binary" files are just zipped sources, but should exclude appdata
zip -r %{name}.love . -x appdata

%install
#Install love file
install -p -D -m 0644 %{name}.love \
  %{buildroot}/%{_datadir}/%{name}/%{name}.love
#Install execution script
install -p -D -m 0755 appdata/%{name} \
  %{buildroot}/%{_bindir}/%{name}
#Install manpage
install -p -D -m 0644 appdata/%{name}.6 \
  %{buildroot}/%{_mandir}/man6/%{name}.6
#Install appdata.xml and verify
install -p -D -m 0644 appdata/%{name}.appdata.xml \
  %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml
appstream-util validate-relax --nonet \
  %{buildroot}/%{_datadir}/appdata/*.appdata.xml
#Install desktop, icon:
desktop-file-install \
  --dir %{buildroot}%{_datadir}/applications \
  appdata/%{name}.desktop
install -p -D -m 0644 helpplayer.png \
  %{buildroot}/%{_datadir}/pixmaps/%{name}.png

%files
%doc LICENSE
%{_mandir}/man6/%{name}.*
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/*.appdata.xml

%changelog
* Sat Nov 19 2016 Jeremy Newton <alexjnewt at hotmail dot com> - 1.1-6
- love 0.10.* fixes (a bit late, just noticed this issue)

* Wed Nov 16 2016 Jeremy Newton <alexjnewt at hotmail dot com> - 1.1-5
- Remove exclusive arch for noarch, see bug#1298668

* Wed Nov 09 2016 Jeremy Newton <alexjnewt at hotmail dot com> - 1.1-4
- Exclusive arches to what love builds on

* Mon Feb 22 2016 Jeremy Newton <alexjnewt at hotmail dot com> - 1.1-3
- Adding appdata and basic manpage via patch
- Moving desktop and script to appdata patch

* Fri Feb 19 2016 Jeremy Newton <alexjnewt at hotmail dot com> - 1.1-2
- Adding license file
- Fixing source0
- Generate desktop file similar to the execution script
- Forgot to exclude zipping the execution script
- Removed duplicate package file

* Mon Nov 30 2015 Jeremy Newton <alexjnewt at hotmail dot com> - 1.1-1
- Initial package