openbve-1.2.2.0-1kkr2009.1.spec
%define name openbve
%define version 1.2.2.0
%define release %mkrel 1
%define openbvedir %{_gamesdatadir}/%{name}
%define __find /bin/find
%define __sort /bin/sort
%define __gmcs %{_bindir}/gmcs
Summary: BVE-compatible train driving simulator with new features
Summary(ja): BVE互換で新機能も備えた鉄道運転シミュレータ
Name: %{name}
Version: %{version}
Release: %{release}
Source0: http://openbve.trainsimcentral.co.uk/common/%{name}_stable_source.zip
# Size : 296,687
# MD5 : fdfd802482dcbd9e6fae4b280f8ecd9b
# SHA-1 : 9442f0cb0ff349920e6fbd8c8201ea5f053a66c1
Source1: http://openbve.trainsimcentral.co.uk/common/%{name}_stable.zip
# Size : 2,015,104
# MD5 : 7b39d0978628c1a85e210ba3d6dfc942
# SHA-1 : e46a6ebb21a953f884c290e4d0f0a90064c65438
Source2: %{name}.desktop
# Size : 288
# MD5 : c8e3585d2faabc427a6ab9dcfbfc9a93
# SHA-1 : 0b5f63286f3914f3dc75adb14f440f7bc0731f04
Patch: %{name}-1.0.3.0-wmicon.patch
# Size : 1,494
# MD5 : 2efe7894616d494595c2cbc0dadacaaf
# SHA-1 : 4ed0e985d900e1cf0ee88e62a56d279511ee0ad7
URL: http://openbve.trainsimcentral.co.uk/
License: Public Domain-like
Group: Games/Other
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: mono >= 1.9 mono-winforms >= 1.9 mono-locale-extras >= 1.9 libtaoframework-opengl >= 2.0 libtaoframework-openal >= 2.0 libtaoframework-sdl >= 2.0
BuildRequires: mono >= 1.9 mono-winforms >= 1.9 libtaoframework-opengl >= 2.0 libtaoframework-openal >= 2.0 libtaoframework-sdl >= 2.0
BuildArch: noarch
%description
openBVE is a license-free, open source, free of charge train driving simulator.
%description -l ja
openBVEはライセンスフリーでオープンソースで無料な鉄道運転シミュレータです。
%prep
%setup -q -c -b 1
%patch -p1 -b .wmicon
%build
%{__gmcs} \
-out:OpenBve.exe \
-lib:%{_prefix}/lib/mono/tao-opengl,%{_prefix}/lib/mono/tao-openal,%{_prefix}/lib/mono/tao-sdl \
-reference:Tao.OpenGl,Tao.OpenAl,Tao.Sdl,System,System.Windows.Forms,System.Drawing \
openBVE/OpenBve/{,Properties/,Parsers/}*.cs
%install
%{__rm} %{buildroot} -fr
# assembly
%{__install} -D -m 755 {,%{buildroot}/%{openbvedir}/}OpenBve.exe
# data
for d in $(%{__find} Data -type f | %{__sed} 's,/[^/]*$,,' | %{__sort} -u); do
%{__install} -d %{buildroot}/%{openbvedir}/${d}
%{__install} -p -m 644 ${d}/*.* %{buildroot}/%{openbvedir}/${d}/
done
# wrapper script
%{__cat} <<EOF > openbve
#! /bin/bash
PATH=/bin:%{_prefix}/bin
if [ ! -d \${OPENBVEDIR:-~/openbve} ]; then
mkdir -p \${OPENBVEDIR:-~/openbve}/{Data,Train,Settings} \${OPENBVEDIR:-~/openbve}/Railway/{Object,Route,Sound}
fi
cd \${OPENBVEDIR:-~/openbve}/
for d in \$(find %{openbvedir}/Data -type f | sed 's,/[^/]*\$,,' | sort -u); do
mkdir \$(echo \${d} | sed 's:%{openbvedir}/::') -p
ln -s \${d}/*.* \$(echo \${d} | sed 's:%{openbvedir}/::')/ 2> /dev/null
done
if [ "x\$(md5sum %{openbvedir}/OpenBve.exe | awk -F " " '{print \$1}')" != "x\$(md5sum \${OPENBVEDIR:-~/openbve}/OpenBve.exe 2> /dev/null | awk -F " " '{print \$1}')" ]; then
cp %{openbvedir}/OpenBve.exe \${OPENBVEDIR:-~/openbve}/
fi
for f in Data/Languages/*.cfg; do
test -f \${f} || rm \${f}
done
MONO_PATH=%{_prefix}/lib/mono/tao-opengl:%{_prefix}/lib/mono/tao-openal:%{_prefix}/lib/mono/tao-sdl mono OpenBve.exe
EOF
%{__install} -D -m 755 {,%{buildroot}/%{_gamesbindir}/}openbve
# freedesktop.org menu
%{__install} -D -p -m 644 %{SOURCE2} %{buildroot}/%{_datadir}/applications/%{name}.desktop
# icon
%{__install} -D -p -m 644 Data/Menu/logo.png %{buildroot}/%{_datadir}/pixmaps/%{name}.png
# doc
%{__lzma} *.txt
%if %{mdkversion} < 200900
%post
%update_desktop_database
%endif
%if %{mdkversion} < 200900
%postun
%clean_desktop_database
%endif
%clean
%{__rm} %{buildroot} -fr
%files
%defattr(-, root, root)
%{_gamesbindir}/openbve
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{openbvedir}/
%doc *.txt.*
%changelog
* Tue Sep 29 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.2.0-1kkr2009.[01]
- new version
* Fri Sep 04 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.1.3-1kkr2009.[01]
- new version
* Mon Aug 31 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.1.2-1kkr2009.[01]
- new version
* Sat Aug 29 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.1.1-1kkr2009.[01]
- new version
* Mon Aug 17 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.1.0-1kkr2009.[01]
- new version
* Thu Aug 06 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.0.3-1kkr2009.[01]
- new version
* Sun Aug 02 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.0.1-1kkr2009.[01]
- new version
* Sun Jul 26 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.0.0-1kkr2009.[01]
- new version
* Sat Jul 18 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.7.3-1kkr2009.0
- new version
- update wrapper script, avoid "Could not find file" error
* Fri Jun 19 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.7.2-1kkr2009.0
- new version
* Sun May 31 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.6.2-1kkr2009.1
- new version
* Thu May 28 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.6.0-1kkr2009.1
- new version
* Thu May 07 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.5.0-1kkr2009.1
- new version
* Wed Apr 29 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.4.1-1kkr2009.0
- new version
* Tue Apr 14 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.3.0-1kkr2009.0
- new version
- update URL
- fix BuildRequires(missing mono-winforms)
* Sun Apr 05 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.2.0-1kkr2009.0
- new version
* Mon Mar 30 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.1.0-1kkr2009.0
- new version
- replace "/usr" with "%{_prefix}"
* Thu Mar 26 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.0.0-2kkr2009.0
- fix wmicon mask
* Mon Mar 23 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.0.0-1kkr2009.0
- new version
* Wed Feb 18 2009 kakurasan <kakurasan AT gmail DOT com> 0.9.5.5-1kkr2009.0
- new version
* Mon Feb 02 2009 kakurasan <kakurasan AT gmail DOT com> 0.9.5.0-1kkr2009.0
- new version
* Wed Jan 30 2009 kakurasan <kakurasan AT gmail DOT com> 0.9.4.2-1kkr2009.0
- new version
* Wed Jan 28 2009 kakurasan <kakurasan AT gmail DOT com> 0.9.4.0-1kkr2009.0
- new version
* Tue Jan 20 2009 kakurasan <kakurasan AT gmail DOT com> 0.9.3.7-1kkr2009.0
- new version
* Wed Jan 14 2009 kakurasan <kakurasan AT gmail DOT com> 0.9.3.3-1kkr2009.0
- initial build