File FreeRCT.spec of Package FreeRCT
#
# spec file for package clementine
#
%define freerct_tar freerct-%{version}
%define freerct_name FreeRCT
%define freerct_folder FreeRCT
Name: FreeRCT
Version: 0.0.1git
Release: 0
Summary: FreeRCT free and open source game which captures the look, feel and gameplay of the popular games RollerCoaster Tycoon 1 and 2
License: GPL-3.0+
Group: Amusements/Games/Other
Url: http://freerct.org
Source: %{freerct_tar}.tar.xz
#Patch0: voidpatch.patch
BuildRoot: %{_tmppath}/%{xoreos_name}-%{version}-build
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(SDL2_ttf)
BuildRequires: pkgconfig(libpng)
BuildRequires: git
BuildRequires: bison
BuildRequires: flex
BuildRequires: doxygen
%description
Play xoreos engine compatible games, KOTOR...
%prep
%setup -q -n %{freerct_tar}
#%patch0 -p1
%build
%cmake -DOVERRIDE_VCS:BOOL=ON #cmake . # Checks libraries are where they're supposed to be and replaces some strings
make %{?_smp_mflags} # Let make do the heavy work.
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_bindir}
install -d %{buildroot}/usr/local/%{freerct_folder}
install -d %{buildroot}/usr/local/%{freerct_folder}/rcd
install -p -m 755 build/bin/freerct %{buildroot}/usr/local/%{freerct_folder}/freerct
install -p -m 755 build/bin/rcdgen %{buildroot}/usr/local/%{freerct_folder}/rcdgen
install -p -m 644 build/bin/rcd/* %{buildroot}/usr/local/%{freerct_folder}/rcd/
# create config
cat <<EOF >%{buildroot}/usr/local/%{freerct_folder}/freerct.cfg
[font]
medium-size = 12
medium-path = /usr/share/fonts/truetype/DroidSans.ttf
EOF
# create wrapper
cat <<EOF >%{buildroot}%{_bindir}/freerct
#!/bin/sh
cd /usr/local/%{freerct_folder}
./freerct
cd -
EOF
chmod +x %{buildroot}%{_bindir}/freerct
#ln -s /usr/local/%{freerct_folder}/freerct %{buildroot}%{_bindir}/freerct
#ln -s /usr/local/%{freerct_folder}/rcdgen %{buildroot}%{_bindir}/rcdgen
#make install
%files
%defattr(-,root,root,0755)
/usr/local/%{freerct_folder}
/usr/local/%{freerct_folder}/rcd
%defattr(-,root,root)
%{_bindir}/freerct
/usr/local/%{freerct_folder}/freerct
/usr/local/%{freerct_folder}/freerct.cfg
/usr/local/%{freerct_folder}/rcdgen
/usr/local/%{freerct_folder}/rcd/*
%changelog
* Thu Jun 18 2015 Ivan Gonzalez <xxxxxx@xgmail.com> - 0.0.1git-1
- Packaging FreeRCT