From 3f0c225880a97d68044af5fe0127b1818cd21971 Mon Sep 17 00:00:00 2001 From: beegee1 Date: Sat, 6 Oct 2012 16:09:20 +0000 Subject: [PATCH] * Fixed building, installing on Fedora * Updated RPM spec --- CMakeLists.txt | 9 +++++++- cmake_modules/FindFFMPEG_swscale.cmake | 5 ++-- rpm/vcmi.spec | 32 ++++++++++++++------------ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb6822ada..f076a0c18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,8 +48,11 @@ if(WIN32) # on Win everything goes into H3 root directory set(LIB_DIR "" CACHE STRING "Where to install main library") set(DATA_DIR "" CACHE STRING "Where to install data files") else() + # includes lib path which determines where to install shared libraries (either /lib or /lib64) + include(GNUInstallDirs) + set(BIN_DIR "bin" CACHE STRING "Where to install binaries") - set(LIB_DIR "lib/vcmi" CACHE STRING "Where to install main library") + set(LIB_DIR "${CMAKE_INSTALL_LIBDIR}/vcmi" CACHE STRING "Where to install main library") set(DATA_DIR "share/vcmi" CACHE STRING "Where to install data files") endif() @@ -61,6 +64,10 @@ add_definitions(-DM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_DIR}") add_definitions(-DM_BIN_DIR="${CMAKE_INSTALL_PREFIX}/${BIN_DIR}") add_definitions(-DM_LIB_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}") +# remain full RPATH when installing (needed to find shared libraries) +SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/vcmi") +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + add_subdirectory(lib) add_subdirectory(client) add_subdirectory(server) diff --git a/cmake_modules/FindFFMPEG_swscale.cmake b/cmake_modules/FindFFMPEG_swscale.cmake index 0f8cb2839..6cd23ef30 100644 --- a/cmake_modules/FindFFMPEG_swscale.cmake +++ b/cmake_modules/FindFFMPEG_swscale.cmake @@ -4,9 +4,8 @@ # FFMPEG_INCLUDE_DIR # FFMPEG_LIBRARIES -FIND_PATH( FFMPEG_INCLUDE_DIR NAMES ffmpeg/avcodec.h libavcodec/avcodec.h - /usr/include - /usr/local/include +FIND_PATH( FFMPEG_INCLUDE_DIR NAMES libavcodec/avcodec.h ffmpeg/avcodec.h + PATHS /usr/include /usr/local/include /usr/include/ffmpeg ) IF( FFMPEG_INCLUDE_DIR ) diff --git a/rpm/vcmi.spec b/rpm/vcmi.spec index 80829d12d..345c906a0 100644 --- a/rpm/vcmi.spec +++ b/rpm/vcmi.spec @@ -1,29 +1,29 @@ Summary: VCMI is an open-source project aiming to reimplement HMM3:WoG game engine, giving it new and extended possibilities. Name: vcmi -Version: 0.89 +Version: 0.9 Release: 1%{?dist} License: GPLv2+ Group: Amusements/Games # The source for this package was pulled from upstream's vcs. Use the # following commands to generate the tarball: -# svn export -r HEAD https://vcmi.svn.sourceforge.net/svnroot/vcmi/tags/0.89 vcmi-0.89-1 -# tar -cJvf vcmi-0.89-1.tar.xz vcmi-0.89-1 -Source: vcmi-0.89-1.tar.xz +# svn export -r HEAD https://vcmi.svn.sourceforge.net/svnroot/vcmi/tags/0.9 vcmi-0.9-1 +# tar -cJf vcmi-0.9-1.tar.xz vcmi-0.9-1 +Source: vcmi-0.9-1.tar.xz URL: http://forum.vcmi.eu/portal.php BuildRequires: gcc-c++ BuildRequires: SDL-devel BuildRequires: SDL_image-devel BuildRequires: SDL_ttf-devel -BuildRequires: SDL_mixer-devel -BuildRequires: boost -BuildRequires: boost-devel -BuildRequires: boost-filesystem -BuildRequires: boost-iostreams -BuildRequires: boost-system -BuildRequires: boost-thread -BuildRequires: boost-program-options +BuildRequires: SDL_mixer-devel >= 1.2.8 +BuildRequires: boost >= 1.44 +BuildRequires: boost-devel >= 1.44 +BuildRequires: boost-filesystem >= 1.44 +BuildRequires: boost-iostreams >= 1.44 +BuildRequires: boost-system >= 1.44 +BuildRequires: boost-thread >= 1.44 +BuildRequires: boost-program-options >= 1.44 BuildRequires: zlib-devel BuildRequires: ffmpeg-devel BuildRequires: ffmpeg-libs @@ -39,13 +39,12 @@ As yet VCMI is not standalone program, it uses Wake of Gods files and graphics. %setup -q -n %{name}-%{version}-1 %build -./configure --datadir=%{_datadir} --bindir=%{_bindir} --libdir=%{_libdir} +cmake -DCMAKE_INSTALL_PREFIX=/usr ./ make %{?_smp_mflags} %install rm -rf %{buildroot} make DESTDIR=%{buildroot} install -mkdir -p %{buildroot}%{_datadir}/%{name}/ %files %doc README README.linux COPYING AUTHORS ChangeLog @@ -53,10 +52,13 @@ mkdir -p %{buildroot}%{_datadir}/%{name}/ %{_bindir}/vcmiserver %{_libdir}/%{name}/* -%dir %{_datadir}/%{name} +%{_datadir}/%{name}/* %{_datadir}/applications/* %{_datadir}/icons/* %changelog +* Sat Oct 06 2012 VCMI - 0.9-1 +- New upstream release + * Sun Jun 08 2012 VCMI - 0.89-1 - Initial version