Blob Blame History Raw
Name:           plee-the-bear
Version:        0.7.0
Release:        5%{?dist}
Summary:        2D platform game
# Code and artwork respectively
License:        GPLv3 and CC-BY-SA
URL:            http://www.stuff-o-matic.com/plee-the-bear/
# Actual source URL is hidden by PHP:
# http://www.stuff-o-matic.com/plee-the-bear/download/file.php?platform=source
Source0:        %{name}_%{version}-light.tar.gz
# Already in upstream git
Patch0:         plee-the-bear-0.7.0-crash-on-exit.patch

BuildRequires:  desktop-file-utils
BuildRequires:  libclaw-devel >= 1.7.0
BuildRequires:  boost-devel
BuildRequires:  wxGTK-devel
BuildRequires:  SDL2_mixer-devel SDL2-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  gettext
BuildRequires:  cmake
# There has to be a saner way to remove rpath via cmake...
BuildRequires:  chrpath
# Really only needs SDL2, remove once:
# https://github.com/j-jorge/plee-the-bear/issues/3
# is fixed
BuildRequires:  SDL_mixer-devel SDL-devel 

%description
Plee the Bear is a 2D platform game in the spirit of 1990s console games.


%prep
%setup -q -n %{name}-%{version}-light
%patch0 -p1


%build
# plee the bear uses some private libs which it builds as unversioned .so files
# we put them in a private-libdir, and use a wrapper to set LD_LIBRARY_PATH
%cmake . \
        -DPTB_INSTALL_CUSTOM_LIBRARY_DIR=%{_lib}/%{name} \
        -DBEAR_ENGINE_INSTALL_LIBRARY_DIR=%{_lib}/%{name} \
        -DBEAR_FACTORY_INSTALL_LIBRARY_DIR=%{_lib}/%{name}
make %{?_smp_mflags} VERBOSE=1


%install
%make_install VERBOSE=1 INSTALL="install -p"

# Translations
%find_lang %{name}
%find_lang bear-factory
cat bear-factory.lang >>%{name}.lang
%find_lang bear-engine
cat bear-engine.lang >>%{name}.lang

# Move binary to libexec, install wrapper to set LD_LIBRARY_PATH
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
mv $RPM_BUILD_ROOT%{_bindir}/%{name} $RPM_BUILD_ROOT%{_libexecdir}
cat > $RPM_BUILD_ROOT%{_bindir}/%{name} <<EOF
#!/bin/sh
export LD_LIBRARY_PATH=%{_libdir}/%{name}
exec %{_libexecdir}/%{name} "$@"
EOF
chmod +x $RPM_BUILD_ROOT%{_bindir}/%{name}

# Remove editor bits and other cruft, we only want the game
rm $RPM_BUILD_ROOT%{_bindir}/bend-image
rm $RPM_BUILD_ROOT%{_bindir}/bf-*
rm $RPM_BUILD_ROOT%{_libdir}/%{name}/libbear-editor.so
rm $RPM_BUILD_ROOT%{_libdir}/%{name}/libplee_the_bear.so
rm $RPM_BUILD_ROOT%{_datadir}/applications/bf-*.desktop
rm $RPM_BUILD_ROOT%{_datadir}/applications/desc2img.desktop
rm -rf $RPM_BUILD_ROOT%{_datadir}/cmake
rm $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/*/apps/bear-factory.png
rm -rf $RPM_BUILD_ROOT%{_datadir}/pixmaps
rm `find $RPM_BUILD_ROOT%{_datadir}/%{name} -name "*.sh"`

# Menu entries
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop

# Nuke the rpaths.
for i in $RPM_BUILD_ROOT%{_libdir}/%{name}/*.so \
         $RPM_BUILD_ROOT%{_libexecdir}/%{name}; do
        chrpath --delete $i
done

# Register as an application to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Ryan Lerch <rlerch@redhat.com> -->
<!--
BugReportURL: https://github.com/j-jorge/plee-the-bear/issues/2
SentUpstream: 2014-09-25
-->
<application>
  <id type="desktop">plee-the-bear.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <summary>Rescue your kidnapped son in this side scrolling platform game</summary>
  <description>
    <p>
      Plee the bear is a side scrolling platform game where you have to rescue your kidnapped son.
      Progress through the levels and dodge all the obstacles to try to rescue your son.
    </p>
  </description>
  <url type="homepage">http://www.stuff-o-matic.com/plee-the-bear/</url>
  <screenshots>
    <screenshot type="default">http://www.stuff-o-matic.com/plee-the-bear/assets/screenshots/large/2.png</screenshot>
  </screenshots>
</application>
EOF


%post
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
/sbin/ldconfig
[ $1 = 0 ] || exit 0
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files -f %{name}.lang
%{_bindir}/%{name}
%{_libdir}/%{name}
%{_libexecdir}/%{name}
%{_datadir}/%{name}
%{_datadir}/bear-factory
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/ptb.png
%license plee-the-bear/LICENSE plee-the-bear/license/GPL plee-the-bear/license/CCPL


%changelog
* Tue May 17 2016 Jonathan Wakely <jwakely@redhat.com> - 0.7.0-5
- Rebuilt for linker errors in boost (#1331983)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Jan 15 2016 Jonathan Wakely <jwakely@redhat.com> - 0.7.0-3
- Rebuilt for Boost 1.60

* Wed Dec  2 2015 Hans de Goede <hdegoede@redhat.com> - 0.7.0-2
- Fix crash on exit
- Remove the editor binaries, we really only want the game
- Put the private libs which are unversioned .so files in a private-libdir
- Drop the -devel subpackage the cmake files are for the private libs
  which have no use outside of plee-the-bear

* Mon Nov 30 2015 Tom Callaway <spot@fedoraproject.org> - 0.7.0-1
- drop -fpermissive patch
- update description
- update to 0.7.0
- drop boost patch (not needed anymore)
- make devel subpackage for cmake files

* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 0.6.0-23
- Rebuilt for Boost 1.59

* Wed Jul 29 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-22
- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159

* Wed Jul 22 2015 David Tardon <dtardon@redhat.com> - 0.6.0-21
- rebuild for Boost 1.58

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.6.0-19
- Rebuilt for GCC 5 C++11 ABI change

* Thu Mar 26 2015 Richard Hughes <rhughes@redhat.com> - 0.6.0-18
- Add an AppData file for the software center

* Mon Jan 26 2015 Petr Machata <pmachata@redhat.com> - 0.6.0-17
- Rebuild for boost 1.57.0

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri May 23 2014 Petr Machata <pmachata@redhat.com> - 0.6.0-14
- Rebuild for boost 1.55.0

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sat Jul 27 2013 pmachata@redhat.com - 0.6.0-12
- Rebuild for boost 1.54.0

* Sun Feb 10 2013 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.6.0-11
- Rebuild for Boost-1.53.0

* Sat Feb 09 2013 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.6.0-10
- Rebuild for Boost-1.53.0

* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 0.6.0-9
- rebuild due to "jpeg8-ABI" feature drop

* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 0.6.0-8
- rebuild against new libjpeg

* Tue Aug 21 2012 Tom Callaway <spot@fedoraproject.org> - 0.6.0-7
- fix compile with current boost (thanks to Konstantinos Margaritis)

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-5
- Rebuilt for c++ ABI breakage

* Sun Feb  5 2012 Tom Callaway <spot@fedoraproject.org> - 0.6.0-4
- rebuild against fixed libclaw

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Dec 06 2011 Adam Jackson <ajax@redhat.com> - 0.6.0-2
- Rebuild for new libpng

* Thu Aug 25 2011 Tom Callaway <spot@fedoraproject.org> - 0.6.0-1
- update to 0.6.0

* Mon Apr 18 2011 Tom Callaway <spot@fedoraproject.org> - 0.5.1-1
- update to 0.5.1

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Feb 06 2011 Thomas Spura <tomspur@fedoraproject.org> - 0.4.1-9
- rebuild for new boost

* Wed Sep 29 2010 jkeating - 0.4.1-8
- Rebuilt for gcc bug 634757

* Sat Sep 18 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 0.4.1-7
- fix incorrect return type

* Wed Jul 14 2010 Dan HorĂ¡k <dan@danny.cz> - 0.4.1-6
- rebuilt against wxGTK-2.8.11-2

* Wed Feb 17 2010 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-5
- Fix build

* Fri Jan 22 2010 Rahul Sundaram <sundaram@fedoraproject.org> - 0.4.1-4
- Rebuild for Boost soname bump

* Sun Nov 29 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-3
- Fix libdir for 64-bit archs

* Fri Sep 18 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-2
- Incorporate suggestions from review (#524283#c2, Simon Wesp)
- Fix license tag
- Preserve timestamps
- Regenerate icon cache

* Fri Sep 18 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-1
- Initial packaging