Blame brutalchess.spec

84f1e2c
%global pre     alpha
84f1e2c
%global title   BrutalChess
84f1e2c
84f1e2c
#global buildtex  0
84f1e2c
84f1e2c
Name:           brutalchess
84f1e2c
Version:        0.5.2
76fe719
Release:        0.1.%{pre}%{?dist}
84f1e2c
Summary:        Chess game with impressive 3D graphics
84f1e2c
84f1e2c
License:        GPLv2+
84f1e2c
URL:            http://sf.net/projects/%{name}
84f1e2c
##we don't want the original fonts due to legal reasoning
84f1e2c
#http://sf.net/projects/%{name}/files/%{name}-%{pre}/%{name}-%{pre}-%{version}/%{name}-%{pre}-%{version}-src.tar.gz
84f1e2c
Source0:        %{name}-%{pre}-%{version}-nofonts.tar.xz
84f1e2c
Source1:        %{name}-nofonts.sh
84f1e2c
84f1e2c
Patch0:         https://sf.net/p/%{name}/patches/8/attachment/%{name}-freetype2.patch
84f1e2c
# fonts: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584416
84f1e2c
Patch1:         https://sf.net/p/%{name}/patches/7/attachment/%{name}-fonts.diff
84f1e2c
84f1e2c
# features later:
84f1e2c
# FIXME crafty https://sourceforge.net/p/brutalchess/patches/4/
84f1e2c
# FIXME PGN https://sourceforge.net/p/brutalchess/patches/3/
84f1e2c
# FIXME -l option https://sourceforge.net/p/brutalchess/patches/2/
84f1e2c
84f1e2c
Source10:       http://slackbuilds.org/slackbuilds/14.1/games/%{name}/%{name}.desktop
84f1e2c
Source11:       http://slackbuilds.org/slackbuilds/14.1/games/%{name}/%{name}.png
84f1e2c
Patch10:        http://slackbuilds.org/slackbuilds/14.1/games/%{name}/%{name}-%{version}-fix-FTBFS.patch
84f1e2c
Patch11:        http://slackbuilds.org/slackbuilds/14.1/games/%{name}/%{name}-%{version}-gcc4.3.patch
84f1e2c
Patch12:        http://slackbuilds.org/slackbuilds/14.1/games/%{name}/%{name}-%{version}-gcc4.7.patch
84f1e2c
84f1e2c
BuildRequires:  libXt-devel mesa-libGL-devel libXi-devel libXmu-devel
84f1e2c
BuildRequires:  SDL-devel SDL_image-devel
84f1e2c
BuildRequires:  freetype-devel
84f1e2c
BuildRequires:  gnu-free-mono-fonts gnu-free-sans-fonts gnu-free-serif-fonts
84f1e2c
BuildRequires:  dos2unix doxygen
84f1e2c
%if 0%{?buildtex:1}
84f1e2c
BuildRequires:  tex2html
84f1e2c
BuildRequires:  %{_bindir}/latex texlive-texconfig
84f1e2c
BuildRequires:  %{_bindir}/dvips %{_bindir}/ps2pdf %{_bindir}/psnup
84f1e2c
%endif
84f1e2c
BuildRequires:  desktop-file-utils
84f1e2c
84f1e2c
84f1e2c
%description
84f1e2c
%{title} features full 3D graphics, an advanced particle engine, 
84f1e2c
and several different levels of intelligent AI, inspired by the once 
84f1e2c
popular "Battle Chess" released by Interplay circa 1988.
84f1e2c
84f1e2c
84f1e2c
%package doc
84f1e2c
Summary:        Additional documentation files for the game %{title}
84f1e2c
BuildArch:      noarch
84f1e2c
Requires:       %{name} = %{version}-%{release}
84f1e2c
84f1e2c
%description doc
84f1e2c
Extra documentation files for the game %{title}, like doxygen withfor
84f1e2c
html and latex formats.
84f1e2c
84f1e2c
84f1e2c
%prep
84f1e2c
%setup -q
84f1e2c
sed -i s,fonts,, Makefile.in
84f1e2c
%patch0 -p0
84f1e2c
%patch1 -p1
84f1e2c
%patch10
84f1e2c
%patch11
84f1e2c
%patch12 -p1
84f1e2c
dos2unix NEWS README
84f1e2c
doxygen -u
84f1e2c
84f1e2c
84f1e2c
%build
84f1e2c
##FIXME libXt support is a feature
84f1e2c
%configure --with-x
84f1e2c
make %{?_smp_mflags}
84f1e2c
doxygen
84f1e2c
84f1e2c
##distribute tex
84f1e2c
cd doc
84f1e2c
mv latex refman
84f1e2c
cd refman
84f1e2c
%if 0%{?buildtex:1}
84f1e2c
# FIXME is the html from tarball generated from tex?
84f1e2c
tex2html refman.tex
84f1e2c
# FIXME latex issues ahead!
84f1e2c
#make pdf
84f1e2c
#make ps_2on1 pdf_2on1
84f1e2c
#make all
84f1e2c
rm *.tex
84f1e2c
%endif
84f1e2c
make clean
84f1e2c
84f1e2c
84f1e2c
%install
84f1e2c
%make_install
84f1e2c
84f1e2c
##misplaced content
84f1e2c
rm -r %{buildroot}%{_datadir}/%{name}/doc
84f1e2c
84f1e2c
##desktop
84f1e2c
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE10}
84f1e2c
install -d %{buildroot}%{_datadir}/pixmaps
84f1e2c
cp -p %{SOURCE11} %{buildroot}%{_datadir}/pixmaps
84f1e2c
84f1e2c
##fonts configuration made legally
84f1e2c
##FIXME ugly hackery with symlinks for fixed file names,
84f1e2c
##could change in future, maybe better ask upstream to patch source
84f1e2c
install -d %{buildroot}%{_datadir}/%{name}/fonts
84f1e2c
pushd %{buildroot}%{_datadir}/%{name}/fonts
84f1e2c
find -name \*.TTF -or -name \*.tff -delete
84f1e2c
ln -s ../../fonts/gnu-free/FreeSerifBold.ttf COOLVETI.TTF
84f1e2c
ln -s ../../fonts/gnu-free/FreeSerif.ttf Ghostwri.ttf
84f1e2c
ln -s ../../fonts/gnu-free/FreeMono.ttf VeraMono.ttf
84f1e2c
ln -s ../../fonts/gnu-free/FreeSans.ttf ZERO__.TTF
84f1e2c
popd
84f1e2c
84f1e2c
##doxygen
84f1e2c
install -d %{buildroot}%{_pkgdocdir}
84f1e2c
cp -ap doc/html %{buildroot}%{_pkgdocdir}
84f1e2c
84f1e2c
84f1e2c
%files
84f1e2c
%doc AUTHORS COPYING ChangeLog NEWS README
84f1e2c
# engine
84f1e2c
%{_bindir}/%{name}
84f1e2c
%{_libexecdir}/md3view
84f1e2c
%{_libexecdir}/objview
84f1e2c
# desktop & icon
84f1e2c
%{_datadir}/applications/%{name}.desktop
84f1e2c
%{_datadir}/pixmaps/%{name}.png
84f1e2c
# data
84f1e2c
%{_datadir}/%{name}/
84f1e2c
#%{_datadir}/%{name}/art/
84f1e2c
#%{_datadir}/%{name}/models/
84f1e2c
# fonts
84f1e2c
#%{_datadir}/%{name}/fonts/
84f1e2c
84f1e2c
%files doc
84f1e2c
%dir %{_pkgdocdir}
84f1e2c
%doc doc/html/
84f1e2c
%doc doc/refman/
84f1e2c
84f1e2c
84f1e2c
%changelog
76fe719
* Mon Dec 15 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.5.2-0.1.alpha
76fe719
- original by Timur Kristóf (rhbz#701812)
76fe719
- fixes for new review (rhbz#1157213)
84f1e2c
- fix broken BR for Xorg
84f1e2c
- remove subpackages
84f1e2c
- additional doc package
84f1e2c
- desktop stuff and gcc patches from Slackware
84f1e2c
- link freetype2 properly
84f1e2c
- replace fonts, patch adopted from Debian
84f1e2c
- macro title in description
84f1e2c
- enhance documentation with doxygen and latex