File CorsixTH.spec of Package CorsixTH

#
# spec file for package CorsixTH
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           CorsixTH
Version:        0.61
Release:        0
Summary:        Theme Hospital clone
License:        MIT
Group:          Amusements/Games/Strategy/Other
Url:            http://corsixth.com
Source:         https://github.com/CorsixTH/CorsixTH/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  update-desktop-files
BuildRequires:  wxWidgets-devel
BuildRequires:  pkgconfig(SDL2_mixer)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavdevice)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libpostproc)
BuildRequires:  pkgconfig(libswresample)
BuildRequires:  pkgconfig(libswscale)
%if 0%{?suse_version} > 1320
BuildRequires:  pkgconfig(luajit)
%else
BuildRequires:  lua51-luajit-devel
%endif
BuildRequires:  pkgconfig(sdl2)
Recommends:     timidity
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1210
BuildRequires:  lua51-devel
%else
BuildRequires:  lua-devel
%endif
Requires:       lua51-LPeg
Requires:       lua51-luafilesystem

%description
This project aims to reimplement the game engine of Theme Hospital, and be
able to load the original game data files. This means that you will need a
purchased copy of Theme Hospital, or a copy of the demo, in order to use
CorsixTH. After most of the original engine has been reimplemented in open
source code, the project will serve as a base from which extensions and
improvements to the original game can be made.

%prep
%setup -q

%build
# TODO: https://github.com/CorsixTH/CorsixTH/issues/1315
%cmake -DCMAKE_INSTALL_PREFIX=%{_libdir} -DWITH_MOVIES=OFF
make %{?_smp_mflags}

%install
pushd build
make DESTDIR=%{buildroot} install %{?_smp_mflags}
popd
mkdir -p %{buildroot}%{_bindir}
# create wrapper
cat <<EOF > %{buildroot}%{_bindir}/%{name}
#!/bin/sh
cd %{_libdir}/%{name}
./%{name}
cd -
EOF
chmod +x %{buildroot}%{_bindir}/%{name}
# install icons and desktop file
mkdir %{buildroot}%{_datadir}
mkdir %{buildroot}%{_datadir}/pixmaps
mv %{buildroot}%{_libdir}/CorsixTH/CorsixTH.ico %{buildroot}%{_datadir}/pixmaps
install -p -m 644 CorsixTH/Original_Logo.svg %{buildroot}%{_datadir}/pixmaps/CorsixTH.svg
%suse_update_desktop_file -c CorsixTH CorsixTH "A Theme Hospital Clone" CorsixTH CorsixTH Game Simulation

%files
%defattr(-,root,root)
%doc LICENSE.txt README.txt
%{_bindir}/%{name}
%{_libdir}/%{name}/
%{_datadir}/applications/*
%{_datadir}/pixmaps/*

%changelog
openSUSE Build Service is sponsored by