File instead.spec of Package instead

%define realname instead
%define realver  3.2.1
%define srcext   tar.gz

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       MIT
Group:         Amusements/Games/Logic
URL:           http://instead.syscall.ru/
Summary:       Simple Text Adventure Interpreter

# Build-time parameters
BuildRequires: cmake >= 2.6 gcc-c++ pkg-config
BuildRequires: lua51-devel
BuildRequires: zlib-devel
BuildRequires: SDL2-devel SDL2_mixer-devel SDL2_image-devel SDL2_ttf-devel
BuildRequires: gtk2-devel
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://instead.syscall.ru/instead/%{realver}/%{realname}_%{realver}.%{srcext}

%description
INSTEAD -- interpreter of simple text adventures.

INSTEAD was designed to interpret the games that are the mix of visual novels,
text quests and classical 90'ss quests.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}

%build
%{__mkdir} build
cd build
cmake .. \
 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_CXX_FLAGS_RELEASE="%{optflags}" \
 -DCMAKE_C_FLAGS_RELEASE="%{optflags}" \
 -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-Wl,--as-needed -Wl,--strip-all" \
 -DCMAKE_MODULE_LINKER_FLAGS_RELEASE="-Wl,--as-needed -Wl,--strip-all" \
 -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-Wl,--as-needed -Wl,--strip-all -shared" \
 -DCMAKE_VERBOSE_MAKEFILE=YES
%{__make} %{?_smp_mflags}

%install
%{__make} -C build install DESTDIR=%{buildroot}

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc AUTHORS COPYING README doc/*.html doc/*.pdf doc/instead.txt
%{_bindir}/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/sdl_instead*
%doc %{_mandir}/man6/%{name}.6*
%exclude %{_datadir}/doc/

%changelog
openSUSE Build Service is sponsored by