File CorsixTH.spec of Package CorsixTH
#
# spec file for package CorsixTH
#
# Copyright (c) 2014 SUSE LINUX Products 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/
#
%define versionfolder 0.67
%define installname corsix-th
Name: CorsixTH
Version: 0.67
Release: 0
Url: https://github.com/CorsixTH
Summary: Theme Hospital clone
License: MIT
Group: Amusements/Games/Strategy/Other
Source: v%{version}.tar.gz
Source1: https://github.com/CorsixTH/CorsixTH/archive/v%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
%if 0%{?suse_version} >= 1320
BuildRequires: pkgconfig(SDL2_mixer)
%endif
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(lua)
##%if 0%{?suse_version} > 1210
#BuildRequires: lua51-devel
##%else
#BuildRequires: lua-devel
##%endif
#BuildRequires: pkgconfig(luajit)
BuildRequires: update-desktop-files
BuildRequires: wxWidgets-devel
BuildRequires: timidity
#BuildRequires: libffmpeg-devel
BuildRequires: libavcodec-devel
BuildRequires: libavformat-devel
BuildRequires: libavdevice-devel
BuildRequires: libavfilter-devel
BuildRequires: libavformat-devel
BuildRequires: libavresample-devel
BuildRequires: libavutil-devel
BuildRequires: libswscale-devel
BuildRequires: libswresample-devel
BuildRequires: libpostproc-devel
Requires: timidity
#Requires(post): lua-devel, luarocks
#Requires: lua-devel, lua-luarocks
##%triggerin -- CorsixTH
#if [ "$1" -ge "1" ]; then
#luarocks install luafilesystem
#luarocks install lpeg
#fi
%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 -n %{name}-%{version}%{beta_version}
%setup -q -n %{name}-%{versionfolder}
# Fixes https://code.google.com/p/corsix-th/issues/detail?id=1704&start=100
#sed -i 's|install(FILES CorsixTH.lua LICENSE.txt CorsixTH.ico DESTINATION CorsixTH )|install(FILES CorsixTH.lua CorsixTH.ico DESTINATION CorsixTH )|' CorsixTH/CMakeLists.txt
%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
export FFLAGS="%{optflags}"
#cmake . -DCMAKE_INSTALL_PREFIX=%{_libdir} -DWITH_MOVIES=OFF
%if 0%{?suse_version} < 1320
cmake . -DCMAKE_INSTALL_PREFIX=%{_datadir} -DWITH_LIBAV=ON -DWITH_AUDIO=OFF
%else
#cmake . -DCMAKE_INSTALL_PREFIX=%{_libdir}
cmake . -DCMAKE_INSTALL_PREFIX=%{_datadir} -DWITH_LIBAV=ON
%endif
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/%{name}/Data
make DESTDIR=%{buildroot} install
# create wrapper
cat <<EOF >%{buildroot}%{_bindir}/%{installname}
#!/bin/sh
cd %{_datadir}/%{installname}
./%{installname}
cd -
EOF
chmod +x %{buildroot}%{_bindir}/%{installname}
# install icons and desktop file
#mkdir %{buildroot}%{_datadir}
mkdir %{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
%defattr(-,root,root)
%{_datadir}/bin
%defattr(-,root,root)
%{_datadir}/share
%defattr(-,root,root)
%{_datadir}/share/%{installname}
%defattr(-,root,root)
%{_bindir}/%{installname}
##asd%{_datadir}/%{installname}/
%{_datadir}/share/%{installname}/*
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%changelog