public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/opencv] opencv5: use cmake build system, autotools one being deprecated by upstream
Date: Fri, 28 Aug 2026 13:29:49 GMT	[thread overview]
Message-ID: <178792378980.1.13272692963297635697.rpms-opencv-ad88918fc1fd@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/opencv
Branch : opencv5
Commit : ad88918fc1fd1213ebf389567f43bfe46e9bd697
Author : Haïkel Guémar <hguemar@fedoraproject.org>
Date   : 2010-02-27T13:08:49+00:00
Stats  : +227/-35 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/opencv/c/ad88918fc1fd1213ebf389567f43bfe46e9bd697?branch=opencv5

Log:
use cmake build system, autotools one being deprecated by upstream

---
diff --git a/opencv-cmake-libdir.patch b/opencv-cmake-libdir.patch
new file mode 100644
index 0000000..f0d6b1b
--- /dev/null
+++ b/opencv-cmake-libdir.patch
@@ -0,0 +1,163 @@
+diff -Naur OpenCV-2.0.0.orig/3rdparty/flann/CMakeLists.txt OpenCV-2.0.0/3rdparty/flann/CMakeLists.txt
+--- OpenCV-2.0.0.orig/3rdparty/flann/CMakeLists.txt	2009-10-01 01:21:00.000000000 +0100
++++ OpenCV-2.0.0/3rdparty/flann/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -86,8 +86,8 @@
+ INSTALL (
+     TARGETS flann flann_s
+     RUNTIME DESTINATION bin
+-    LIBRARY DESTINATION lib
+-    ARCHIVE DESTINATION lib
++    LIBRARY DESTINATION lib${LIB_SUFFIX}
++    ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ )
+ 
+ # INSTALL (
+diff -Naur OpenCV-2.0.0.orig/CMakeLists.txt OpenCV-2.0.0/CMakeLists.txt
+--- OpenCV-2.0.0.orig/CMakeLists.txt	2009-10-01 01:21:05.000000000 +0100
++++ OpenCV-2.0.0/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -405,8 +405,8 @@
+ 
+     string(REGEX MATCH "[0-9].[0-9]" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
+     if(UNIX)
+-        set(PYTHON_PLUGIN_INSTALL_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
+-        set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages)
++        set(PYTHON_PLUGIN_INSTALL_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
++        set(PYTHON_PACKAGES_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages)
+     endif()
+     if(WIN32)
+         get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE CACHE)
+@@ -731,7 +731,7 @@
+ # Set CMAKE_INCLUDE_DIRS_CONFIGCMAKE to the list of include directories:
+ 
+ set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/include/opencv")
+-set(CMAKE_LIB_DIRS_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/lib")
++set(CMAKE_LIB_DIRS_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
+ 
+ #exec_program(${CMAKE_COMMAND} ARGS "-E make_directory \"${CMAKE_BINARY_DIR}/unix-install/\"")
+ exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/unix-install/\"")
+@@ -764,19 +764,19 @@
+ #  Part 2/2: ${BIN_DIR}/unix-install/opencv.pc -> For use *with* "make install"
+ # prefix=/usr
+ # exec_prefix=${prefix}
+-# libdir=${exec_prefix}/lib
++# libdir=${exec_prefix}/lib${LIB_SUFFIX}
+ # includedir=${prefix}/include/opencv
+ # -------------------------------------------------------------------------------------------
+ set(prefix 		${CMAKE_INSTALL_PREFIX})
+ set(exec_prefix		"\${prefix}")
+-set(libdir		"\${exec_prefix}/lib")
++set(libdir		"\${exec_prefix}/lib${LIB_SUFFIX}")
+ set(includedir		"\${prefix}/include")
+ set(VERSION             ${OPENCV_VERSION})
+ 
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/opencv.pc.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/opencv.pc" @ONLY IMMEDIATE)
+ 
+ if(UNIX)
+-    install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION lib/pkgconfig)
++    install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+ endif()
+ 
+ 
+diff -Naur OpenCV-2.0.0.orig/interfaces/ffopencv/CMakeLists.txt OpenCV-2.0.0/interfaces/ffopencv/CMakeLists.txt
+--- OpenCV-2.0.0.orig/interfaces/ffopencv/CMakeLists.txt	2009-10-01 01:20:57.000000000 +0100
++++ OpenCV-2.0.0/interfaces/ffopencv/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -33,5 +33,5 @@
+ 
+ install(TARGETS ${the_target}
+ 	RUNTIME DESTINATION bin COMPONENT main
+-	LIBRARY DESTINATION lib COMPONENT main
++	LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
+     )
+diff -Naur OpenCV-2.0.0.orig/src/cv/CMakeLists.txt OpenCV-2.0.0/src/cv/CMakeLists.txt
+--- OpenCV-2.0.0.orig/src/cv/CMakeLists.txt	2009-10-01 01:20:58.000000000 +0100
++++ OpenCV-2.0.0/src/cv/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -66,8 +66,8 @@
+ 
+ install(TARGETS ${the_target}
+ 	RUNTIME DESTINATION bin COMPONENT main
+-	LIBRARY DESTINATION lib COMPONENT main
+-	ARCHIVE DESTINATION lib COMPONENT main)
++	LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
++	ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
+ 
+ install(FILES ${lib_hdrs}
+     DESTINATION include/opencv
+diff -Naur OpenCV-2.0.0.orig/src/cvaux/CMakeLists.txt OpenCV-2.0.0/src/cvaux/CMakeLists.txt
+--- OpenCV-2.0.0.orig/src/cvaux/CMakeLists.txt	2009-10-01 01:20:59.000000000 +0100
++++ OpenCV-2.0.0/src/cvaux/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -76,8 +76,8 @@
+ 
+ install(TARGETS ${the_target}
+ 	RUNTIME DESTINATION bin COMPONENT main
+-	LIBRARY DESTINATION lib COMPONENT main
+-	ARCHIVE DESTINATION lib COMPONENT main)
++	LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
++	ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
+ 
+ install(FILES ${aux_hdrs_ext}
+         DESTINATION include/opencv
+diff -Naur OpenCV-2.0.0.orig/src/cxcore/CMakeLists.txt OpenCV-2.0.0/src/cxcore/CMakeLists.txt
+--- OpenCV-2.0.0.orig/src/cxcore/CMakeLists.txt	2009-10-01 01:20:59.000000000 +0100
++++ OpenCV-2.0.0/src/cxcore/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -66,8 +66,8 @@
+ 
+ install(TARGETS ${the_target}
+     RUNTIME DESTINATION bin COMPONENT main
+-	LIBRARY DESTINATION lib COMPONENT main
+-	ARCHIVE DESTINATION lib COMPONENT main)
++	LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
++	ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
+ 
+ # install each module headers separately
+ install(FILES ${lib_hdrs}
+diff -Naur OpenCV-2.0.0.orig/src/highgui/CMakeLists.txt OpenCV-2.0.0/src/highgui/CMakeLists.txt
+--- OpenCV-2.0.0.orig/src/highgui/CMakeLists.txt	2009-10-01 01:20:58.000000000 +0100
++++ OpenCV-2.0.0/src/highgui/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -191,8 +191,8 @@
+ if(WIN32)
+ 	target_link_libraries(${the_target} comctl32 gdi32 ole32)
+ 	
+-	if (MSVC)
+-		target_link_libraries(${the_target} vfw32)
++	if (MSVC)
++		target_link_libraries(${the_target} vfw32)
+ 	endif()
+ 
+ 	if(MINGW)
+@@ -206,8 +206,8 @@
+ 
+ install(TARGETS ${the_target}
+ 	RUNTIME DESTINATION bin COMPONENT main
+-	LIBRARY DESTINATION lib COMPONENT main
+-	ARCHIVE DESTINATION lib COMPONENT main)
++	LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
++	ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
+ 
+ install(FILES ${highgui_ext_hdrs}
+         DESTINATION include/opencv
+diff -Naur OpenCV-2.0.0.orig/src/ml/CMakeLists.txt OpenCV-2.0.0/src/ml/CMakeLists.txt
+--- OpenCV-2.0.0.orig/src/ml/CMakeLists.txt	2009-10-01 01:20:59.000000000 +0100
++++ OpenCV-2.0.0/src/ml/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -61,8 +61,8 @@
+ 
+ install(TARGETS ${the_target}
+ 	RUNTIME DESTINATION bin COMPONENT main
+-	LIBRARY DESTINATION lib COMPONENT main
+-	ARCHIVE DESTINATION lib COMPONENT main)
++	LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
++	ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
+ 
+ install(FILES ${lib_hdrs}
+         DESTINATION include/opencv
+diff -Naur OpenCV-2.0.0.orig/tests/cxts/CMakeLists.txt OpenCV-2.0.0/tests/cxts/CMakeLists.txt
+--- OpenCV-2.0.0.orig/tests/cxts/CMakeLists.txt	2009-10-01 01:20:56.000000000 +0100
++++ OpenCV-2.0.0/tests/cxts/CMakeLists.txt	2010-02-25 23:10:44.000000000 +0100
+@@ -63,6 +63,6 @@
+ if(WIN32)
+ install(TARGETS ${the_target}
+     RUNTIME DESTINATION bin COMPONENT main
+-	LIBRARY DESTINATION lib COMPONENT main
+-	ARCHIVE DESTINATION lib COMPONENT main)
++	LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
++	ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
+ endif()

diff --git a/opencv.spec b/opencv.spec
index 1178351..ed0a0b6 100644
--- a/opencv.spec
+++ b/opencv.spec
@@ -1,10 +1,10 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-%define tar_name OpenCV
+%global tar_name OpenCV
 
 Name:           opencv
 Version:        2.0.0
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        Collection of algorithms for computer vision
 
 Group:          Development/Libraries
@@ -13,11 +13,12 @@ License:        BSD
 URL:            http://opencv.willowgarage.com/wiki/
 Source0:        http://prdownloads.sourceforge.net/opencvlibrary/%{tar_name}-%{version}.tar.bz2
 Source1:        opencv-samples-Makefile
-Patch0:         opencv-2.0.0-data-automake.patch
-Patch1:         opencv-2.0.0-apps-automake.patch
+# Fedora cmake macros define -DLIB_SUFFIX=64 on 64 bits platforms
+Patch0:         opencv-cmake-libdir.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libtool
+BuildRequires:  cmake >= 2.4
 
 BuildRequires:  gtk2-devel
 BuildRequires:  unicap-devel
@@ -32,9 +33,9 @@ BuildRequires:  libpng-devel
 BuildRequires:  libjpeg-devel
 BuildRequires:  libtiff-devel
 BuildRequires:  libtool
-BuildRequires:  swig >= 1.3.24, zlib-devel, pkgconfig
+BuildRequires:  zlib-devel, pkgconfig
 BuildRequires:  python-devel
-BuildRequires:  python-imaging, numpy
+BuildRequires:  python-imaging, numpy, swig >= 1.3.24
 %{?_with_ffmpeg:BuildRequires:  ffmpeg-devel >= 0.4.9}
 %{!?_without_gstreamer:BuildRequires:  gstreamer-devel}
 %{?_with_xine:BuildRequires:  xine-lib-devel}
@@ -54,8 +55,18 @@ Requires:       pkgconfig
 %description devel
 This package contains the OpenCV C/C++ library and header files, as well as
 documentation. It should be installed if you want to develop programs that
-will use the OpenCV library.
+will use the OpenCV library. You should consider installing opencv-devel-docs
+package.
 
+%package devel-docs
+Summary:        Development files for using the OpenCV library
+Group:          Development/Libraries
+Requires:       opencv-devel = %{version}-%{release}
+Requires:       pkgconfig
+BuildArch:      noarch
+
+%description devel-docs
+This package contains the OpenCV documentation and examples programs.
 
 %package python
 Summary:        Python bindings for apps which use OpenCV
@@ -70,10 +81,7 @@ This package contains Python bindings for the OpenCV library.
 
 %prep
 %setup -q -n %{tar_name}-%{version}
-%patch0 -p1 -b .automake
-%patch1 -p1 -b .automake
-#Renew the autotools (and remove rpath).
-autoreconf -vif
+%patch0 -p1
 
 %build
 
@@ -81,18 +89,20 @@ autoreconf -vif
 export CXXFLAGS="%{__global_cflags} -m32 -fasynchronous-unwind-tables"
 %endif
 
-export SWIG_PYTHON_LIBS=%{_libdir}
-%configure --disable-static --enable-apps \
-  %{?_with_ffmpeg:--with-ffmpeg}%{!?_with_ffmpeg:--without-ffmpeg} \
-  %{!?_without_gstreamer:--with-gstreamer} \
-  %{?_with_xine:--with-xine --without-quicktime} \
-  --with-unicap \
-  --with-1394libs --without-quicktime \
-%ifarch i386 i586
-  --disable-sse2 \
-%endif
 
-make %{?_smp_mflags}
+# enabled by default if libraries are presents at build time:
+# GTK, GSTREAMER, UNICAP, 1394, V4L
+# non available on Fedora: FFMPEG, XINE
+%cmake -DENABLE_OPENMP=1\
+ %{?_without_gstreamer:-DWITH_GSTREAMER=0} \
+ %{!?_with_ffmpeg:-DWITH_FFMPEG=0} \
+ %{!?_with_xine:-DWITH_XINE=0} \
+ -DBUILD_SWIG_PYTHON_SUPPORT=1 \
+ -DINSTALL_C_EXAMPLES=1 \
+ -DINSTALL_PYTHON_EXAMPLES=1 \
+.
+make VERBOSE=1 %{?_smp_mflags}
+
 
 
 %install
@@ -106,16 +116,19 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/samples/c/build_all.sh \
       $RPM_BUILD_ROOT%{_datadir}/%{name}/samples/c/facedetect.cmd
 install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/samples/c/GNUmakefile
 install -m644 cvconfig.h $RPM_BUILD_ROOT%{_includedir}/%{name}/cvconfig.h
+mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/
+# install documentation
+install -m644 doc/%{name}.pdf $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/%{name}.pdf
+install -m644 doc/*.{htm,png,jpg} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/
 
-#Remove unversioned documentation
-rm -rf $RPM_BUILD_ROOT%{_docdir}/opencv
-#And Octave since we don't build against it yet
-rm -rf $RPM_BUILD_ROOT%{_datadir}/opencv/{samples/octave/,ChangeLog,THANKS}
-
+# fix dos end of lines
+sed -i 's|\r||g'  $RPM_BUILD_ROOT/%{_datadir}/%{name}/samples/c/adaptiveskindetector.cpp
+# remove unnecessary documentation
+rm -rf $RPM_BUILD_ROOT%{_datadir}/opencv/{doc/,samples/octave/}
 
 %check
-#Check fails since we don't support most video
-#read/write capability and we don't provide a display
+# Check fails since we don't support most video
+# read/write capability and we don't provide a display
 %ifnarch ppc64
     make check || :
 %endif
@@ -132,12 +145,11 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(-,root,root,-)
 %doc AUTHORS ChangeLog COPYING THANKS TODO
-%{_bindir}/opencv-*
+%{_bindir}/opencv_*
 %{_libdir}/lib*.so.*
 %dir %{_datadir}/opencv
 %{_datadir}/opencv/haarcascades
 %{_datadir}/opencv/lbpcascades
-%{_datadir}/opencv/readme.txt
 
 
 %files devel
@@ -145,20 +157,37 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/opencv
 %{_libdir}/lib*.so
 %{_libdir}/pkgconfig/opencv.pc
+%{_datadir}/opencv/OpenCVConfig.cmake
+
+%files devel-docs
+%defattr(-,root,root,-)
 %doc %{_datadir}/doc/opencv-2.0.0/
 %doc %dir %{_datadir}/opencv/samples
 %doc %{_datadir}/opencv/samples/c
-%doc %{_datadir}/opencv/samples/CMake
-
+%doc %{_docdir}/%{name}-doc-%{version}/%{name}.pdf
+%doc %{_docdir}/%{name}-doc-%{version}/*.htm
+%doc %{_docdir}/%{name}-doc-%{version}/%{name}.jpg
+%doc %{_docdir}/%{name}-doc-%{version}/%{name}-logo*.png
 
 %files python
 %defattr(-,root,root,-)
-%{python_sitearch}/opencv
+%{python_sitearch}/cv.so
 %doc %dir %{_datadir}/opencv/samples
 %doc %{_datadir}/opencv/samples/python
+# old SWIG wrappers
+%{python_sitearch}/opencv
 
 
 %changelog
+* Thu Feb 25 2010 Haïkel Guémar <karlthered@gmail.com> - 2.0.0-6
+- use cmake build system
+- applications renamed to opencv_xxx instead of opencv-xxx
+- add devel-docs subpackage #546605
+- add OpenCVConfig.cmake
+- enable openmp build
+- enable old SWIG based python wrappers
+- opencv package is a good boy and use global instead of define
+
 * Tue Feb 16 2010 Karel Klic <kklic@redhat.com> - 2.0.0-5
 - Set CXXFLAXS without -match=i386 for i386 architecture #565074
 
@@ -169,7 +198,7 @@ rm -rf $RPM_BUILD_ROOT
 - Fixed spec file issues detected by rpmlint
 
 * Sun Dec 06 2009 Haïkel Guémar <karlthered@gmail.com> - 2.0.0-2
-- Fix autotools scripts (missing LBP features) - #544167 
+- Fix autotools scripts (missing LBP features) - #544167
 
 * Fri Nov 27 2009 Haïkel Guémar <karlthered@gmail.com> - 2.0.0-1
 - Updated to 2.0.0

                 reply	other threads:[~2026-08-28 13:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178792378980.1.13272692963297635697.rpms-opencv-ad88918fc1fd@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox