2012-02-11 19:25:53 +00:00
|
|
|
#
|
|
|
|
# spec file for package openttd
|
|
|
|
#
|
|
|
|
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2019-02-01 21:57:29 +00:00
|
|
|
# Copyright (c) 2007-2019 The OpenTTD developers
|
2012-02-11 19:25:53 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
Name: openttd
|
2019-12-21 19:05:47 +00:00
|
|
|
Version: 1.10.beta2
|
2012-02-11 19:25:53 +00:00
|
|
|
Release: 0
|
2019-12-21 19:05:47 +00:00
|
|
|
%define srcver 1.10.0-beta2
|
2012-02-11 19:25:53 +00:00
|
|
|
Summary: An open source reimplementation of Chris Sawyer's Transport Tycoon Deluxe
|
|
|
|
License: GPL-2.0
|
2011-03-17 20:47:36 +00:00
|
|
|
Group: Amusements/Games/Strategy/Other
|
2012-02-11 19:25:53 +00:00
|
|
|
Url: http://www.openttd.org
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
Source: http://binaries.openttd.org/releases/%{srcver}/%{name}-%{srcver}-source.tar.gz
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%if 0%{?suse_version} || 0%{?mdkversion}
|
|
|
|
Recommends: %{name}-gui
|
|
|
|
%endif
|
2011-03-17 20:47:36 +00:00
|
|
|
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: libpng-devel
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%if 0%{?suse_version} || 0%{?mdkversion}
|
|
|
|
BuildRequires: update-alternatives
|
|
|
|
Requires: update-alternatives
|
|
|
|
%else
|
|
|
|
BuildRequires: chkconfig
|
|
|
|
Requires: chkconfig
|
|
|
|
%endif
|
|
|
|
|
2011-03-17 20:47:36 +00:00
|
|
|
%if 0%{?mdkversion}
|
|
|
|
BuildRequires: liblzma-devel
|
2012-02-11 19:25:53 +00:00
|
|
|
BuildRequires: liblzo-devel
|
2011-03-17 20:47:36 +00:00
|
|
|
%else
|
|
|
|
BuildRequires: lzo-devel
|
|
|
|
BuildRequires: xz-devel
|
2008-03-27 16:09:15 +00:00
|
|
|
%endif
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
# OBS workaround: needed by libdrm
|
|
|
|
%if 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
|
2011-03-17 20:47:36 +00:00
|
|
|
BuildRequires: kernel
|
2008-10-21 12:15:09 +00:00
|
|
|
%endif
|
2011-03-17 20:47:36 +00:00
|
|
|
|
|
|
|
# for lzma detection
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: pkg-config
|
2008-10-21 12:15:09 +00:00
|
|
|
%endif
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2019-09-29 20:27:32 +00:00
|
|
|
# building openttd.grf is not required as it is a) part of source and
|
2012-02-11 19:25:53 +00:00
|
|
|
# b) required only, if you want to use the original set
|
|
|
|
%if 0%{?with_grfcodec}
|
2011-03-17 20:47:36 +00:00
|
|
|
BuildRequires: grfcodec
|
2012-02-11 19:25:53 +00:00
|
|
|
%endif
|
|
|
|
# Recommends would fit better but not well supported...
|
|
|
|
Requires: openttd-opengfx >= 0.4.2
|
|
|
|
|
|
|
|
Obsoletes: %{name}-data < %{version}
|
|
|
|
Provides: %{name}-data = %{version}
|
|
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%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 either
|
|
|
|
the original data from the game or install the recommend subackages OpenGFX for
|
|
|
|
free graphics, OpenSFX for free sounds and OpenMSX for free music.
|
|
|
|
|
|
|
|
OpenTTD is licensed under the GNU General Public License version 2.0. For more
|
2019-10-28 22:23:30 +00:00
|
|
|
information, see the file 'COPYING.md' included with every release and source
|
2012-02-11 19:25:53 +00:00
|
|
|
download of the game.
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%package gui
|
|
|
|
Summary: OpenTTD GUI/Client (requires SDL)
|
|
|
|
Group: Amusements/Games/Strategy/Other
|
|
|
|
|
|
|
|
Requires: %{name}
|
|
|
|
Conflicts: %{name}-dedicated
|
|
|
|
|
2019-09-19 15:18:50 +00:00
|
|
|
BuildRequires: SDL2-devel
|
2012-02-11 19:25:53 +00:00
|
|
|
BuildRequires: fontconfig-devel
|
|
|
|
|
|
|
|
%if 0%{?rhel_version} != 600
|
2011-03-17 20:47:36 +00:00
|
|
|
BuildRequires: libicu-devel
|
2012-02-11 19:25:53 +00:00
|
|
|
%endif
|
|
|
|
%if 0%{?rhel_version} || 0%{?fedora}
|
2011-03-17 20:47:36 +00:00
|
|
|
BuildRequires: freetype-devel
|
2012-02-11 19:25:53 +00:00
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} || 0%{?mdkversion}
|
2011-03-17 20:47:36 +00:00
|
|
|
BuildRequires: freetype2-devel
|
2012-02-11 19:25:53 +00:00
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version}
|
2011-03-17 20:47:36 +00:00
|
|
|
BuildRequires: update-desktop-files
|
2012-02-11 19:25:53 +00:00
|
|
|
%else
|
|
|
|
BuildRequires: desktop-file-utils
|
|
|
|
Requires: hicolor-icon-theme
|
2009-09-29 20:34:18 +00:00
|
|
|
%endif
|
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%if 0%{?suse_version} || 0%{?mdkversion}
|
2011-03-17 20:47:36 +00:00
|
|
|
Recommends: openttd-openmsx
|
2012-02-11 19:25:53 +00:00
|
|
|
Recommends: openttd-opensfx
|
2009-09-29 20:34:18 +00:00
|
|
|
%endif
|
2008-10-21 12:15:09 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%description gui
|
2008-10-21 12:15:09 +00:00
|
|
|
OpenTTD is a reimplementation of the Microprose game "Transport Tycoon Deluxe"
|
2009-09-29 20:34:18 +00:00
|
|
|
with lots of new features and enhancements. To play the game you need either
|
2011-03-17 20:47:36 +00:00
|
|
|
the original data from the game or install the recommend subackages OpenGFX for
|
|
|
|
free graphics, OpenSFX for free sounds and OpenMSX for free music.
|
2008-03-27 16:09:15 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
This subpackage provides the binary which needs SDL.
|
2008-03-27 16:09:15 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%package dedicated
|
|
|
|
Summary: OpenTTD Dedicated Server binary (without SDL)
|
2011-03-17 20:47:36 +00:00
|
|
|
Group: Amusements/Games/Strategy/Other
|
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
Requires: %{name}
|
|
|
|
Conflicts: %{name}-gui
|
|
|
|
|
|
|
|
%description dedicated
|
2011-03-17 20:47:36 +00:00
|
|
|
OpenTTD is a reimplementation of the Microprose game "Transport Tycoon Deluxe"
|
|
|
|
with lots of new features and enhancements. To play the game you need either
|
|
|
|
the original data from the game or the required package OpenGFX and OpenSFX.
|
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
This subpackage provides the binary without dependency of SDL.
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2008-03-27 16:09:15 +00:00
|
|
|
%prep
|
2011-03-17 20:47:36 +00:00
|
|
|
%setup -qn openttd%{?branch:-%{branch}}-%{srcver}
|
|
|
|
|
|
|
|
# we build the grfs from sources but validate the result with the existing data
|
2012-02-11 19:25:53 +00:00
|
|
|
%if 0%{?with_grfcodec}
|
|
|
|
md5sum bin/data/* > validate.data
|
|
|
|
%endif
|
2008-03-27 16:09:15 +00:00
|
|
|
|
|
|
|
%build
|
2012-02-11 19:25:53 +00:00
|
|
|
# first, we build the dedicated binary and copy it to dedicated/
|
2008-10-21 12:15:09 +00:00
|
|
|
./configure \
|
2011-03-17 20:47:36 +00:00
|
|
|
--prefix-dir="%{_prefix}" \
|
|
|
|
--binary-dir="bin" \
|
2012-02-11 19:25:53 +00:00
|
|
|
--data-dir="share/%{name}" \
|
|
|
|
--enable-dedicated
|
|
|
|
make %{?_smp_mflags} BUNDLE_DIR="dedicated" bundle
|
|
|
|
|
|
|
|
# then, we build the common gui version which we install the usual way
|
|
|
|
./configure \
|
|
|
|
--prefix-dir="%{_prefix}" \
|
|
|
|
--binary-name="%{name}" \
|
|
|
|
--binary-dir="bin" \
|
|
|
|
--data-dir="share/%{name}" \
|
|
|
|
--doc-dir="share/doc/%{name}" \
|
2011-03-17 20:47:36 +00:00
|
|
|
--menu-name="OpenTTD%{?branch: %{branch}}" \
|
2012-02-11 19:25:53 +00:00
|
|
|
--menu-group="Game;StrategyGame;"
|
2009-08-14 22:27:48 +00:00
|
|
|
|
2008-10-21 12:15:09 +00:00
|
|
|
make %{?_smp_mflags}
|
2008-03-27 16:09:15 +00:00
|
|
|
|
|
|
|
%install
|
2012-02-11 19:25:53 +00:00
|
|
|
# install the dedicated binary
|
|
|
|
install -D -m0755 dedicated/openttd %{buildroot}%{_bindir}/%{name}-dedicated
|
|
|
|
# install the gui binary and rename to openttd-gui
|
|
|
|
make install INSTALL_DIR=%{buildroot}
|
|
|
|
mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}-gui
|
|
|
|
# we need a dummy target for /etc/alternatives/openttd
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
|
|
|
touch %{buildroot}%{_sysconfdir}/alternatives/%{name}
|
|
|
|
ln -s -f /etc/alternatives/%{name} %{buildroot}%{_bindir}/%{name}
|
|
|
|
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
%suse_update_desktop_file -r %{name} Game StrategyGame
|
2011-03-17 20:47:36 +00:00
|
|
|
%else
|
2012-02-11 19:25:53 +00:00
|
|
|
%if 0%{?fedora} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
|
|
|
|
desktop-file-install --dir=%{buildroot}%{_datadir}/applications \
|
|
|
|
--add-category=StrategyGame \
|
|
|
|
media/openttd.desktop
|
|
|
|
%endif
|
2009-09-29 20:34:18 +00:00
|
|
|
%endif
|
2008-03-27 16:09:15 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%if 0%{?with_grfcodec}
|
2011-03-17 20:47:36 +00:00
|
|
|
%check
|
|
|
|
md5sum -c validate.data
|
2012-02-11 19:25:53 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%post gui
|
|
|
|
/usr/sbin/update-alternatives --install %{_bindir}/%{name} %{name} %{_bindir}/%{name}-gui 10
|
|
|
|
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
2008-03-27 16:09:15 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%post dedicated
|
|
|
|
/usr/sbin/update-alternatives --install %{_bindir}/%{name} %{name} %{_bindir}/%{name}-dedicated 0
|
|
|
|
|
|
|
|
%preun gui
|
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
/usr/sbin/update-alternatives --remove %{name} %{_bindir}/%{name}-gui
|
|
|
|
fi
|
|
|
|
|
|
|
|
%preun dedicated
|
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
/usr/sbin/update-alternatives --remove %{name} %{_bindir}/%{name}-dedicated
|
|
|
|
fi
|
|
|
|
|
|
|
|
%postun gui
|
|
|
|
if [ "$1" -eq 0 ] ; then
|
|
|
|
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
|
|
|
|
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
|
|
|
fi
|
|
|
|
|
|
|
|
%posttrans gui
|
|
|
|
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
|
|
|
|
|
|
|
# we need a file in the main package so it will be made
|
2008-03-27 16:09:15 +00:00
|
|
|
%files
|
2012-02-11 19:25:53 +00:00
|
|
|
%defattr(-, root, root)
|
|
|
|
%dir %{_datadir}/doc/%{name}
|
|
|
|
%dir %{_datadir}/%{name}
|
|
|
|
%dir %{_datadir}/%{name}/lang
|
|
|
|
%dir %{_datadir}/%{name}/baseset
|
|
|
|
%dir %{_datadir}/%{name}/scripts
|
|
|
|
%dir %{_datadir}/%{name}/ai
|
2013-01-06 16:44:15 +00:00
|
|
|
%dir %{_datadir}/%{name}/game
|
2012-02-11 19:25:53 +00:00
|
|
|
%{_datadir}/doc/%{name}/*
|
|
|
|
%{_datadir}/%{name}/lang/*
|
|
|
|
%{_datadir}/%{name}/baseset/*
|
|
|
|
%{_datadir}/%{name}/scripts/*
|
|
|
|
%{_datadir}/%{name}/ai/*
|
2013-01-06 16:44:15 +00:00
|
|
|
%{_datadir}/%{name}/game/*
|
2012-02-11 19:25:53 +00:00
|
|
|
%doc %{_mandir}/man6/%{name}.6.*
|
2011-03-17 20:47:36 +00:00
|
|
|
|
2012-02-11 19:25:53 +00:00
|
|
|
%files gui
|
2011-03-17 20:47:36 +00:00
|
|
|
%defattr(-, root, root)
|
2012-02-11 19:25:53 +00:00
|
|
|
%ghost %{_sysconfdir}/alternatives/%{name}
|
|
|
|
%ghost %{_bindir}/%{name}
|
|
|
|
%{_bindir}/%{name}-gui
|
2011-03-17 20:47:36 +00:00
|
|
|
%dir %{_datadir}/icons/hicolor
|
|
|
|
%dir %{_datadir}/icons/hicolor/16x16
|
|
|
|
%dir %{_datadir}/icons/hicolor/16x16/apps
|
|
|
|
%dir %{_datadir}/icons/hicolor/32x32
|
|
|
|
%dir %{_datadir}/icons/hicolor/32x32/apps
|
|
|
|
%dir %{_datadir}/icons/hicolor/48x48
|
|
|
|
%dir %{_datadir}/icons/hicolor/48x48/apps
|
|
|
|
%dir %{_datadir}/icons/hicolor/64x64
|
|
|
|
%dir %{_datadir}/icons/hicolor/64x64/apps
|
|
|
|
%dir %{_datadir}/icons/hicolor/128x128
|
|
|
|
%dir %{_datadir}/icons/hicolor/128x128/apps
|
|
|
|
%dir %{_datadir}/icons/hicolor/256x256
|
|
|
|
%dir %{_datadir}/icons/hicolor/256x256/apps
|
2012-02-11 19:25:53 +00:00
|
|
|
%{_datadir}/applications/%{name}.desktop
|
|
|
|
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
|
|
|
|
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
|
|
|
|
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
|
|
|
|
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
|
|
|
|
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
|
|
|
|
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
|
|
|
|
%{_datadir}/pixmaps/%{name}.32.xpm
|
|
|
|
|
|
|
|
%files dedicated
|
2011-03-17 20:47:36 +00:00
|
|
|
%defattr(-, root, root)
|
2012-02-11 19:25:53 +00:00
|
|
|
%ghost %{_bindir}/%{name}
|
|
|
|
%ghost %{_sysconfdir}/alternatives/%{name}
|
|
|
|
%{_bindir}/%{name}-dedicated
|
2008-10-21 12:15:09 +00:00
|
|
|
|
|
|
|
%changelog
|