--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_boost_iostreams.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_IOSTREAMS
+#
+# DESCRIPTION
+#
+# Test for IOStreams library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_IOSTREAMS_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_IOSTREAMS
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 20
+
+AC_DEFUN([AX_BOOST_IOSTREAMS],
+[
+ AC_ARG_WITH([boost-iostreams],
+ AS_HELP_STRING([--with-boost-iostreams@<:@=special-lib@:>@],
+ [use the IOStreams library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-iostreams=boost_iostreams-gcc-mt-d-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_iostreams_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_iostreams_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::IOStreams library is available,
+ ax_cv_boost_iostreams,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/iostreams/filtering_stream.hpp>
+ @%:@include <boost/range/iterator_range.hpp>
+ ]],
+ [[std::string input = "Hello World!";
+ namespace io = boost::iostreams;
+ io::filtering_istream in(boost::make_iterator_range(input));
+ return 0;
+ ]])],
+ ax_cv_boost_iostreams=yes, ax_cv_boost_iostreams=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_iostreams" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_iostreams_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_iostreams*.so* $BOOSTLIBDIR/libboost_iostream*.dylib* $BOOSTLIBDIR/libboost_iostreams*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_iostreams.*\)\.so.*$;\1;' -e 's;^lib\(boost_iostream.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_iostreams.*\)\.a.*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
+ [link_iostreams="no"])
+ done
+ if test "x$link_iostreams" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_iostreams*.dll* $BOOSTLIBDIR/boost_iostreams*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_iostreams.*\)\.dll.*$;\1;' -e 's;^\(boost_iostreams.*\)\.a.*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
+ [link_iostreams="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_iostreams_lib boost_iostreams-$ax_boost_user_iostreams_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
+ [link_iostreams="no"])
+ done
+
+ fi
+ if test "x$ax_lib" = "x"; then
+ AC_MSG_ERROR(Could not find a version of the library!)
+ fi
+ if test "x$link_iostreams" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
+++ /dev/null
---- vcmi-0.89/Global.h~ 2012-05-27 21:06:35.000000000 +0200
-+++ vcmi-0.89/Global.h 2012-07-11 13:50:38.816526901 +0200
-@@ -50,7 +50,7 @@
- #include <cstdlib>\r
- \r
- //filesystem version 3 causes problems (and it's default as of boost 1.46)\r
--#define BOOST_FILESYSTEM_VERSION 2\r
-+#define BOOST_FILESYSTEM_VERSION 3\r
- \r
- #include <boost/algorithm/string.hpp>\r
- #include <boost/assert.hpp>\r
---- vcmi-0.89/lib/CLodHandler.cpp~ 2012-05-25 13:49:56.000000000 +0200
-+++ vcmi-0.89/lib/CLodHandler.cpp 2012-07-11 13:58:30.506510264 +0200
-@@ -284,7 +284,7 @@
- if (boost::filesystem::is_directory(dir->status()))\r
- {\r
- path.resize(dir.level()+1);\r
-- path.back() = dir->path().leaf();\r
-+ path.back() = dir->path().filename().string();\r
- }\r
- if(boost::filesystem::is_regular(dir->status()))\r
- {\r
-@@ -294,7 +294,7 @@
- for (size_t i=0; i<dir.level() && i<path.size(); i++)\r
- e.realName += path[i] + '/';\r
- \r
-- e.realName += dir->path().leaf();\r
-+ e.realName += dir->path().filename().string();\r
- \r
- initEntry(e, e.realName);\r
- \r
---- vcmi-0.89/client/CPlayerInterface.cpp~ 2012-05-20 00:57:24.000000000 +0200
-+++ vcmi-0.89/client/CPlayerInterface.cpp 2012-07-11 14:01:17.689846035 +0200
-@@ -1567,7 +1567,7 @@
- {\r
- if(is_regular(dir->status()))\r
- {\r
-- std::string name = dir->path().leaf();\r
-+ std::string name = dir->path().filename().string();\r
- if(starts_with(name, namePrefix) && ends_with(name, ".vlgm1"))\r
- {\r
- char nr = name[namePrefix.size()];\r
---- vcmi-0.89/Scripting/ERM/ERMInterpreter.cpp~ 2012-02-16 18:10:58.000000000 +0100
-+++ vcmi-0.89/Scripting/ERM/ERMInterpreter.cpp 2012-07-11 14:04:08.642118903 +0200
-@@ -376,7 +376,7 @@
- {\r
- if(is_regular(dir->status()))\r
- {\r
-- std::string name = dir->path().leaf();\r
-+ std::string name = dir->path().filename().string();\r
- if( boost::algorithm::ends_with(name, ".erm") ||\r
- boost::algorithm::ends_with(name, ".verm") )\r
- {\r
--- /dev/null
+--- vcmi-0.90/configure.ac~ 2012-10-05 20:04:31.000000000 +0200
++++ vcmi-0.90/configure.ac 2012-11-13 21:14:33.852942118 +0100
+@@ -50,6 +50,7 @@
+ AX_BOOST_BASE([1.36])
+ AX_BOOST_SYSTEM
+ AX_BOOST_FILESYSTEM
++AX_BOOST_IOSTREAMS
+ AX_BOOST_THREAD
+ AX_BOOST_PROGRAM_OPTIONS
+
Summary: Heroes 3: WoG recreated
Name: vcmi
-Version: 0.89
-Release: 4
+Version: 0.90
+Release: 1
License: GPL v2+
Group: X11/Applications/Games
-Source0: http://dl.dropbox.com/u/22372764/vcmi/packages/%{name}_%{version}.tar.gz
-# Source0-md5: 3f67cabb2b395f933b0e14c412e0f0f9
-Source1: http://download.vcmi.eu/%{name}-data_%{version}.tar.gz
-# Source1-md5: e6018250e5363c440c5dcbf2492eda24
-Patch0: boost-1.50.patch
+Source0: http://download.vcmi.eu/%{name}_%{version}.tar.gz
+# Source0-md5: ab6772d9b8010925e6c00847b7c63c0d
+Source1: http://download.vcmi.eu/core.zip
+# Source1-md5: 5cf75d588cc53b93aceb809a6068ae37
+Source2: ax_boost_iostreams.m4
+Patch0: boost-build.patch
URL: http://www.vcmi.eu/
BuildRequires: SDL-devel
BuildRequires: SDL_image-devel
BuildRequires: SDL_mixer-devel
BuildRequires: SDL_ttf-devel
-#BuildRequires: autoconf >= 2.68
-#BuildRequires: automake >= 1.11
+BuildRequires: autoconf >= 2.68
+BuildRequires: automake >= 1.11
BuildRequires: boost-devel
BuildRequires: ffmpeg-devel
BuildRequires: zlib-devel
H3 engine rewrie (not another mod) with new possibilities.
%prep
-%setup
+%setup -q
%patch0 -p1
+cp %{SOURCE2} aclocal/m4
%build
-export CXXFLAGSc="%{rpmcflags}"
+%{__aclocal} -I aclocal/m4
+%{__autoconf}
+%{__automake}
+export CXXFLAGS="%{rpmcflags}"
%configure
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/{Data,Maps,Mp3,Sprites,config}
+install -d $RPM_BUILD_ROOT%{_datadir}/%{name} \
+ $RPM_BUILD_ROOT%{_pixmapsdir} \
+ $RPM_BUILD_ROOT%{_iconsdir}/hicolor/{64x64,48x48,32x32}/apps
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+install client/icons/vcmiclient.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/vcmiclient.xpm
+install client/icons/vcmiclient.64x64.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/64x64/apps/vcmiclient.png
+install client/icons/vcmiclient.48x48.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/48x48/apps/vcmiclient.png
+install client/icons/vcmiclient.32x32.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/32x32/apps/vcmiclient.png
+
%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/AI/*.la
%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}{/Scripting,}/*.{la,so}
-%{__tar} zxf %{SOURCE1} -C $RPM_BUILD_ROOT%{_datadir}/%{name}
+%{__unzip} %{SOURCE1} -d $RPM_BUILD_ROOT%{_datadir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %ghost %{_libdir}/%{name}/Scripting/lib*.so.?
%{_datadir}/%{name}
%{_desktopdir}/%{name}client.desktop
-%{_iconsdir}/%{name}client.png
+%{_pixmapsdir}/%{name}client.xpm
+%{_iconsdir}/hicolor/*x*/apps/%{name}client.png