#
# Conditional build:
# video (default: X11-only version):
-# _with_svga - SVGALIB version
-# _with_sdl - SDL version
-# _with_sdlsvga - SDL/SVGALIB version
+%bcond_with svga # SVGALIB version
+%bcond_with sdl # SDL version
+%bcond_with sdlsvga # SDL/SVGALIB version
# CD-Audio support:
-# _with_cda_internal - internal CD Audio Support
-# _with_cda_sdl - SDL CD Audio Support
+%bcond_with cda_internal # internal CD Audio Support
+%bcond_with cda_sdl # SDL CD Audio Support
# other:
-# _with_arts - arts audio output support
-# _with_flac - with FLAC audio codec support
-# _with_wc2 - WarCraft 2 Expansion CD
+%bcond_with arts # arts audio output support
+%bcond_with flac # with FLAC audio codec support
+%bcond_with wc2 # WarCraft 2 Expansion CD
#
Summary: Free cross-platform real-time strategy gaming engine
Summary(pl): Wolnodostêpny, miêdzyplatformowy silnik gier strategicznych czasu rzeczywistego
Patch1: %{name}-nonint.patch
Patch3: %{name}-flac-update.patch
URL: http://freecraft.sourceforge.net/
-%{?_with_sdl:BuildRequires: SDL-devel}
-%{?_with_sdlsvga:BuildRequires: SDL-devel}
-%{?_with_arts:BuildRequires: arts-devel}
+%{?with_sdl:BuildRequires: SDL-devel}
+%{?with_sdlsvga:BuildRequires: SDL-devel}
+%{?with_arts:BuildRequires: arts-devel}
BuildRequires: bzip2-devel
-%{?_with_flac:BuildRequires: flac-devel >= 1.0.3}
+%{?with_flac:BuildRequires: flac-devel >= 1.0.3}
BuildRequires: libmad-devel
BuildRequires: libpng-devel
BuildRequires: libvorbis-devel
-%{?_with_svga:BuildRequires: svgalib-devel}
+%{?with_svga:BuildRequires: svgalib-devel}
BuildRequires: zlib-devel
Conflicts: %{name}-data < 1:1.18-0.pre1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%build
# Version to compile
-%{?_with_svga:WITH_VIDEO="V"}
-%{?_with_sdl:WITH_VIDEO="S"}
-%{?_with_sdlsvga:WITH_VIDEO="B"}
-%{!?_with_svga:%{!?_with_sdl:%{!?_with_sdlsvga:WITH_VIDEO="X"}}}
+%{?with_svga:WITH_VIDEO="V"}
+%{?with_sdl:WITH_VIDEO="S"}
+%{?with_sdlsvga:WITH_VIDEO="B"}
+%{!?with_svga:%{!?with_sdl:%{!?with_sdlsvga:WITH_VIDEO="X"}}}
export WITH_VIDEO
# sound support
WITH_SOUND="y"; export WITH_SOUND
# sound support arts
-%{!?_with_arts:WITH_SOUND_ARTS="y"}
-%{?_with_arts:WITH_SOUND_ARTS="n"}
+%{!?with_arts:WITH_SOUND_ARTS="y"}
+%{?with_arts:WITH_SOUND_ARTS="n"}
export WITH_SOUND_ARTS
# threaded sound
WITH_THREADEDSOUND="y"; export WITH_THREADEDSOUND
# FLAC support
-WITH_FLAC="%{?_with_flac:y}%{!?_with_flac:n}"; export WITH_FLAC
+WITH_FLAC="%{?with_flac:y}%{!?with_flac:n}"; export WITH_FLAC
# OGG support
WITH_OGG="y"; export WITH_OGG
WITH_MAD="y"; export WITH_MAD
# CD audio
-%{?_with_cda_internal:WITH_CDA="i"}
-%{?_with_cda_sdl:WITH_CDA="S"}
-%{!?_with_cda_internal:%{!?_with_cda_sdl:WITH_CDA="n"}}
+%{?with_cda_internal:WITH_CDA="i"}
+%{?with_cda_sdl:WITH_CDA="S"}
+%{!?with_cda_internal:%{!?with_cda_sdl:WITH_CDA="n"}}
export WITH_CDA
# COMPRESSION OPTIONS (both zlib and bzip2, no zziplib)
WITH_COMP="O"; export WITH_COMP
# WarCraft 2 Expansion CD
-WITH_WC2EXPCD="%{?_with_wc2:y}%{!?_with_wc2:n}"; export WITH_WC2EXPCD
+WITH_WC2EXPCD="%{?with_wc2:y}%{!?with_wc2:n}"; export WITH_WC2EXPCD
# Compile (NO!)
WITH_COMPILE="n"; export WITH_COMPILE