Blob Blame History Raw
Name:           cdogs-sdl
Version:        0.5.8
Release:        1%{?dist}
Summary:        C-Dogs is an arcade shoot-em-up
Group:          Amusements/Games
# The game-engine is GPLv2+
# The original game art is Redistributable, no modification permitted
# This is slowly being replaced upstream by CC art
License:        GPLv2+ and Redistributable, no modification permitted and CC-BY and CC-BY-SA and CC0
URL:            http://cxong.github.io/cdogs-sdl/
# This uses git-submodules and github's foo/bat/archive/tag.tar.gz feature
# does not deal with this. To regenerate do:
# git clone git clone https://github.com/cxong/cdogs-sdl.git
# cd cdogs-sdl
# git checkout %{version}
# git submodule init
# git submodule update --init --recursive
# git submodule update --recursive
# rm -rf `find -name .git`
# cd ..
# mv cdogs-sdl cdogs-sdl-%{version}
# tar cvfJ cdogs-sdl-%{version}.tar.xz cdogs-sdl-%{version}
Source0:        cdogs-sdl-%{version}.tar.xz
Source1:        %{name}.desktop
Source2:        %{name}.appdata.xml
Patch0:         cdogs-sdl-0.5.8-cmake.patch
BuildRequires:  cmake SDL_mixer-devel SDL_image-devel ncurses-devel physfs-devel
BuildRequires:  desktop-file-utils libicns-utils libappstream-glib
Requires:       hicolor-icon-theme
Obsoletes:      cdogs-data < 0.5
Provides:       cdogs-data = %{version}-%{release}

%description
C-Dogs SDL is a port of the old DOS arcade game C-Dogs to modern operating
systems utilising the SDL Media Libraries. C-Dogs is an arcade shoot-em-up
which lets players work alone and cooperatively during missions or fight
against each other in the “dogfight” deathmatch mode. The DOS version of
C-Dogs came with several built in missions and dogfight maps. This version
does too. The author of the DOS version of C-Dogs was Ronny Wester. We would
like to thank Ronny for releasing the C-Dogs sources to the public.


%prep
%setup -q
%patch0 -p1
sed -i 's/\r//' doc/original_readme.txt


%build
%cmake -DCDOGS_DATA_DIR=/usr/share/cdogs-sdl/
make %{?_smp_mflags}
icns2png -x build/macosx/cdogs-icon.icns

%install
%make_install

mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE1}

mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/appdata
appstream-util validate-relax --nonet \
  $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml

for i in 16 32 48 128; do
  mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/apps
  install -m 644 cdogs-icon_${i}x${i}x32.png \
    $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done


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

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

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


%files
%doc doc/*
%{_bindir}/%{name}*
%{_datadir}/%{name}
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png


%changelog
* Thu Jun 18 2015 Hans de Goede <hdegoede@redhat.com> - 0.5.8-1
- New upstream and new upstream release 0.5.8
- Fix FTBFS
- Add an appdata file
- cdogs-data is now part of the main cdogs-sdl package

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

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

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Rahul Sundaram <sundaram@fedoraproject.org> - 0.4-11
- remove vendor tag from desktop file. https://fedorahosted.org/fpc/ticket/247
- clean up spec to follow current guidelines

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.4-4
- Autorebuild for GCC 4.3

* Tue Aug 21 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.4-3
- Rebuild for buildId

* Sun Aug 12 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.4-2
- Update License tag for new Licensing Guidelines compliance
- Fix building with new glibc open() argument checking

* Mon Jul 16 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.4-1
- Initial Fedora Extras package