[opencv] - -devel: include OpenCVConfig.cmake (#627359)

Rex Dieter rdieter at fedoraproject.org
Thu Aug 26 13:58:05 UTC 2010


commit cf8779e12ad5a4841dc9b7cd13d1f894b6e21ad9
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Thu Aug 26 09:03:10 2010 -0500

    - -devel: include OpenCVConfig.cmake (#627359)

 opencv-2.1.0-opencvconfig.patch |   23 +++++++++++++++++++++++
 opencv.spec                     |   17 ++++++++++++-----
 2 files changed, 35 insertions(+), 5 deletions(-)
---
diff --git a/opencv-2.1.0-opencvconfig.patch b/opencv-2.1.0-opencvconfig.patch
new file mode 100644
index 0000000..c7b044e
--- /dev/null
+++ b/opencv-2.1.0-opencvconfig.patch
@@ -0,0 +1,23 @@
+diff -up OpenCV-2.1.0/CMakeLists.txt.opencvconfig OpenCV-2.1.0/CMakeLists.txt
+--- OpenCV-2.1.0/CMakeLists.txt.opencvconfig	2010-08-26 08:26:56.403276842 -0500
++++ OpenCV-2.1.0/CMakeLists.txt	2010-08-26 08:31:20.543277559 -0500
+@@ -38,7 +38,7 @@ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEB
+ 
+ project(OpenCV)
+ 
+-cmake_minimum_required(VERSION 2.4)
++cmake_minimum_required(VERSION 2.6.3)
+ 
+ if(MSVC)
+     set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
+@@ -939,8 +939,8 @@ exec_program(mkdir ARGS "-p \"${CMAKE_BI
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
+ 
+ if(UNIX)
+-    # For a command "FIND_PACKAGE(FOO)", CMake will look at the directory /usr/share|lib/FOO/FOOConfig.cmake, so:
+-    install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/opencv/)
++    # For a command "FIND_PACKAGE(FOO)", CMake will look at the directory /usr/share|lib/cmake/FOO/FOOConfig.cmake, so:
++    install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/cmake/opencv/)
+ endif()
+ 
+ # --------------------------------------------------------------------------------------------
diff --git a/opencv.spec b/opencv.spec
index 1c6329d..9f59769 100644
--- a/opencv.spec
+++ b/opencv.spec
@@ -4,7 +4,7 @@
 
 Name:           opencv
 Version:        2.1.0
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Collection of algorithms for computer vision
 
 Group:          Development/Libraries
@@ -18,10 +18,14 @@ Patch0:         opencv-cmake-libdir-2.1.0.patch
 Patch1:         OpenCV-2.1-nointrernal.patch
 Patch2:         OpenCV-2.1-lapack.patch
 Patch3:         OpenCV-2.1-rpath.patch
+# put OpenCVConfig.cmake into %{_libdir}/cmake/opencv/ instead of %{_datadir}/opencv/
+# upstreamable, up's cmake req to 2.6.3 though.  Can do just %{_libdir}/opencv/ without
+# the cmake bump, if that's preferable -- Rex
+Patch4:         opencv-2.1.0-opencvconfig.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libtool
-BuildRequires:  cmake >= 2.4
+BuildRequires:  cmake >= 2.6.3
 BuildRequires:  chrpath
 
 BuildRequires:  gtk2-devel
@@ -94,6 +98,7 @@ This package contains Python bindings for the OpenCV library.
 %patch1 -p1 -b .nointernal
 %patch2 -p1 -b .lapack
 %patch3 -p1 -b .rpath
+%patch4 -p1 -b .opencvconfig
 
 #Remove several bundled libraries.
 rm -rf 3rdparty/lapack
@@ -154,9 +159,6 @@ chmod 0755 $RPM_BUILD_ROOT%{_datadir}/opencv/samples/python/*.py
 chmod 0755 $RPM_BUILD_ROOT%{python_sitearch}/cv.so
 chmod 0755 $RPM_BUILD_ROOT%{python_sitearch}/opencv/*.so
 
-#This file is wrong - not redistributed
-rm -rf $RPM_BUILD_ROOT%{_datadir}/opencv/OpenCVConfig.cmake
-
 # Remove Rpath in python shared objects:
 find $RPM_BUILD_ROOT%{python_sitearch} -name "*.so" -exec chrpath -d {} ';'
 
@@ -195,6 +197,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/opencv
 %{_libdir}/lib*.so
 %{_libdir}/pkgconfig/opencv.pc
+# own cmake dir avoiding dep on cmake
+%{_libdir}/cmake/
 
 
 %files devel-docs
@@ -211,6 +215,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Wed Aug 25 2010 Rex Dieter <rdieter at fedoraproject.org> - 2.1.0-5
+- -devel: include OpenCVConfig.cmake (#627359)
+
 * Thu Jul 22 2010 Dan Horák <dan[at]danny.cz> - 2.1.0-4
 - TBB is available only on x86/x86_64 and ia64
 


More information about the scm-commits mailing list