Add python3 subpackage (bz# 1482979).

- For Fedora releases, add a python3 subpackage.
- Disable the LEMON compile due to a bug in lemon packaging which
  prevents vigra from successfully finding the library (bz# 1526647).
- Move python shebang fix from a patch file into the spec file to easily
  choose between python 2/3 based on the release being built.
- Remove unused patches.
- Remove legacy _python_sitearch as all supported release now have this
  defined.
- Add conditions for boost-python to allow compiling on releases <= f27.
- Fix the vigra-config docdir to point to the packaged location.
This commit is contained in:
Troy Curtis Jr 2017-12-16 18:56:17 -06:00
parent a5355fb7a7
commit 6b9093cf71
10 changed files with 85 additions and 326 deletions

View File

@ -1,25 +0,0 @@
From 18675a51fca27b324eb4e4b49593bcee9bc4535e Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <jwakely@redhat.com>
Date: Fri, 17 Feb 2017 00:55:25 +0000
Subject: [PATCH] Fix parameter of ImagePyramid::swap
You can't swap with a const object. This fixes a compilation failure
with GCC 7 which rejects the incorrect function even if it isn't
instantiated.
---
include/vigra/imagecontainer.hxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/vigra/imagecontainer.hxx b/include/vigra/imagecontainer.hxx
index a6f0f80..636cc64 100644
--- a/include/vigra/imagecontainer.hxx
+++ b/include/vigra/imagecontainer.hxx
@@ -763,7 +763,7 @@ public:
/** swap contents of this array with the contents of other
(STL-Container interface)
*/
- void swap(const ImagePyramid<ImageType, Alloc> &other)
+ void swap(ImagePyramid<ImageType, Alloc> &other)
{
images_.swap(other.images_);
std::swap(lowestLevel_, other.lowestLevel_);

View File

@ -0,0 +1,8 @@
--- vigra-1.11.1/config/vigra-config.in 2017-12-16 14:34:37.544633998 -0600
+++ vigra-1.11.1/config/vigra-config.in 2017-12-16 14:38:16.297616754 -0600
@@ -93,4 +93,4 @@ if op.include_path: # was: --include_pat
print('@CMAKE_INSTALL_PREFIX@/include')
if op.docdir:
- print('@DOCDIR@')
+ print('@CMAKE_INSTALL_PREFIX@/@DOCINSTALL@')

View File

@ -1,55 +0,0 @@
diff -ur vigra-1.7.0-src/CMakeLists.txt vigra-1.7.0-src.new/CMakeLists.txt
--- vigra-1.7.0-src/CMakeLists.txt 2010-04-15 19:27:25.000000000 +0100
+++ vigra-1.7.0-src.new/CMakeLists.txt 2010-04-21 00:09:48.000000000 +0100
@@ -113,6 +113,8 @@
INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/include/vigra DESTINATION include)
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/include/vigra DESTINATION include)
+set(LIB_SUFFIX "" CACHE STRING "Define suffix of lib directory name (32/64)" )
+
##################################################
#
# enable CPack package generation
@@ -145,8 +147,8 @@
# export targets:
#export(TARGETS all FILE
-INSTALL(EXPORT vigra-targets DESTINATION lib/vigra)
-INSTALL(FILES ${PROJECT_BINARY_DIR}/lib/vigra/CMake/VigraConfig.cmake DESTINATION lib/vigra)
+INSTALL(EXPORT vigra-targets DESTINATION lib${LIB_SUFFIX}/vigra)
+INSTALL(FILES ${PROJECT_BINARY_DIR}/lib/vigra/CMake/VigraConfig.cmake DESTINATION lib${LIB_SUFFIX}/vigra)
EXPORT(TARGETS vigraimpex FILE vigra-targets.cmake)
##################################################
@@ -205,7 +207,7 @@
MESSAGE( STATUS "---------------------------------------------------------" )
MESSAGE( STATUS " includes will be installed at: ${CMAKE_INSTALL_PREFIX}/include")
-MESSAGE( STATUS " libraries will be installed at: ${CMAKE_INSTALL_PREFIX}/lib")
+MESSAGE( STATUS " libraries will be installed at: ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
IF (MSVC)
MESSAGE( STATUS " binaries and DLLs will be installed at: ${CMAKE_INSTALL_PREFIX}/bin")
diff -ur vigra-1.7.0-src/config/FindVIGRANUMPY_DEPENDENCIES.cmake vigra-1.7.0-src.new/config/FindVIGRANUMPY_DEPENDENCIES.cmake
--- vigra-1.7.0-src/config/FindVIGRANUMPY_DEPENDENCIES.cmake 2010-04-15 19:27:25.000000000 +0100
+++ vigra-1.7.0-src.new/config/FindVIGRANUMPY_DEPENDENCIES.cmake 2010-04-20 23:30:16.000000000 +0100
@@ -36,7 +36,7 @@
######################################################################
IF(NOT DEFINED VIGRANUMPY_INSTALL_DIR OR VIGRANUMPY_INSTALL_DIR MATCHES "^$")
execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c
- "from distutils.sysconfig import *; print get_python_lib()"
+ "from distutils.sysconfig import *; print get_python_lib(1)"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
FILE(TO_CMAKE_PATH ${PYTHON_SITE_PACKAGES} VIGRANUMPY_INSTALL_DIR)
ENDIF()
diff -ur vigra-1.7.0-src/src/impex/CMakeLists.txt vigra-1.7.0-src.new/src/impex/CMakeLists.txt
--- vigra-1.7.0-src/src/impex/CMakeLists.txt 2010-04-15 19:27:39.000000000 +0100
+++ vigra-1.7.0-src.new/src/impex/CMakeLists.txt 2010-04-20 23:24:44.000000000 +0100
@@ -62,5 +62,5 @@
INSTALL(TARGETS vigraimpex
EXPORT vigra-targets
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ ARCHIVE DESTINATION lib${LIB_SUFFIX})

View File

@ -1,33 +0,0 @@
diff -baur vigra-1.7.1.old/include/vigra/random_forest.hxx vigra-1.7.1/include/vigra/random_forest.hxx
--- vigra-1.7.1.old/include/vigra/random_forest.hxx 2010-12-03 17:40:34.000000000 +0000
+++ vigra-1.7.1/include/vigra/random_forest.hxx 2011-01-28 00:16:32.000000000 +0000
@@ -43,6 +43,7 @@
#include <set>
#include <list>
#include <numeric>
+#include <stddef.h>
#include "mathutil.hxx"
#include "array_vector.hxx"
#include "sized_int.hxx"
diff -baur vigra-1.7.1.old/include/vigra/sifImport.hxx vigra-1.7.1/include/vigra/sifImport.hxx
--- vigra-1.7.1.old/include/vigra/sifImport.hxx 2010-12-03 17:40:34.000000000 +0000
+++ vigra-1.7.1/include/vigra/sifImport.hxx 2011-01-28 00:23:31.000000000 +0000
@@ -57,6 +57,7 @@
#include <fstream>
#include <cstring>
#include <vector>
+#include <stddef.h>
#include "vigra/multi_array.hxx"
namespace vigra {
diff -baur vigra-1.7.1.old/include/vigra/multi_iterator.hxx vigra-1.7.1/include/vigra/multi_iterator.hxx
--- vigra-1.7.1.old/include/vigra/multi_iterator.hxx 2010-12-03 17:40:34.000000000 +0000
+++ vigra-1.7.1/include/vigra/multi_iterator.hxx 2011-01-28 00:23:31.000000000 +0000
@@ -41,6 +41,7 @@
#define VIGRA_MULTI_ITERATOR_HXX
#include <sys/types.h>
+#include <stddef.h>
#include "tinyvector.hxx"
#include "iteratortags.hxx"

View File

@ -1,78 +0,0 @@
Note: for some reason vigra uses a non-standard LIBDIR_SUFFIX definition
whereas usually this is LIB_SUFFIX. This patch fixes this since fedora expects
to use the standard.
diff -baur vigra-1.7.1/CMakeLists.txt vigra-1.7.1.new/CMakeLists.txt
--- vigra-1.7.1/CMakeLists.txt 2010-12-03 17:40:34.000000000 +0000
+++ vigra-1.7.1.new/CMakeLists.txt 2011-01-24 21:31:37.000000000 +0000
@@ -118,6 +118,8 @@
ENDIF()
+set(LIB_SUFFIX "" CACHE STRING "Define suffix of lib directory name (32/64)" )
+
##################################################
#
# global installation commands
@@ -177,10 +179,10 @@
# export targets:
INSTALL(EXPORT vigra-targets
- DESTINATION lib${LIBDIR_SUFFIX}/vigra)
+ DESTINATION lib${LIB_SUFFIX}/vigra)
INSTALL(FILES ${PROJECT_BINARY_DIR}/lib/vigra/CMake/VigraConfig.cmake
${PROJECT_BINARY_DIR}/lib/vigra/CMake/VigraConfigVersion.cmake
- DESTINATION lib${LIBDIR_SUFFIX}/vigra)
+ DESTINATION lib${LIB_SUFFIX}/vigra)
EXPORT(TARGETS vigraimpex FILE vigra-targets.cmake)
##################################################
@@ -239,7 +241,7 @@
MESSAGE( STATUS "---------------------------------------------------------" )
MESSAGE( STATUS " includes will be installed at: ${CMAKE_INSTALL_PREFIX}/include")
-MESSAGE( STATUS " libraries will be installed at: ${CMAKE_INSTALL_PREFIX}/lib${LIBDIR_SUFFIX}")
+MESSAGE( STATUS " libraries will be installed at: ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
IF (MSVC)
MESSAGE( STATUS " binaries and DLLs will be installed at: ${CMAKE_INSTALL_PREFIX}/bin")
diff -baur vigra-1.7.1/doc/vigra/Installation.html vigra-1.7.1.new/doc/vigra/Installation.html
--- vigra-1.7.1/doc/vigra/Installation.html 2010-12-03 17:49:58.000000000 +0000
+++ vigra-1.7.1.new/doc/vigra/Installation.html 2011-01-24 21:34:48.000000000 +0000
@@ -57,8 +57,8 @@
<dd>build VIGRA Python bindings (default: 1). Pass -DWITH_VIGRANUMPY=0 to suppress vigranumpy. </dd>
<dt>-DWITH_HDF5=1 </dt>
<dd>build VIGRA with HDF5 support (default: 1). Pass -DDWITH_HDF5=0 to compile without HDF5. </dd>
-<dt>-DLIBDIR_SUFFIX=64 </dt>
-<dd>define suffix of lib directory name (default: empty string, i.e. no suffix). Use -DLIBDIR_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64. </dd>
+<dt>-DLIB_SUFFIX=64 </dt>
+<dd>define suffix of lib directory name (default: empty string, i.e. no suffix). Use -DLIB_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64. </dd>
</dl>
<p>
More fine-grained customization (e.g. specification of explicit paths for all dependencies, customization of compiler flags) is possible by editing the file &lt;vigra_build_path&gt;/CMakeCache.txt. This is best done by means of the interactive programs <b>ccmake</b> or <b>cmake-gui</b>. Consult the <a href="http://www.cmake.org/cmake/help/documentation.html">cmake documentation</a> for more detailed help.<p>
diff -baur vigra-1.7.1/docsrc/installation.dxx vigra-1.7.1.new/docsrc/installation.dxx
--- vigra-1.7.1/docsrc/installation.dxx 2010-12-03 17:40:34.000000000 +0000
+++ vigra-1.7.1.new/docsrc/installation.dxx 2011-01-24 21:34:20.000000000 +0000
@@ -50,9 +50,9 @@
vigranumpy.
<DT> -DWITH_HDF5=1
<DD> build VIGRA with HDF5 support (default: 1). Pass -DDWITH_HDF5=0 to compile without HDF5.
- <DT> -DLIBDIR_SUFFIX=64
+ <DT> -DLIB_SUFFIX=64
<DD> define suffix of lib directory name (default: empty string, i.e. no suffix). Use
- -DLIBDIR_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64.
+ -DLIB_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64.
</DL>
More fine-grained customization (e.g. specification of explicit paths for all dependencies, customization of compiler flags) is possible by editing the file &lt;vigra_build_path&gt;/CMakeCache.txt. This is best done by means of the interactive programs <b>ccmake</b> or <b>cmake-gui</b>. Consult the <a href="http://www.cmake.org/cmake/help/documentation.html">cmake documentation</a> for more detailed help.
diff -baur vigra-1.7.1/src/impex/CMakeLists.txt vigra-1.7.1.new/src/impex/CMakeLists.txt
--- vigra-1.7.1/src/impex/CMakeLists.txt 2010-12-03 17:40:34.000000000 +0000
+++ vigra-1.7.1.new/src/impex/CMakeLists.txt 2011-01-24 21:37:17.000000000 +0000
@@ -64,5 +64,5 @@
INSTALL(TARGETS vigraimpex
EXPORT vigra-targets
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib${LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LIBDIR_SUFFIX})
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ ARCHIVE DESTINATION lib${LIB_SUFFIX})

View File

@ -1,12 +0,0 @@
diff -ru vigra-1.8.0/include/vigra/numpy_array.hxx vigra-1.8.0.new/include/vigra/numpy_array.hxx
--- vigra-1.8.0/include/vigra/numpy_array.hxx 2011-09-20 19:38:36.000000000 +0100
+++ vigra-1.8.0.new/include/vigra/numpy_array.hxx 2012-02-27 21:03:54.000000000 +0000
@@ -1074,7 +1074,7 @@
this->m_stride /= sizeof(value_type);
this->m_ptr = reinterpret_cast<pointer>(pyArray()->data);
- vigra_precondition(checkInnerStride(Stride()),
+ vigra_precondition(this->checkInnerStride(Stride()),
"NumpyArray<..., UnstridedArrayTag>::setupArrayView(): First dimension of given array is not unstrided (should never happen).");
}

View File

@ -1,78 +0,0 @@
Note: for some reason vigra uses a non-standard LIBDIR_SUFFIX definition
whereas usually this is LIB_SUFFIX. This patch fixes this since fedora expects
to use the standard.
diff -baur vigra-1.8.0/CMakeLists.txt vigra-1.8.0.new/CMakeLists.txt
--- vigra-1.8.0/CMakeLists.txt 2011-09-20 19:38:36.000000000 +0100
+++ vigra-1.8.0.new/CMakeLists.txt 2011-09-24 21:20:55.000000000 +0100
@@ -128,6 +128,8 @@
ENDIF()
+set(LIB_SUFFIX "" CACHE STRING "Define suffix of lib directory name (32/64)" )
+
##################################################
#
# global installation commands
@@ -213,10 +215,10 @@
# export targets:
INSTALL(EXPORT vigra-targets
- DESTINATION lib${LIBDIR_SUFFIX}/vigra)
+ DESTINATION lib${LIB_SUFFIX}/vigra)
INSTALL(FILES ${PROJECT_BINARY_DIR}/lib/vigra/CMake/VigraConfig.cmake
${PROJECT_BINARY_DIR}/lib/vigra/CMake/VigraConfigVersion.cmake
- DESTINATION lib${LIBDIR_SUFFIX}/vigra)
+ DESTINATION lib${LIB_SUFFIX}/vigra)
EXPORT(TARGETS vigraimpex FILE vigra-targets.cmake)
##################################################
@@ -289,7 +291,7 @@
MESSAGE( STATUS "---------------------------------------------------------" )
MESSAGE( STATUS " includes will be installed at: ${CMAKE_INSTALL_PREFIX}/include")
-MESSAGE( STATUS " libraries will be installed at: ${CMAKE_INSTALL_PREFIX}/lib${LIBDIR_SUFFIX}")
+MESSAGE( STATUS " libraries will be installed at: ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
IF (MSVC)
MESSAGE( STATUS " binaries and DLLs will be installed at: ${CMAKE_INSTALL_PREFIX}/bin")
diff -baur vigra-1.8.0/doc/vigra/Installation.html vigra-1.8.0.new/doc/vigra/Installation.html
--- vigra-1.8.0/doc/vigra/Installation.html 2011-09-20 19:43:37.000000000 +0100
+++ vigra-1.8.0.new/doc/vigra/Installation.html 2011-09-24 21:21:39.000000000 +0100
@@ -58,8 +58,8 @@
<dd>build VIGRA Python bindings (default: 1). Pass -DWITH_VIGRANUMPY=0 to suppress vigranumpy. </dd>
<dt>-DWITH_HDF5=1 </dt>
<dd>build VIGRA with HDF5 support (default: 1). Pass -DDWITH_HDF5=0 to compile without HDF5. </dd>
-<dt>-DLIBDIR_SUFFIX=64 </dt>
-<dd>define suffix of lib directory name (default: empty string, i.e. no suffix). Use -DLIBDIR_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64. </dd>
+<dt>-DLIB_SUFFIX=64 </dt>
+<dd>define suffix of lib directory name (default: empty string, i.e. no suffix). Use -DLIB_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64. </dd>
</dl>
<p>More fine-grained customization (e.g. specification of explicit paths for all dependencies, customization of compiler flags) is possible by editing the file &lt;vigra_build_path&gt;/CMakeCache.txt. This is best done by means of the interactive programs <b>ccmake</b> or <b>cmake-gui</b>. Consult the <a href="http://www.cmake.org/cmake/help/documentation.html">cmake documentation</a> for more detailed help.</p>
<p>For using VIGRA in another CMake-built project, you can use the CMake command FIND_PACKAGE(Vigra), which will set the CMake variables ${Vigra_INCLUDE_DIRS} with the correct include path, and import the binary targets (currently vigraimpex) to link against (e.g., TARGET_LINK_LIBRARIES(targetname vigraimpex)). For this mechanism to work, CMake reads a config file VigraConfig.cmake, which is installed along with the library in CMAKE_INSTALL_PREFIX/lib/vigra. Alternatively, you can point CMake (cache entry Vigra_DIR) to VIGRA's build directory, where a corresponding VigraConfig.cmake resides for using the build version directly without installation. </p>
diff -baur vigra-1.8.0/docsrc/installation.dxx vigra-1.8.0.new/docsrc/installation.dxx
--- vigra-1.8.0/docsrc/installation.dxx 2011-09-20 19:38:36.000000000 +0100
+++ vigra-1.8.0.new/docsrc/installation.dxx 2011-09-24 21:19:52.000000000 +0100
@@ -53,9 +53,9 @@
vigranumpy.
<DT> -DWITH_HDF5=1
<DD> build VIGRA with HDF5 support (default: 1). Pass -DDWITH_HDF5=0 to compile without HDF5.
- <DT> -DLIBDIR_SUFFIX=64
+ <DT> -DLIB_SUFFIX=64
<DD> define suffix of lib directory name (default: empty string, i.e. no suffix). Use
- -DLIBDIR_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64.
+ -DLIB_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64.
</DL>
More fine-grained customization (e.g. specification of explicit paths for all dependencies, customization of compiler flags) is possible by editing the file &lt;vigra_build_path&gt;/CMakeCache.txt. This is best done by means of the interactive programs <b>ccmake</b> or <b>cmake-gui</b>. Consult the <a href="http://www.cmake.org/cmake/help/documentation.html">cmake documentation</a> for more detailed help.
diff -baur vigra-1.8.0/src/impex/CMakeLists.txt vigra-1.8.0.new/src/impex/CMakeLists.txt
--- vigra-1.8.0/src/impex/CMakeLists.txt 2011-09-20 19:38:36.000000000 +0100
+++ vigra-1.8.0.new/src/impex/CMakeLists.txt 2011-09-24 21:19:52.000000000 +0100
@@ -80,5 +80,5 @@
INSTALL(TARGETS vigraimpex
EXPORT vigra-targets
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib${LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LIBDIR_SUFFIX})
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ ARCHIVE DESTINATION lib${LIB_SUFFIX})

View File

@ -1,8 +0,0 @@
--- vigra-1.11.0/config/vigra-config.in 2016-03-17 10:22:21.000000000 +0000
+++ vigra-1.11.0/config/vigra-config.in 2016-04-13 20:16:18.555519408 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python
from __future__ import division, print_function

View File

@ -1,8 +1,12 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %if 0%{?fedora} > 27
%global boostpy2 boost-python2
%else
%global boostpy2 boost-python
%endif
Summary: Generic Programming for Computer Vision Summary: Generic Programming for Computer Vision
Name: vigra Name: vigra
Version: 1.11.1 Version: 1.11.1
Release: 3%{?dist} Release: 4%{?dist}
License: MIT License: MIT
Group: Development/Libraries Group: Development/Libraries
# The "Lenna" files are non-free, we need to remove them from the source tarball. # The "Lenna" files are non-free, we need to remove them from the source tarball.
@ -13,13 +17,17 @@ Source0: https://github.com/ukoethe/vigra/releases/download/Version-1-11-
Source1: vigra-config.sh Source1: vigra-config.sh
URL: http://ukoethe.github.io/vigra/ URL: http://ukoethe.github.io/vigra/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: zlib-devel libjpeg-devel libpng-devel libtiff-devel fftw-devel >= 3 BuildRequires: gcc-c++ zlib-devel libjpeg-devel libpng-devel libtiff-devel fftw-devel >= 3
BuildRequires: cmake boost-devel doxygen coin-or-lemon-devel BuildRequires: cmake boost-devel doxygen
%if ! 0%{?rhel} %if ! 0%{?rhel}
BuildRequires: hdf5-devel python2-sphinx numpy-f2py boost-python2 OpenEXR-devel Requires: python3
BuildRequires: hdf5-devel python2-sphinx python2-numpy-f2py %{boostpy2} OpenEXR-devel
BuildRequires: python3-numpy-f2py boost-python3
%else
Requires: python
%endif %endif
Patch0: vigra.rhbz987048.shebang.patch
Patch2: vigra-1.10.0-no-lenna.patch Patch2: vigra-1.10.0-no-lenna.patch
Patch3: vigra-1.11.1.docdir.patch
%description %description
VIGRA stands for "Vision with Generic Algorithms". It's a novel computer vision VIGRA stands for "Vision with Generic Algorithms". It's a novel computer vision
@ -28,6 +36,8 @@ structures. By using template techniques similar to those in the C++ Standard
Template Library, you can easily adapt any VIGRA component to the needs of your Template Library, you can easily adapt any VIGRA component to the needs of your
application without thereby giving up execution speed. application without thereby giving up execution speed.
#'
%package devel %package devel
Summary: Development tools for programs which will use the vigra library Summary: Development tools for programs which will use the vigra library
Group: Development/Libraries Group: Development/Libraries
@ -35,7 +45,8 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libjpeg-devel libtiff-devel libpng-devel zlib-devel fftw-devel >= 3 Requires: libjpeg-devel libtiff-devel libpng-devel zlib-devel fftw-devel >= 3
Requires: boost-devel Requires: boost-devel
%if ! 0%{?rhel} %if ! 0%{?rhel}
Requires: hdf5-devel numpy-f2py boost-python2 OpenEXR-devel Requires: hdf5-devel python2-numpy-f2py %{boostpy2} OpenEXR-devel
Requires: python3-numpy-f2py boost-python3 boost-python3-devel
%endif %endif
%description devel %description devel
@ -51,25 +62,52 @@ Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python < %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release}
Summary: Python interface for the vigra computer vision library Summary: Python interface for the vigra computer vision library
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: numpy numpy-f2py Requires: python2-numpy python2-numpy-f2py
%description -n python2-vigra %description -n python2-vigra
The python2-vigra package provides python bindings for vigra The python2-vigra package provides python 2 bindings for vigra
%package -n python3-vigra
%{?python_provide:%python_provide python3-vigra}
Summary: Python 3 interface for the vigra computer vision library
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3-numpy python3-numpy-f2py
%description -n python3-vigra
The python3-vigra package provides python 3 bindings for vigra
%endif %endif
%prep %prep
%setup -q %setup -q
%patch0 -p1
%patch2 -p1 -b .no-lenna %patch2 -p1 -b .no-lenna
%patch3 -p1
%build %build
# Will need to set LEMON_DIR to /usr/share/coin-or-lemon/cmake to compile WITH_LEMON
# once the coin-or-lemon package's installed cmake is fixed for x86_64 arch.
%if ! 0%{?rhel} %if ! 0%{?rhel}
%cmake . -DWITH_OPENEXR=1 -DWITH_HDF5=1 -DWITH_VIGRANUMPY=1 -DWITH_VALGRIND=0 -DWITH_LEMON=1 sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' \
config/vigra-config.in
%else mkdir buildpy2
%cmake . -DWITH_OPENEXR=0 -DWITH_HDF5=0 -DWITH_VIGRANUMPY=0 -DWITH_VALGRIND=0 -DWITH_LEMON=1 pushd buildpy2
%endif %cmake .. -DWITH_OPENEXR=1 -DWITH_HDF5=1 -DWITH_VALGRIND=0 -DWITH_LEMON=0\
-DWITH_VIGRANUMPY=1 -DPYTHON_VERSION=%{python2_version}
make VERBOSE=1 %{?_smp_mflags} make VERBOSE=1 %{?_smp_mflags}
popd
mkdir buildpy3
pushd buildpy3
%cmake .. -DWITH_OPENEXR=1 -DWITH_HDF5=1 -DWITH_VALGRIND=0 -DWITH_LEMON=0 \
-DWITH_VIGRANUMPY=1 -DPYTHON_VERSION=%{python3_version}
popd
%else
sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python}=' \
config/vigra-config.in
%cmake . -DWITH_OPENEXR=0 -DWITH_HDF5=0 -DWITH_VIGRANUMPY=0 -DWITH_VALGRIND=0 -DWITH_LEMON=0
make VERBOSE=1 %{?_smp_mflags}
%endif
# cleanup # cleanup
rm -f doc/vigranumpy/.buildinfo rm -f doc/vigranumpy/.buildinfo
rm -f doc/vigra/lenna* rm -f doc/vigra/lenna*
@ -78,7 +116,20 @@ find ./doc/ -type f | xargs chmod -x
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
%if ! 0%{?rhel}
make -C buildpy2 install DESTDIR=%{buildroot}
mv %{buildroot}/%{_libdir}/vigranumpy/VigranumpyConfig.cmake \
%{buildroot}/%{_libdir}/vigranumpy/Vigranumpy2Config.cmake
make -C buildpy3 install DESTDIR=%{buildroot}
mv %{buildroot}/%{_libdir}/vigranumpy/VigranumpyConfig.cmake \
%{buildroot}/%{_libdir}/vigranumpy/Vigranumpy3Config.cmake
%else
make install DESTDIR=%{buildroot} make install DESTDIR=%{buildroot}
%endif
rm -rf %{buildroot}/usr/doc rm -rf %{buildroot}/usr/doc
( (
cd $RPM_BUILD_ROOT%{_bindir} cd $RPM_BUILD_ROOT%{_bindir}
@ -109,11 +160,22 @@ rm -rf %{buildroot}
%if ! 0%{?rhel} %if ! 0%{?rhel}
%files -n python2-vigra %files -n python2-vigra
%{python_sitearch}/vigra %{python2_sitearch}/vigra
%{_libdir}/vigranumpy %{_libdir}/vigranumpy
%exclude %{_libdir}/vigranumpy/Vigranumpy3Config.cmake
%files -n python3-vigra
%{python3_sitearch}/vigra
%{_libdir}/vigranumpy
%exclude %{_libdir}/vigranumpy/Vigranumpy2Config.cmake
%endif %endif
%changelog %changelog
* Fri Dec 15 2017 Troy Curtis, Jr <troycurtisjr@gmail.com> - 1.11.1-4
- Add python3 subpackage
- Disable compiling with LEMON
- Move python shebang fix into spec file.
* Wed Dec 13 2017 Bruno Postle <bruno@postle.net> - 1.11.1-3 * Wed Dec 13 2017 Bruno Postle <bruno@postle.net> - 1.11.1-3
- fix -devel dependency on boost-python2 - fix -devel dependency on boost-python2

View File

@ -1,22 +0,0 @@
From c3fb6c90ab8b4243b752919d0e491df2a2d4f047 Mon Sep 17 00:00:00 2001
From: Chris Spiel <cspiel@freenet.de>
Date: Mon, 13 Oct 2014 16:08:50 +0200
Subject: [PATCH] Fix an off-by-one error in function exportImageAlpha.
---
include/vigra/impexalpha.hxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/vigra/impexalpha.hxx b/include/vigra/impexalpha.hxx
index 0426d67..41299fc 100644
--- a/include/vigra/impexalpha.hxx
+++ b/include/vigra/impexalpha.hxx
@@ -789,7 +789,7 @@ namespace vigra
encoder->setPixelType(pixel_type);
- vigra_precondition(isBandNumberSupported(encoder->getFileType(), image_accessor.size(image_upper_left)),
+ vigra_precondition(isBandNumberSupported(encoder->getFileType(), image_accessor.size(image_upper_left) + 1U),
"exportImageAlpha(): file format does not support requested number of bands (color channels)");
const range_t image_source_range(find_source_value_range(export_info,