--- /dev/null
+--- cmake-2.4.10/Modules/KDE3Macros.cmake.orig 2012-11-03 08:29:52.205394821 +0100
++++ cmake-2.4.10/Modules/KDE3Macros.cmake 2012-11-03 08:31:27.108749182 +0100
+@@ -336,7 +336,7 @@
+ file(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\nshouldnotlink=yes\n")
+ file(APPEND ${_laname} "# Files to dlopen/dlpreopen\ndlopen=''\ndlpreopen=''\n")
+ file(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
+- file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n")
++ file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/libx32/kde3'\n")
+
+ install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname})
+ endmacro()
+--- cmake-3.1.0/Modules/FindZLIB.cmake~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Modules/FindZLIB.cmake 2014-12-24 21:00:27.139263296 +0000
+@@ -79,7 +79,7 @@
+ # Try each search configuration.
+ foreach(search ${_ZLIB_SEARCHES})
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+- find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
++ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES libx32)
+ endforeach()
+
+ mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+--- cmake-3.1.0/Source/cmFindLibraryCommand.cxx~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmFindLibraryCommand.cxx 2014-12-24 21:33:33.561835255 +0000
+@@ -65,6 +65,16 @@
+ }
+ }
+
++ if(this->Makefile->GetCMakeInstance()
++ ->GetPropertyAsBool("FIND_LIBRARY_USE_LIBX32_PATHS"))
++ {
++ // add special 64 bit paths if this is a 64 bit compile.
++ if(this->Makefile->PlatformIsx32Bit())
++ {
++ this->AddArchitecturePaths("x32");
++ }
++ }
++
+ std::string library = this->FindLibrary();
+ if(library != "")
+ {
+--- cmake-3.1.0/Source/cmFindPackageCommand.cxx.orig 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmFindPackageCommand.cxx 2014-12-24 21:35:01.094694382 +0000
+@@ -90,6 +90,14 @@
+ this->UseLib64Paths = true;
+ }
+
++ // Lookup whether libx32 paths should be used.
++ if(this->Makefile->PlatformIsx32Bit() &&
++ this->Makefile->GetCMakeInstance()
++ ->GetPropertyAsBool("FIND_LIBRARY_USE_LIBX32_PATHS"))
++ {
++ this->UseLibx32Paths = true;
++ }
++
+ // Check if User Package Registry should be disabled
+ if(this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY"))
+ {
+--- cmake-3.1.0/Source/cmMakefile.cxx~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmMakefile.cxx 2014-12-24 21:50:15.543073723 +0000
+@@ -2370,6 +2370,15 @@
+ return false;
+ }
+
++bool cmMakefile::PlatformIsx32Bit() const
++{
++#ifdef __ILP32__
++ return true;
++#else
++ return false;
++#endif
++}
++
+ const char* cmMakefile::GetSONameFlag(const std::string& language) const
+ {
+ std::string name = "CMAKE_SHARED_LIBRARY_SONAME";
+--- cmake-3.1.0/Source/cmMakefile.h~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmMakefile.h 2014-12-24 21:51:51.335888102 +0000
+@@ -648,6 +648,8 @@
+
+ /** Return whether the target platform is 64-bit. */
+ bool PlatformIs64Bit() const;
++ /** Return whether the target platform is x32-bit. */
++ bool PlatformIsx32Bit() const;
+
+ /** Retrieve soname flag for the specified language if supported */
+ const char* GetSONameFlag(const std::string& language) const;
+--- cmake-3.1.0/Source/cmFindPackageCommand.h~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Source/cmFindPackageCommand.h 2014-12-24 22:05:38.051409399 +0000
+@@ -124,6 +124,7 @@
+ bool NoBuilds;
+ bool DebugMode;
+ bool UseLib64Paths;
++ bool UseLibx32Paths;
+ bool PolicyScope;
+ std::string LibraryArchitecture;
+ std::vector<std::string> Names;
+--- cmake-3.1.0/Modules/Platform/UnixPaths.cmake~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Modules/Platform/UnixPaths.cmake 2014-12-24 22:14:56.025053263 +0000
+@@ -95,3 +95,4 @@
+
+ # Enable use of lib64 search path variants by default.
+ set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
++set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE)
+--- cmake-3.1.0/Modules/FindPkgConfig.cmake~ 2014-12-15 20:07:43.000000000 +0000
++++ cmake-3.1.0/Modules/FindPkgConfig.cmake 2014-12-24 22:17:04.721022724 +0000
+@@ -241,6 +241,10 @@
+ list(APPEND _lib_dirs "lib64/pkgconfig")
+ endif()
+ endif()
++ get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
++ if(uselibx32)
++ list(APPEND _lib_dirs "libx32/pkgconfig")
++ endif()
+ endif()
+ list(APPEND _lib_dirs "lib/pkgconfig")
+
%bcond_with bootstrap # use internal versions of some libraries
%bcond_without gui # don't build gui package
%bcond_without tests # do not perform "make test"
+%bcond_without doc # don't build documentation
Summary: Cross-platform, open-source make system
Summary(pl.UTF-8): Wieloplatformowy system make o otwartych źródłach
Patch4: %{name}-bug-0015258.patch
Patch5: %{name}-findruby2.patch
Patch6: %{name}-findpython.patch
+Patch7: %{name}-libx32.patch
URL: http://www.cmake.org/
%{?with_gui:BuildRequires: QtGui-devel}
BuildRequires: libarchive-devel
%{?with_gui:BuildRequires: qt4-build}
%{?with_gui:BuildRequires: qt4-qmake}
BuildRequires: rpmbuild(macros) >= 1.167
-BuildRequires: sphinx-pdg
+%{?with_doc:BuildRequires: sphinx-pdg}
%{!?with_bootstrap:BuildRequires: xmlrpc-c-devel >= 1.4.12-2}
Requires: filesystem >= 3.0-52
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%patch4 -p1
%patch5 -p1
%patch6 -p1
+%if "%{_lib}" == "libx32"
+%patch7 -p1
+%endif
cat > "init.cmake" <<EOF
SET (CURSES_INCLUDE_PATH "/usr/include/ncurses" CACHE PATH " " FORCE)
%{!?with_bootstrap:--system-libs} \
%{?with_gui:--qt-gui} \
--qt-qmake=/usr/bin/qmake-qt4 \
- --sphinx-html \
- --sphinx-man \
+ %{?with_doc:--sphinx-html} \
+ %{?with_doc:--sphinx-man} \
--verbose
%{__make} VERBOSE=1
%attr(755,root,root) %{_bindir}/cmake
%attr(755,root,root) %{_bindir}/cpack
%attr(755,root,root) %{_bindir}/ctest
+%if %{with doc}
%{_mandir}/man1/ccmake.1*
%{_mandir}/man1/cmake.1*
%{_mandir}/man1/cpack.1*
%{_mandir}/man7/cmake-qt.7*
%{_mandir}/man7/cmake-toolchains.7*
%{_mandir}/man7/cmake-variables.7*
+%endif
# top cmake/Modules dirs belong to filesystem
%{_datadir}/cmake/Modules/.NoDartCoverage
%{_datadir}/cmake/Modules/*
%{_datadir}/cmake/include
%{_aclocaldir}/cmake.m4
+%if %{with doc}
%files doc-html
%defattr(644,root,root,755)
%doc Utilities/Sphinx/html/*
+%endif
%if %{with gui}
%files gui