openbve-1.2.8.2-1kkr2010.1.spec

%define name       openbve
%define version    1.2.8.2
%define release    %mkrel 1

%define openbvedir %{_gamesdatadir}/%{name}


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  : 329876
  # MD5   : d2391c896c6a95af697d4fb1f93c85f7
  # SHA-1 : 752420395f926e2c6182e32ad0cb71b99ba2aa17
Source1:        http://openbve.trainsimcentral.co.uk/common/%{name}_stable.zip
  # Size  : 1814583
  # MD5   : ba2f459a3e64fa34272a340f9d689c02
  # SHA-1 : d0296bfb2d6cfe0a8ff97482ebd4b393af2733ce
Source2:        %{name}.desktop
  # Size  : 288
  # MD5   : c8e3585d2faabc427a6ab9dcfbfc9a93
  # SHA-1 : 0b5f63286f3914f3dc75adb14f440f7bc0731f04
Patch:          %{name}-1.2.7.0-wmicon.patch
  # Size  : 1490
  # MD5   : 117ab469d57dfa41f440217d8d3609f5
  # SHA-1 : faa649169dc19d5161c189577b3edf1efdcd5b6c
URL:            http://openbve.trainsimcentral.co.uk/
License:        Public Domain-like
Group:          Games/Other
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires:  mono >= 1.9 mono-winforms >= 1.9 libtaoframework-common-opengl >= 2.0 libtaoframework-common-openal >= 2.0 libtaoframework-common-sdl >= 2.0
Requires:       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
%{__rm} Readme.txt
%setup -q -c -T -D -a 1
%patch -p1 -b .wmicon
%{__rm} openBVE/OpenBve/CsvB3dObjectParser.cs


%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 openBVE/OpenBveApi/*.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
%{__xz} *.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
* Sun Oct 10 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.8.2-1kkr2010.1
- new version

* Mon Aug 30 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.7.4-1kkr2010.1
- new version

* Sun Aug 08 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.7.3-1kkr2010.1
- new version

* Sun Aug 01 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.7.2-1kkr2010.1
- new version

* Wed Jul 14 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.7.0-1kkr2010.1
- new version
- BuildRequires: libtaoframework-common-{opengl,openal,sdl}
- Requires: libtaoframework-{opengl,openal,sdl}
- update wmicon patch

* Mon May 03 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.6.3-1kkr2010.0
- new version

* Sun Mar 14 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.6.0-1kkr2010.0
- new version

* Mon Feb 15 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.5.1-1kkr2010.0
- new version

* Mon Jan 25 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.5.0-1kkr2010.0
- new version

* Mon Jan 04 2010 kakurasan <kakurasan AT gmail DOT com> 1.2.3.3-1kkr2010.0
- new version

* Tue Dec 15 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.3.2-1kkr2010.0
- new version

* Tue Dec 01 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.3.1-1kkr2010.0
- new version

* Wed Nov 18 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.3.0-1kkr2010.0
- new version

* Tue Nov 17 2009 kakurasan <kakurasan AT gmail DOT com> 1.2.2.0-2kkr2010.0
- drop unneeded Requires

* 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