Blob Blame History Raw
%global weak    22

%global pre     RC2
%global engine  dreamer

Name:           dreamchess
Version:        0.2.1
Release:        17.%{pre}%{?dist}
Summary:        Portable chess game
##GPLv2+ and v3+ for most of sources, explicitly BSD for src/include/gamegui/queue.h (see file COPYRIGHT)
License:        GPLv3+ and BSD
URL:            http://www.%{name}.org/
Source0:        https://github.com/%{name}/%{name}/releases/download/%{version}-%{pre}/%{name}-%{version}-%{pre}.tar.gz

BuildRequires:  mxml-devel
BuildRequires:  SDL-devel SDL_image-devel SDL_mixer-devel glew-devel
BuildRequires:  help2man desktop-file-utils

# icons get installed into hicolor folders
Requires:       hicolor-icon-theme

Requires:       chessprogram

%if 0%{?fedora} >= %{weak}
Suggests:       %{name}-engine
Suggests:       gnuchess
%endif

Requires:       %{name}-data = %{version}-%{release}

%description
DreamChess is an open source chess game.

Features:
- 3D OpenGL graphics
- various chess board sets: from classic wooden to flat figurines
- music, sound effects
- on-screen move lists using SAN notation
- undo functionality
- save-games in PGN format

A moderately strong chess engine as a sub-package: Dreamer.


%package engine
Summary:        A moderately strong chess engine for the game DreamChess
License:        GPLv3+
Provides:       chessprogram

%if 0%{?fedora} >= %{weak}
Suggests:       %{name}
%endif

%description engine
Should this chess engine be too weak for you, then you can use any other
XBoard-compatible chess engine, including the popular Crafty and GNU Chess.


%package data
Summary:        Data files for the game DreamChess
BuildArch:      noarch
Requires:       %{name} = %{version}-%{release}

%description data
Data files for the game DreamChess:
Boards, Pieces, Sounds, Styles, Themes.


%prep
%autosetup -n %{name}-%{version}-%{pre}
# ignore tree product
rm data/*.icns

%build
%configure LIBS=-lm
make %{?_smp_mflags}
# generate manpage
help2man -o %{name}.man --no-discard-stderr --version-string='%{version}-%{pre}' src/%{name}

%install
%make_install
mkdir -p %{buildroot}%{_datadir}/pixmaps
ln -s ../icons/hicolor/256x256/apps/dreamchess.png
mkdir -p %{buildroot}%{_mandir}/man1
gzip -c %{name}.man > %{buildroot}%{_mandir}/man1/%{name}.1.gz


%check
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop


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

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

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


%files
%license COPYING COPYRIGHT
%doc README NEWS AUTHORS
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/font.*
%{_datadir}/%{name}/menu_title.png
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man6/%{name}.6.gz 
%{_mandir}/man1/%{name}.1*

%files engine
%license COPYING COPYRIGHT
%doc AUTHORS
%{_bindir}/%{engine}
%{_mandir}/man6/%{engine}.6.gz

%files data
%license COPYING COPYRIGHT
%{_datadir}/%{name}/boards/
%{_datadir}/%{name}/pieces/
%{_datadir}/%{name}/sounds/
%{_datadir}/%{name}/styles/
%{_datadir}/%{name}/themes/


%changelog
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-17.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-16.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-15.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jan 10 2017 Orion Poplawski <orion@cora.nwra.com> - 0.2.1-14.RC2
- Rebuild for glew 2.0.0

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-13.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jan 14 2016 Adam Jackson <ajax@redhat.com> - 0.2.1-12.RC2
- Rebuild for glew 1.13

* Mon Aug 31 2015 Raphael Groner <projects.rg@smart.ms> - 0.2.1-11.RC2
- upstream moved to GitHub

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

* Wed Jan 28 2015 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-9.RC2
- introduce license macro

* Sat Jan 03 2015 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-8.RC2
- add manpage

* Sat Dec 27 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-7.RC2
- add glew as dependency
- add icon cache scriptlets

* Tue Dec 23 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-6.RC2
- v0.2.1 RC2
- use proper download url
- honor icons & desktop file from make install

* Tue Oct 07 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-5.1.RC1
- temporarily, disable weak dependencies due to unclear policy

* Mon Sep 29 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-5.RC1
- use desktop file from source tarball
- enable Suggests (rpm 4.12)

* Sun Sep 14 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-4.RC1
- fix folder owner

* Sun Sep 14 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-3.RC1
- fix Requires with right version
- rename dreamer sub-package to just engine
- licence of engine sub-package
- spelling for rpmlint

* Sat Sep 13 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-2.RC1
- dreamer engine provides chessprogram as a sub-package
- description mentions features
- manpages should not be in doc
- general cleanup for review
- proper licences
- tag for pre-release

* Wed Sep 10 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.2.1-1
- initial