[packages/mars] - updated to 0.2.1 - removed obsolete path patch (this version supports installed game) - added inst
qboosh
qboosh at pld-linux.org
Wed Sep 14 15:44:51 CEST 2016
commit 92c190f31685dabb6706fbcfb66cfd61dbc85c33
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Sep 14 15:46:22 2016 +0200
- updated to 0.2.1
- removed obsolete path patch (this version supports installed game)
- added install patch (allow build/install steps separation)
- added opt patch (allow passing CXX and CXXFLAGS)
mars-install.patch | 36 ++++++++++++++++++++++++++++++++++++
mars-opt.patch | 23 +++++++++++++++++++++++
mars-path.patch | 29 -----------------------------
mars.spec | 36 +++++++++++++++++-------------------
4 files changed, 76 insertions(+), 48 deletions(-)
---
diff --git a/mars.spec b/mars.spec
index 1257946..1ea6461 100644
--- a/mars.spec
+++ b/mars.spec
@@ -1,30 +1,26 @@
#
-# TODO:
-# - the game crashes with SDL Parachute deployed error,
-# it doesn't if we install the game and run it from the dir
-# where it was build, so theres probably more to install -
-# find out what it is
-#
# Conditional build:
%bcond_without opengl # build without opengl
#
Summary: Turn based strategy game with isometric graphic
Summary(pl.UTF-8): Turowa gra strategiczna z grafiką izometryczną
Name: mars
-Version: 0.2.0
+Version: 0.2.1
Release: 1
License: GPL v2+
Group: X11/Applications/Games
-Source0: http://dl.sourceforge.net/mars/%{name}-%{version}-src.tar.gz
-# Source0-md5: 4ad8a9009af5947d6e69159eab47a923
-Patch0: %{name}-path.patch
-URL: http://www.marsnomercy.org/
+Source0: http://downloads.sourceforge.net/mars/%{name}-%{version}-src.tar.gz
+# Source0-md5: c86674cd1fd6d0045e43218d929eb391
+Patch0: %{name}-install.patch
+Patch1: %{name}-opt.patch
+URL: http://sourceforge.net/projects/mars/
%{?with_opengl:BuildRequires: OpenGL-devel}
BuildRequires: SDL-devel
BuildRequires: SDL_image-devel
BuildRequires: SDL_ttf-devel
+BuildRequires: libpng-devel
+BuildRequires: libstdc++-devel
BuildRequires: scons
-BuildRequires: sed >= 4.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -43,20 +39,22 @@ Planecie w okresie wczesnej kolonizacji.
%prep
%setup -q
%patch0 -p1
-%{__sed} -i 's at data/@%{_datadir}/%{name}/@' src/{mars.cpp,Functions.cpp}
-%{__sed} -i 's at data/@%{_datadir}/%{name}/@' data/xml/ngg/light.xml
-%{__sed} -i 's at data/@%{_datadir}/%{name}/@' data/xml/player.xml
+%patch1 -p1
%build
-scons \
+%scons \
+ strip=no \
with_opengl=%{?with_opengl:yes}%{!?with_opengl:no}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/%{name}}
+# required by scons
+install -d $RPM_BUILD_ROOT
-install %{name} $RPM_BUILD_ROOT%{_bindir}/
-cp -r data/* $RPM_BUILD_ROOT%{_datadir}/%{name}
+%scons install \
+ strip=no \
+ with_opengl=%{?with_opengl:yes}%{!?with_opengl:no} \
+ root=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
diff --git a/mars-install.patch b/mars-install.patch
new file mode 100644
index 0000000..cf14590
--- /dev/null
+++ b/mars-install.patch
@@ -0,0 +1,36 @@
+--- mars-0.2.1/SConstruct.orig 2006-12-19 01:56:15.000000000 +0100
++++ mars-0.2.1/SConstruct 2016-09-13 20:40:35.967786089 +0200
+@@ -18,17 +18,13 @@
+ # Adding options to the environment
+ env = Environment(options = opts)
+
+-if 'install' in sys.argv:
+- root = ARGUMENTS.get('root', '/')
+- prefix = ARGUMENTS.get('prefix', '/usr/local')
+-
+- if os.path.isabs(prefix):
+- prefix = prefix[1:]
+- bin_dir = os.path.join(root, prefix, 'bin') # WITH fakeroot
+- data_dir = os.path.join('/', prefix, 'share/mars') # WITHOUT fakeroot
+-else:
+- bin_dir = ''
+- data_dir = ''
++prefix = ARGUMENTS.get('prefix', '/usr/local')
++root = ARGUMENTS.get('root', '/')
++if os.path.isabs(prefix):
++ prefix = prefix[1:]
++
++bin_dir = os.path.join('/', prefix, 'bin')
++data_dir = os.path.join('/', prefix, 'share/mars') # WITHOUT fakeroot
+
+
+ # OPTION no_mingw
+@@ -130,6 +126,8 @@
+ # export variables and run sub scripts
+ if data_dir != '': # installation required
+ data_dir = os.path.join(root, prefix, 'share/mars') # WITH fakeroot
++if bin_dir != '':
++ bin_dir = os.path.join(root, prefix, 'bin')
+
+ Export('env', 'opts', 'bin_dir', 'data_dir')
+ SConscript('src/SConscript', build_dir='build', duplicate=0)
diff --git a/mars-opt.patch b/mars-opt.patch
new file mode 100644
index 0000000..19c57cb
--- /dev/null
+++ b/mars-opt.patch
@@ -0,0 +1,23 @@
+--- mars-0.2.1/SConstruct.orig 2016-09-13 21:13:39.837763435 +0200
++++ mars-0.2.1/SConstruct 2016-09-13 21:13:43.601096725 +0200
+@@ -3,6 +3,7 @@
+ # create build environment and options
+ env = Environment()
+ opts = Options()
++vars = Variables()
+
+ # OPTION debug
+ opts.Add(BoolOption('debug', 'Set to yes (or 1) to build for debug', 'no'))
+@@ -15,8 +16,11 @@
+ # OPTION root & prefix
+ opts.Add(PathOption('root', 'Path to the fakeroot directory', '/'))
+ opts.Add(PathOption('prefix', 'Path to prefix to default destinations', '/usr/local'))
++opts.Add(('CXX', 'C++ compiler', 'g++'))
++opts.Add(('CXXFLAGS', 'C++ flags', '-O2'))
+ # Adding options to the environment
+-env = Environment(options = opts)
++env = Environment(options = opts)
++env["CXXFLAGS"] = env["CXXFLAGS"].split()
+
+ prefix = ARGUMENTS.get('prefix', '/usr/local')
+ root = ARGUMENTS.get('root', '/')
diff --git a/mars-path.patch b/mars-path.patch
deleted file mode 100644
index 3cefaa9..0000000
--- a/mars-path.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- mars-0.2.0/src/XmlLoader.cpp~ 2006-11-02 13:10:42.000000001 +0100
-+++ mars-0.2.0/src/XmlLoader.cpp 2006-11-08 02:50:00.000000000 +0100
-@@ -207,7 +207,7 @@
- void XmlLoader::LoadImages(const char *path)
- {
- Image * img;
-- string string_path = path;
-+ string string_path = "/usr/share/mars/img/buildings/NGG/bunker_outpost_1/";
-
- //FIXME temporary solution
-
-@@ -219,7 +219,7 @@
- img = gtracker->GetImage(string_path + "02.png", screen->GetGraphicMode());
- _views.push_back(img);
- // If element has more then 2 images, Unit
-- if(ImageFileExists(string_path + "03.png"))
-+ /*if(ImageFileExists(string_path + "03.png"))
- {
- img = gtracker->GetImage(string_path + "03.png", screen->GetGraphicMode());
- _views.push_back(img);
-@@ -233,7 +233,7 @@
- _views.push_back(img);
- img = gtracker->GetImage(string_path + "08.png", screen->GetGraphicMode());
- _views.push_back(img);
-- }
-+ }*/
- }
- catch(Exception e)
- {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/mars.git/commitdiff/92c190f31685dabb6706fbcfb66cfd61dbc85c33
More information about the pld-cvs-commit
mailing list