summaryrefslogtreecommitdiff
path: root/os/rpm
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-29 20:34:18 +0000
committerrubidium <rubidium@openttd.org>2009-09-29 20:34:18 +0000
commitd3cfacdbf0ba4f3b5a6e1fb4906d724ae3bb02c3 (patch)
tree336559d5e19af6cc2f8647a7ae754187261a8170 /os/rpm
parent5028e3536be3a736ce5b6ea59d82347e26fe6809 (diff)
downloadopenttd-d3cfacdbf0ba4f3b5a6e1fb4906d724ae3bb02c3.tar.xz
(svn r17666) -Fix [FS#3193]: RPM spec failed for SUSE (Ammler)
Diffstat (limited to 'os/rpm')
-rw-r--r--os/rpm/openttd.spec110
1 files changed, 65 insertions, 45 deletions
diff --git a/os/rpm/openttd.spec b/os/rpm/openttd.spec
index 08d0941ab..343de8cf1 100644
--- a/os/rpm/openttd.spec
+++ b/os/rpm/openttd.spec
@@ -24,10 +24,9 @@ Summary: OpenTTD is an Open Source clone of Chris Sawyer's Transport Tycoo
Source: %{name}-%{version}-source.tar.bz2
Requires: fontconfig
-Requires: libicu
-Requires: libpng
Requires: SDL
Requires: zlib
+BuildRequires: gcc-c++
BuildRequires: fontconfig-devel
BuildRequires: libpng-devel
BuildRequires: libicu-devel
@@ -38,33 +37,32 @@ BuildRequires: zlib-devel
Requires: freetype
BuildRequires: freetype-devel
%endif
-%if %{_vendor}=="MandrakeSoft" || %{_vendor}=="mandriva"
-Requires: freetype2
-BuildRequires: libfreetype6-devel
-%endif
%if %{_vendor}=="redhat" || %{_vendor}=="fedora"
Requires: freetype
BuildRequires: freetype-devel
BuildRequires: desktop-file-utils
%endif
-%if %{_vendor}=="suse"
+%if %{_vendor}=="suse" || %{_vendor}=="mandriva"
Requires: freetype2
BuildRequires: freetype2-devel
%endif
+%if %{_vendor}=="suse"
+BuildRequires: update-desktop-files
+%endif
+
+# recommends works for suse (not sles9) and mandriva, only
+%if 0%{?suse_version} > 910 || %{_vendor}=="mandriva"
+Recommends: opengfx
+# for 0.8.0
+#Recommends: opensfx
+%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%description
OpenTTD is a reimplementation of the Microprose game "Transport Tycoon Deluxe"
-with lots of new features and enhancements. To play the game you need to copy
-the following 6 data files from your Transport Tycoon Deluxe CD to the game
-data directory in %{_datadir}/games/%{name}/data:
-
-From the Windows version of TTD you need:
-sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf
-
-Or if you have the DOS version you need:
-sample.cat TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF
+with lots of new features and enhancements. To play the game you need either
+the original data from the game or install the recommend package OpenGFX.
OpenTTD is licensed under the GNU General Public License version 2.0. For more
information, see the file 'COPYING' included with every release and source
@@ -74,22 +72,29 @@ download of the game.
%setup -q
%build
+# suse sle <10 has no support for makedepend
+%if 0%{?sles_version} == 9 || 0%{?sles_version} == 10
+%define do_makedepend 0
+%else
+%define do_makedepend 1
+%endif
./configure \
- --revision=%{version} \
--prefix-dir="%{_prefix}" \
- --binary-dir="bin" \
--binary-name="%{name}" \
- --enable-debug=0 \
- --with-sdl \
- --with-zlib \
- --with-png \
- --with-freetype \
- --with-fontconfig \
- --with-icu \
--enable-strip \
+ --binary-dir="bin" \
+ --data-dir="share/%{name}" \
+ --with-makedepend="%{do_makedepend}" \
+# --revision="%{ver}%{?prever:-%{prever}}" \
+# --enable-debug=0 \
+# --with-sdl \
+# --with-zlib \
+# --with-png \
+# --with-freetype \
+# --with-fontconfig \
+# --with-icu \
# --menu_group="Game;" \
# --menu-name="OpenTTD" \
-# --data-dir="share\games\%{name}" \
# --doc-dir="share\doc\%{name}" \
# --icon-dir="share/pixmaps" \
# --icon-theme-dir="share/icons/hicolor" \
@@ -99,7 +104,6 @@ download of the game.
make %{?_smp_mflags}
%install
-rm -rf "%{buildroot}"
make install INSTALL_DIR="%{buildroot}"
# Validate menu entrys (vendor specific)
@@ -111,13 +115,28 @@ desktop-file-install \
"%{buildroot}/%{_datadir}/applications/%{name}.desktop" \
# --delete-original
%endif
+%if %{_vendor}=="suse"
+%__cat > %{name}.desktop << EOF
+[Desktop Entry]
+Encoding=UTF-8
+Name=OpenTTD
+Comment=OpenTTD - A clone of the Microprose game 'Transport Tycoon Deluxe'
+GenericName=OpenTTD
+Type=Application
+Terminal=false
+Exec=%{name}
+Icon=%{name}
+Categories=Game;StrategyGame;
+EOF
+%suse_update_desktop_file -i %{name} Game StrategyGame
+%endif
%clean
-rm -rf "%{buildroot}"
+#rm -rf "%{buildroot}"
%post
# Update the icon cache (vendor specific)
-%if %{_vendor}=="MandrakeSoft" || %{_vendor}=="mandriva"
+%if %{_vendor}=="mandriva"
%update_icon_cache hicolor
%endif
@@ -130,7 +149,7 @@ fi
%postun
# Update the icon cache (vendor specific)
-%if %{_vendor}=="MandrakeSoft" || %{_vendor}=="mandriva"
+%if %{_vendor}=="mandriva"
%update_icon_cache hicolor
%endif
@@ -144,38 +163,39 @@ fi
%files
%defattr(-, root, games, -)
%dir %{_datadir}/doc/%{name}
-%dir %{_datadir}/games/%{name}
-%dir %{_datadir}/games/%{name}/lang
-%dir %{_datadir}/games/%{name}/data
-%dir %{_datadir}/games/%{name}/gm
+%dir %{_datadir}/%{name}
+%dir %{_datadir}/%{name}/lang
+%dir %{_datadir}/%{name}/data
+%dir %{_datadir}/%{name}/gm
+%dir %{_datadir}/%{name}/scripts
%attr(755, root, games) %{_bindir}/%{name}
%{_datadir}/doc/%{name}/*
-%{_datadir}/games/%{name}/lang/*
-%{_datadir}/games/%{name}/data/*
-%{_datadir}/games/%{name}/scripts/*
+%{_datadir}/%{name}/lang/*
+%{_datadir}/%{name}/data/*
+%{_datadir}/%{name}/scripts/*
%{_datadir}/applications/*%{name}.desktop
%{_datadir}/pixmaps/*
-%{_datadir}/icons/hicolor/*/apps/%{name}.png
-%doc %{_mandir}/man6/%{name}.6.gz
+%{_datadir}/icons/*
+%doc %{_mandir}/man6/%{name}.6.*
%changelog
-* Mon Oct 20 2008 Benedikt Brüggemeier <skidd13@openttd.org>
+* Sat Sep 26 2009 Marcel Gmür <ammler@openttdcoop.org> - 0.7.2
+- no subfolder games for datadir
+- cleanup: no post and postun anymore
+- Recommends: opengfx (for suse and mandriva)
+- add SUSE support
+* Mon Oct 20 2008 Benedikt Brüggemeier <skidd13@openttd.org>
- Added libicu dependency
* Thu Sep 23 2008 Benedikt Brüggemeier <skidd13@openttd.org>
-
- Merged both versions of the spec file
* Fri Aug 29 2008 Jonathan Coome <maedhros@openttd.org>
-
- Rewrite spec file from scratch.
* Sat Aug 02 2008 Benedikt Brüggemeier <skidd13@openttd.org>
-
- Updated spec file
* Thu Mar 27 2008 Denis Burlaka <burlaka@yandex.ru>
-
- Universal spec file
-