Hello community,

here is the log from the commit of package lensfun for openSUSE:Factory checked 
in at 2017-07-25 11:39:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lensfun (Old)
 and      /work/SRC/openSUSE:Factory/.lensfun.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lensfun"

Tue Jul 25 11:39:15 2017 rev:43 rq:511601 version:0.3.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/lensfun/lensfun.changes  2016-05-24 
09:34:11.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.lensfun.new/lensfun.changes     2017-07-25 
11:39:21.385151860 +0200
@@ -1,0 +2,24 @@
+Thu Jul 20 06:43:05 UTC 2017 - [email protected]
+
+- Add 0060-Various-CMake-patches-from-the-mailing-list.patch (taken
+  from Fedora) to only enable SSE/SSE2 on x86(_64), and only
+  compile those files with -msse/-msse2 that have specific SSE(2)
+  assembly code that's only used when SSE/SSE2 is actually
+  available on runtime
+- Don't set the BUILD_FOR_SSE(2) compile options at all, they were
+  ON by default and above patch determines them automatically
+  depending on the architecture
+
+-------------------------------------------------------------------
+Mon Jul 17 09:28:51 UTC 2017 - [email protected]
+
+- Drop sse2 conditional, p4 is oldest supported by opensuse anyway
+- Use %cmake macros to produce the package instead of hand
+  written approach
+- Enable tests and add patch lensfun-test-database.patch
+- Add patch lensfun-respect-DESTDIR.patch for py code to respect
+  destdir
+- Split tools to separate subpackage tools
+- Install properly python3 bindings
+
+-------------------------------------------------------------------

New:
----
  0060-Various-CMake-patches-from-the-mailing-list.patch
  lensfun-respect-DESTDIR.patch
  lensfun-test-database.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lensfun.spec ++++++
--- /var/tmp/diff_new_pack.OyypIx/_old  2017-07-25 11:39:21.973068834 +0200
+++ /var/tmp/diff_new_pack.OyypIx/_new  2017-07-25 11:39:21.977068269 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package lensfun
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,27 +16,31 @@
 #
 
 
-Name:           lensfun
 %define sonum   1
+Name:           lensfun
 Version:        0.3.2
 Release:        0
 Summary:        A photographic lens database and a library for accessing it
 License:        LGPL-3.0
 Group:          Development/Libraries/C and C++
 Url:            http://lensfun.sourceforge.net/
-Source:         http://downloads.sf.net/lensfun/lensfun-%version.tar.gz
-
+Source:         http://downloads.sf.net/lensfun/lensfun-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM respect DESTDIR in python call
+Patch0:         lensfun-respect-DESTDIR.patch
+# PATCH-FIX-UPSTREAM use local database when running tests
+Patch1:         lensfun-test-database.patch
+# PATCH-FIX-UPSTREAM 0060-Various-CMake-patches-from-the-mailing-list.patch
+Patch2:         0060-Various-CMake-patches-from-the-mailing-list.patch
 BuildRequires:  cmake
 BuildRequires:  doxygen
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++
 BuildRequires:  libpng-devel
-BuildRequires:  pkg-config
+BuildRequires:  pkgconfig
 BuildRequires:  python3
 BuildRequires:  python3-docutils
 BuildRequires:  zlib-devel
 BuildRequires:  pkgconfig(glib-2.0)
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
 The goal of the lensfun library is to provide a open source database
@@ -87,6 +91,24 @@
 %description -n lib%{name}%{sonum}
 Library files needed by the use the %{name} library/database.
 
+%package -n python3-lensfun
+Summary:        Python3 lensfun bindings
+Group:          Development/Languages/Python
+Requires:       lib%{name}%{sonum} = %{version}
+
+%description -n python3-lensfun
+Lensfun bindings for Python 3
+
+%package tools
+Summary:        Tools for managing %{name} data
+Group:          Development/Tools/Other
+Requires:       %{name}-data
+Requires:       python3-lensfun = %{version}
+
+%description tools
+This package contains tools to fetch lens database updates and manage lens
+adapters in lensfun.
+
 %package doc
 Summary:        Documentation for %{name}
 Group:          Documentation/HTML
@@ -100,7 +122,6 @@
 Group:          Development/Libraries/C and C++
 Requires:       %{name}-data = %{version}
 Requires:       lib%{name}%{sonum} = %{version}
-Recommends:     %{name}-doc = %{version}
 
 %description devel
 Header and library definition files for developing applications
@@ -108,71 +129,72 @@
 
 %prep
 %setup -q
-cd data
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+echo 'HTML_TIMESTAMP=NO' >> docs/doxyfile.in.cmake
+# fix python shebangs
+sed -i \
+    -e "s|^#!/usr/bin/env python3$|#!/usr/bin/python3|g" \
+  apps/lensfun-add-adapter \
+  apps/lensfun-update-data \
+  apps/lensfun/__init__.py.in
 
 %build
-echo 'HTML_TIMESTAMP=NO' >> docs/doxyfile.in.cmake
-# We can count on having SSE2 on x86_64
-# On i%86 it is not save. We could have the sse lib in sse subdirectory in 
addition though.
-# In any case this must be independent of the build host.
-mkdir cmake_build
-cd cmake_build
-cmake ..                        \
+%cmake \
     -DBUILD_STATIC=OFF          \
     -DBUILD_TESTS=ON            \
-    -DBUILD_DOC=on              \
-    -DBUILD_FOR_SSE=off         \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DDOCDIR=%{_defaultdocdir}/%name \
-    -DCMAKE_INSTALL_DOCDIR=%{_defaultdocdir}/%name \
-%if %{_lib} == lib64
-    -DLIB_SUFFIX=64 \
-%endif
-%ifarch x86_64
-    -DBUILD_FOR_SSE2=on
-%else
-    -DBUILD_FOR_SSE2=off
-%endif
+    -DBUILD_DOC=ON \
+    -DDOCDIR=%{_defaultdocdir}/%{name} \
+    -DCMAKE_INSTALL_DOCDIR=%{_defaultdocdir}/%{name} \
+    -DINSTALL_HELPER_SCRIPTS=ON
 make %{?_smp_mflags} lensfun doc
 
 %install
-cd cmake_build
-make AUTODEP=0 DESTDIR=%{?buildroot:%{buildroot}} install
-# fix man path
-# mv %{buildroot}/usr/man %{buildroot}%{_mandir}
+%cmake_install
 # drop test cases, we should run them here instead
-rm -rf %{buildroot}/usr/share/lensfun/tests
+rm -rf %{buildroot}%{_datadir}/lensfun/tests
+# Create udate folder for lensfun data
+mkdir -p %{buildroot}%{_localstatedir}/lib/lensfun-updates
+# Regererate pyc files to not contain %{buildroot}
+%py3_compile %{buildroot}/%{python3_sitelib}/lensfun/
 
 %fdupes %{buildroot}
 
-%post   -n lib%{name}%{sonum} -p /sbin/ldconfig
+%check
+export 
LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+%ctest
 
+%post   -n lib%{name}%{sonum} -p /sbin/ldconfig
 %postun -n lib%{name}%{sonum} -p /sbin/ldconfig
 
 %files doc
-%defattr(-,root,root)
 %doc README.md
 %doc docs/*
-%doc %{_defaultdocdir}/%name
+%doc %{_defaultdocdir}/%{name}
 
 %files data
-%defattr(-,root,root)
 %{_datadir}/%{name}/
+%dir %{_localstatedir}/lib/lensfun-updates/
 
 %files -n lib%{name}%{sonum}
-%defattr(-,root,root)
 %{_libdir}/*.so.*
 
+%files -n python3-lensfun
+%{python3_sitelib}/lensfun/
+%{python3_sitelib}/lensfun*.egg-info
+
 %files devel
-%defattr(-,root,root)
 %{_includedir}/lensfun
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/lensfun.pc
+
+%files tools
 %{_bindir}/g-lensfun-update-data
 %{_bindir}/lensfun-add-adapter
 %{_bindir}/lensfun-update-data
-%{_mandir}/man?/g-lensfun-update-data.*
-%{_mandir}/man?/lensfun-add-adapter.*
-%{_mandir}/man?/lensfun-update-data.*
+%{_mandir}/man?/g-lensfun-update-data*
+%{_mandir}/man?/lensfun-add-adapter*
+%{_mandir}/man?/lensfun-update-data*
 
 %changelog

++++++ 0060-Various-CMake-patches-from-the-mailing-list.patch ++++++
>From bba9aa37c899999fca01101a8ed271a3aa9d82b7 Mon Sep 17 00:00:00 2001
From: Sebastian Kraft <[email protected]>
Date: Sat, 16 Jan 2016 15:42:57 +0100
Subject: [PATCH 060/113] Various CMake patches from the mailing list

- Add GLIB2 libray path to link directories
- Enable -msseX compiler switch for Clang
- Set -mseeX switch only for files with SSE code
- Do not enable SSE optimizations on non-x86 hardware by default
---
 CMakeLists.txt              | 19 +++++++++++++------
 libs/lensfun/CMakeLists.txt |  5 +++++
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21f082b..b85656c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,12 +31,18 @@ IF(NOT HAVE_REGEX_H)
   INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libs/regex)
 ENDIF()
 
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "[XxIi][0-9]?86|[Aa][Mm][Dd]64")
+  SET(X86_ON ON)
+else()
+  SET(X86_ON OFF)
+ENDIF()
+
 # options controlling the build process
 OPTION(BUILD_STATIC "Build static library" OFF)
 OPTION(BUILD_TESTS "Build test suite" OFF)
 OPTION(BUILD_LENSTOOL "Build the lenstool (requires libpng)" OFF)
-OPTION(BUILD_FOR_SSE "Build with support for SSE" ON)
-OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ON)
+OPTION(BUILD_FOR_SSE "Build with support for SSE" ${X86_ON})
+OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ${X86_ON})
 OPTION(BUILD_DOC "Build documentation with doxygen" OFF)
 OPTION(INSTALL_HELPER_SCRIPTS "Install various helper scripts" ON)
 
@@ -62,14 +68,14 @@ ENDIF()
 
 IF(BUILD_FOR_SSE)
   SET(VECTORIZATION_SSE 1)
-  IF(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
+  IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    SET(VECTORIZATION_SSE_FLAGS "-msse")
   ENDIF()
 ENDIF()
 IF(BUILD_FOR_SSE2)
   SET(VECTORIZATION_SSE2 1)
-  IF(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+  IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    SET(VECTORIZATION_SSE2_FLAGS "-msse2")
   ENDIF()
 ENDIF()
 
@@ -91,6 +97,7 @@ ELSE()
 FIND_PACKAGE(GLIB2 REQUIRED 2.40)
 
 INCLUDE_DIRECTORIES(SYSTEM ${GLIB2_INCLUDE_DIRS})
+LINK_DIRECTORIES(${GLIB2_LIBRARY_DIRS})
 
 
 IF(BUILD_STATIC)
diff --git a/libs/lensfun/CMakeLists.txt b/libs/lensfun/CMakeLists.txt
index 6beadec..b0ca638 100644
--- a/libs/lensfun/CMakeLists.txt
+++ b/libs/lensfun/CMakeLists.txt
@@ -9,6 +9,11 @@ IF(WIN32)
   LIST(APPEND LENSFUN_SRC windows/auxfun.cpp)
 ENDIF()
 
+SET_SOURCE_FILES_PROPERTIES(mod-color-sse.cpp mod-coord-sse.cpp
+  PROPERTIES COMPILE_FLAGS "${VECTORIZATION_SSE_FLAGS}")
+SET_SOURCE_FILES_PROPERTIES(mod-color-sse2.cpp
+  PROPERTIES COMPILE_FLAGS "${VECTORIZATION_SSE2_FLAGS}")
+
 IF(BUILD_STATIC)
   ADD_LIBRARY(lensfun STATIC ${LENSFUN_SRC})
 ELSE()
-- 
2.7.4

++++++ lensfun-respect-DESTDIR.patch ++++++
>From 9ec857bb403accc262a9b5a9c2921b5c064fc9c8 Mon Sep 17 00:00:00 2001
From: Sebastian Kraft <[email protected]>
Date: Sat, 9 Jan 2016 20:55:21 +0100
Subject: [PATCH] Patch #47: respect DESTDIR when installing python stuff

---
 apps/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
index 70c77fd..2f6f8f1 100644
--- a/apps/CMakeLists.txt
+++ b/apps/CMakeLists.txt
@@ -42,5 +42,5 @@ IF(PYTHON)
     IF(NOT DEFINED SETUP_PY_INSTALL_PREFIX)
       SET(SETUP_PY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
     ENDIF()
-    INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install 
--prefix=${SETUP_PY_INSTALL_PREFIX})")
+    INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install 
--prefix=\$ENV{DESTDIR}${SETUP_PY_INSTALL_PREFIX})")
 ENDIF(PYTHON)
-- 
2.6.4

++++++ lensfun-test-database.patch ++++++
>From 3f74b78e4ee9f1d400ebbf2b9093a0f9c48c6307 Mon Sep 17 00:00:00 2001
From: Sebastian Kraft <[email protected]>
Date: Sat, 9 Jan 2016 20:48:16 +0100
Subject: [PATCH] Use database in source directory while running tests. Fixes
 bug #46.

---
 tests/CMakeLists.txt    | 4 ++--
 tests/test_database.cpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index b79fda6..4056072 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,6 +1,6 @@
 ADD_EXECUTABLE(test_database test_database.cpp)
 TARGET_LINK_LIBRARIES(test_database lensfun ${COMMON_LIBS})
-ADD_TEST(Database test_database)
+ADD_TEST(NAME Database WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND 
test_database)
 
 ADD_EXECUTABLE(test_modifier test_modifier.cpp)
 TARGET_LINK_LIBRARIES(test_modifier lensfun ${COMMON_LIBS})
@@ -30,4 +30,4 @@ TARGET_LINK_LIBRARIES(test_modifier_coord_geometry lensfun 
${COMMON_LIBS})
 ADD_TEST(Modifier_coord_geometry test_modifier_coord_geometry)
 
 FIND_PACKAGE(PythonInterp REQUIRED)
-ADD_TEST(NAME Database_integrity COMMAND ${PYTHON_EXECUTABLE} 
${CMAKE_SOURCE_DIR}/tools/check_database/check_database.py ../../data/db)
+ADD_TEST(NAME Database_integrity COMMAND ${PYTHON_EXECUTABLE} 
${CMAKE_SOURCE_DIR}/tools/check_database/check_database.py 
${CMAKE_SOURCE_DIR}/data/db)
diff --git a/tests/test_database.cpp b/tests/test_database.cpp
index 45dc38f..49a2644 100644
--- a/tests/test_database.cpp
+++ b/tests/test_database.cpp
@@ -10,7 +10,7 @@ typedef struct {
 void db_setup(lfFixture *lfFix, gconstpointer data)
 {
     lfFix->db = lf_db_new ();
-    lfFix->db->Load();
+    lfFix->db->LoadDirectory("data/db");
 }
 
 
-- 
2.6.4


Reply via email to