File colmap.spec of Package colmap

#
# spec file for package colmap.spec
#
# Copyright (c) 2018-2020 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

#FIXME Eigen3 version needs to be set, something funky with the colmap ceres cmake
# file for version checks.
%define _eigen_ver 3.3.9

Name:           colmap
Version:        3.6+37
Release:        3.51
License:        BSD-3-Clause
Summary:        Structure-from-Motion and Multi-View Stereo
URL:            https://colmap.github.io/
Group:          Productivity/Graphics/Other
Source0:        %{name}-%{version}.tar.xz
Source1:        colmap.png
BuildRequires:  cmake
BuildRequires:  cgal-devel
BuildRequires:  eigen3-devel
BuildRequires:  freeimage-devel
BuildRequires:  gcc-c++
BuildRequires:  git
BuildRequires:  glew-devel
BuildRequires:  glog-devel
BuildRequires:  glu-devel
BuildRequires:  libQt5Core-devel
BuildRequires:  libQt5OpenGL-devel
BuildRequires:  libQt5Widgets-devel
BuildRequires:  libboost_filesystem-devel >= 1.66.0
BuildRequires:  libboost_graph-devel >= 1.66.0
BuildRequires:  libboost_program_options-devel >= 1.66.0
BuildRequires:  libboost_regex-devel >= 1.66.0
BuildRequires:  libboost_system-devel >= 1.66.0
BuildRequires:  libboost_test-devel >= 1.66.0
BuildRequires:  libceres-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  suitesparse-devel
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline
with a graphical and command-line interface. It offers a wide range of features
for reconstruction of ordered and unordered image collections.

%package devel
Summary:        Developent headers for colmap
Group:          Development/Libraries/C and C++

%description devel
A general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline
with a graphical and command-line interface. It offers a wide range of features
for reconstruction of ordered and unordered image collections.

%prep
%setup -q

%build
mkdir -p build
cd build
cmake  -DEIGEN3_VERSION="%{_eigen_ver}" \
       -DOpenGL_GL_PREFERENCE="LEGACY" \
       -DBOOST_STATIC="OFF" \
       -DCMAKE_BUILD_TYPE="Release" \
       -DCMAKE_VERBOSE_MAKEFILE="ON" \
       -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
       -DCMAKE_C_FLAGS="-Wno-error" \
       -DCMAKE_CXX_FLAGS="-Wno-error" \
       ..
make %{?_smp_mflags}

%install
%cmake_install
#FIXME Install generic desktop icon, need to find proper app icon!
install -Dm0644 %{S:1} %{buildroot}%{_datadir}/pixmaps/colmap.png
%suse_update_desktop_file COLMAP
#Install man page
install -Dm0644 doc/colmap.1 %{buildroot}%{_mandir}/man1/colmap.1
#Remove static libs
rm -rf %{buildroot}/usr/lib/colmap

%files
%doc CHANGELOG.txt CONTRIBUTING.md
%license COPYING.txt
%{_bindir}/colmap
%{_datadir}/applications/COLMAP.desktop
%{_mandir}/man1/colmap.1%{?ext_man}
%{_datadir}/pixmaps/colmap.png

%files devel
%{_includedir}/colmap
%{_datadir}/colmap

%changelog
* Wed Dec  2 2020 malcolmlewis@opensuse.org
- Update to version 3.6+37:
  * Fix CUDA CMake script for older CMake versions.
  * Update dead URLs.
  * Support for CUDA compute architecture 8.6.
  * Remove deprecated qt foreach, (gh#colmap/colmap#1039).
  * Ensure DecomposeHomographyMatrix() always returns rotations,
    (gh#colmap/colmap#1040).
  * Update .travis.yml, (gh#colmap/colmap#989).
  * fixed small bug in visualize_model.py, (gh#colmap/colmap#1007).
  * fix camera model query, (gh#colmap/colmap#997).
  * Print status about initial image pair search.
- Change versioning to PARENT_TAG+TAG_OFFSET.
* Sun Dec  8 2019 malcolmlewis@opensuse.org
- Update to version 3.6+git20191208.aac98d7:
  * Fix bug in GpuMat::Rotate() implementation,
    (gh#colmap/colmap#755).
  * Update licensing description.
  * Fix gpu_mat unit test.
  * Fix bug in GpuMat::FillWithScalar() implementation,
    (gh#colmap/colmap#743).
  * Update Travis display configuration.
  * Upgrade Qt, CUDA versions on Travis.
  * Compile single COLMAP static library and link internal
    dependencies against it.
  * Remove unused include.
  * Increase RANSAC confidence by requiring more sample iterations.
* Tue Jul 17 2018 malcolmlewis@opensuse.org
- Initial build at version 9b3fefa (2018-07-16).
- Add generic icon for colmap desktop file.
openSUSE Build Service is sponsored by