openbve-traineditor-1.0.3.0-1kkr2009.0.spec
%define distname openbve
%define toolname traineditor
%define name %{distname}-%{toolname}
%define version 1.0.3.0
%define release %mkrel 1
%define openbvedir %{_gamesdatadir}/%{distname}
%define __gmcs %{_bindir}/gmcs
%define __resgen2 %{_bindir}/resgen2
Summary: Train editor for openBVE
Summary(ja): openBVE向けの車両エディタ
Name: %{name}
Version: %{version}
Release: %{release}
Source0: http://openbve.trainsimcentral.co.uk/common/tool_%{toolname}_source.zip
# Size : 50,642
# MD5 : 44d432a4efb97e66c2751876c6475218
# SHA-1 : 96f2f08bb5b3821018510b80bee645eda5db79f6
Source1: %{name}.desktop
# Size : 252
# MD5 : 988134b88330a893d88b2859baf75835
# SHA-1 : 1eebcaf0a3c78467069d297ed8509979b77dbf17
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
BuildRequires: mono >= 1.9 mono-winforms >= 1.9
BuildArch: noarch
%description
This package provides train editor for openBVE.
%description -l ja
本パッケージはopenBVE向けの車両エディタを提供します。
%prep
%setup -q -c
%build
%{__resgen2} TrainEditor/formEditor.resx formEditor.resources
%{__gmcs} \
-out:TrainEditor.exe \
-reference:System,System.Windows.Forms,System.Drawing \
-resource:formEditor.resources,TrainEditor.formEditor.resources \
TrainEditor/{Properties/,}*.cs
%install
%{__rm} %{buildroot} -fr
# assembly
%{__install} -D -m 755 {,%{buildroot}/%{openbvedir}/}TrainEditor.exe
# wrapper script
%{__cat} <<EOF > %{name}
#! /bin/bash
PATH=/bin:/usr/bin
if [ ! -d \${OPENBVEDIR:-~/openbve} ]; then
mkdir -p \${OPENBVEDIR:-~/openbve}
fi
cd \${OPENBVEDIR:-~/openbve}/
mono %{openbvedir}/TrainEditor.exe
EOF
%{__install} -D -m 755 {,%{buildroot}/%{_gamesbindir}/}%{name}
# freedesktop.org menu
%{__install} -D -p -m 644 %{SOURCE1} %{buildroot}/%{_datadir}/applications/%{name}.desktop
%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}/*
%{_datadir}/applications/*
%{openbvedir}/*
%changelog
* Wed Apr 15 2009 kakurasan <kakurasan AT gmail DOT com> 1.0.3.0-1kkr2009.0
- initial build