d8925d3
# Adapted from
d8925d3
# https://build.opensuse.org/package/view_file/home:bruno_friedmann:branches:Application:Geo/cloudcompare/cloudcompare.spec
d8925d3
#
d8925d3
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
d8925d3
# Copyright (c) 2016 Ioda-Net Sàrl, Charmoille, Switzerland. Bruno Friedmann
d8925d3
# Copyright (c) 2017 Miro Hrončok and possibly others
d8925d3
#
d8925d3
# All modifications and additions to the file contributed by third parties
d8925d3
# remain the property of their copyright owners, unless otherwise agreed
d8925d3
# upon. The license for this file, and modifications and additions to the
d8925d3
# file, is the same license as for the pristine package itself (unless the
d8925d3
# license for the pristine package is not an Open Source License, in which
d8925d3
# case the license is the MIT License). An "Open Source License" is a
d8925d3
# license that conforms to the Open Source Definition (Version 1.9)
d8925d3
# published by the Open Source Initiative.
d8925d3
d8925d3
d8925d3
%global edition Release
d8925d3
%global cname   CloudCompare
d8925d3
Name:           cloudcompare
5cf02a3
Version:        2.9.1
1982e55
Release:        2%{?dist}
d8925d3
Summary:        3D point cloud and mesh processing software
d8925d3
d8925d3
# Main part is GPLv2+
d8925d3
# CCLib is LGPLv2+
d8925d3
# Plugins from Source1 and Source2 are MIT
d8925d3
# dxflib is GPLv2+
d8925d3
# shapelib is (LGPLv2+ or MIT)
d8925d3
# as the result is compiled into one piece, it should be:
d8925d3
License:        GPLv2+
d8925d3
d8925d3
URL:            http://www.cloudcompare.org/
d8925d3
27d5edc
Source0:        https://github.com/%{cname}/%{cname}/archive/v%{version}/%{cname}-%{version}.tar.gz
d8925d3
d8925d3
# git submodules
5cf02a3
%global pr_commit f42872b45ac35bf85efc662d348bb5d8ac9e5577
27d5edc
Source1:        https://github.com/%{cname}/PoissonRecon/archive/%{pr_commit}/PoissonRecon-%{pr_commit}.tar.gz
d8925d3
d8925d3
%global nh_commit 61ba8056d72eedffadb838d9051cc8975ec7a825
27d5edc
Source2:        https://github.com/%{cname}/normals_Hough/archive/%{nh_commit}/normals_Hough-%{nh_commit}.tar.gz
d8925d3
d8925d3
# desktop files
d8925d3
Source3:        %{name}.desktop
d8925d3
Source4:        ccviewer.desktop
d8925d3
ff8d8e0
# https://github.com/CloudCompare/CloudCompare/pull/648
ff8d8e0
Patch0:         %{name}-signed-chars.patch
ff8d8e0
ff8d8e0
# https://github.com/CloudCompare/CloudCompare/issues/649
5681d98
Patch1:         %{name}-big-endian.patch
ff8d8e0
d8925d3
BuildRequires:  boost-devel
d8925d3
BuildRequires:  desktop-file-utils
d8925d3
BuildRequires:  cmake >= 3
d8925d3
BuildRequires:  fdupes
d8925d3
BuildRequires:  gcc-c++
d8925d3
BuildRequires:  laszip-devel
d8925d3
BuildRequires:  libgomp
d8925d3
BuildRequires:  liblas-devel
d8925d3
BuildRequires:  pkgconfig(gdal)
d8925d3
BuildRequires:  pkgconfig(cunit)
d8925d3
BuildRequires:  pkgconfig(dri)
d8925d3
BuildRequires:  pkgconfig(eigen3)
d8925d3
BuildRequires:  pkgconfig(gl)
d8925d3
BuildRequires:  pkgconfig(glew)
d8925d3
BuildRequires:  pkgconfig(glu)
d8925d3
BuildRequires:  pkgconfig(pkg-config)
d8925d3
BuildRequires:  pkgconfig(shapelib)
d8925d3
BuildRequires:  pkgconfig(Qt3Support)
d8925d3
BuildRequires:  pkgconfig(Qt5Concurrent)
d8925d3
BuildRequires:  pkgconfig(Qt5Core)
d8925d3
BuildRequires:  pkgconfig(Qt5DBus)
d8925d3
BuildRequires:  pkgconfig(Qt5Designer)
d8925d3
BuildRequires:  pkgconfig(Qt5Gui)
d8925d3
BuildRequires:  pkgconfig(Qt5Help)
d8925d3
BuildRequires:  pkgconfig(Qt5Multimedia)
d8925d3
BuildRequires:  pkgconfig(Qt5Network)
d8925d3
BuildRequires:  pkgconfig(Qt5OpenGL)
d8925d3
BuildRequires:  pkgconfig(Qt5OpenGLExtensions)
d8925d3
BuildRequires:  pkgconfig(Qt5PrintSupport)
d8925d3
BuildRequires:  pkgconfig(Qt5Script)
d8925d3
BuildRequires:  pkgconfig(Qt5ScriptTools)
d8925d3
BuildRequires:  pkgconfig(Qt5Sql)
d8925d3
BuildRequires:  pkgconfig(Qt5Svg)
d8925d3
BuildRequires:  pkgconfig(Qt5Test)
d8925d3
BuildRequires:  pkgconfig(Qt5UiTools)
d8925d3
BuildRequires:  pkgconfig(Qt5Widgets)
d8925d3
BuildRequires:  pkgconfig(Qt5Xml)
d8925d3
BuildRequires:  pkgconfig(Qt5XmlPatterns)
d8925d3
BuildRequires:  pkgconfig(xerces-c)
d8925d3
BuildRequires:  pkgconfig(zlib)
d8925d3
d8925d3
Provides:       bundled(dxflib) = 3.3.4
d8925d3
Provides:       %{cname} = %{version}-%{release}
d8925d3
%{?_isa:Provides:       %{cname}%{_isa} = %{version}-%{release}}
d8925d3
5cf02a3
Requires:       hicolor-icon-theme
d8925d3
d8925d3
# Do not RPM provide .so files only used internally:
d8925d3
%global __provides_exclude_from ^%{_libdir}/%{name}/.*$
d8925d3
%global __requires_exclude ^lib(Q)?CC_.*$
d8925d3
d8925d3
%description
d8925d3
CloudCompare is a 3D point cloud (and triangular mesh) processing software.
d8925d3
It has been originally designed to perform comparison between two 3D points
d8925d3
clouds (such as the ones obtained with a laser scanner) or between a point
d8925d3
cloud and a triangular mesh.
d8925d3
It relies on a specific octree structure that enables great performances in
d8925d3
this particular function. It was also meant to deal with huge point clouds
d8925d3
(typically more than 10 millions points, and up to 120 millions with 2 Gb of
d8925d3
memory).
d8925d3
d8925d3
Afterwards, it has been extended to a more generic point cloud processing
d8925d3
software, including many advanced algorithms (registration, resampling,
d8925d3
color/normal/scalar fields handling, statistics computation, sensor
d8925d3
management, interactive or automatic segmentation, display enhancement...).
d8925d3
9496bc1
9496bc1
%package doc
9496bc1
Summary:        Documentation for %{cname}
9496bc1
Requires:       %{name} == %{version}-%{release}
9496bc1
BuildArch:      noarch
9496bc1
9496bc1
%description doc
9496bc1
CloudCompare is a 3D point cloud (and triangular mesh) processing software.
9496bc1
This is the documentation.
9496bc1
9496bc1
d8925d3
%prep
d8925d3
%autosetup -n %{cname}-%{version} -p1
d8925d3
d8925d3
rmdir plugins/qPoissonRecon/PoissonReconLib
d8925d3
tar -xf %{SOURCE1}
d8925d3
mv PoissonRecon-%{pr_commit} plugins/qPoissonRecon/PoissonReconLib
d8925d3
d8925d3
rmdir plugins/qHoughNormals/normals_Hough
d8925d3
tar -xf %{SOURCE2}
d8925d3
mv normals_Hough-%{nh_commit} plugins/qHoughNormals/normals_Hough
d8925d3
143793d
# fix spurious executable permissions
143793d
# https://github.com/aboulch/normals_Hough/pull/5
143793d
# https://github.com/CloudCompare/normals_Hough/pull/3
143793d
# https://github.com/CloudCompare/CloudCompare/pull/650
143793d
find plugins/qHoughNormals '(' -name '*.h' -o -name '*.hpp' ')' -exec chmod -x {} \;
143793d
d8925d3
# On 64bits, change /usr/lib/cloudcompare to /usr/lib64/cloudcompare
d8925d3
sed -i 's|lib/%{name}|%{_lib}/%{name}|g' $(grep -r lib/%{name} -l)
d8925d3
d8925d3
# Remove french TeX docs
d8925d3
rm -rf doc/fr*
d8925d3
d8925d3
# Remove bundle shapelib https://github.com/CloudCompare/CloudCompare/issues/497
d8925d3
rm -rf contrib/shapelib-*
d8925d3
sed -i 's/add_subdirectory.*//' contrib/ShapeLibSupport.cmake
d8925d3
sed -i 's/ SHAPELIB / shp /g' plugins/qFacets/CMakeLists.txt contrib/ShapeLibSupport.cmake
d8925d3
d8925d3
%build
d8925d3
mkdir build
d8925d3
pushd build
d8925d3
d8925d3
%cmake \
d8925d3
   -DCMAKE_BUILD_TYPE=%{edition} \
d8925d3
   -DCMAKE_INSTALL_RPATH=%{_libdir}/%{name} \
d8925d3
   -DEIGEN_ROOT_DIR=%{_includedir}/eigen3 \
d8925d3
   -DGDAL_LIB_SRC_DIR=%{_includedir} \
d8925d3
   -DINSTALL_QANIMATION_PLUGIN=ON \
d8925d3
   -DINSTALL_QBLUR_PLUGIN=ON \
d8925d3
   -DINSTALL_QBROOM_PLUGIN=ON \
d8925d3
   -DINSTALL_QCSF_PLUGIN=ON \
d8925d3
   -DINSTALL_QDUMMY_PLUGIN=OFF \
d8925d3
   -DINSTALL_QEDL_PLUGIN=ON \
d8925d3
   -DINSTALL_QFACETS_PLUGIN=ON \
d8925d3
   -DINSTALL_QHOUGH_NORMALS_PLUGIN=ON \
d8925d3
   -DINSTALL_QHPR_PLUGIN=ON \
d8925d3
   -DINSTALL_QKINECT_PLUGIN=OFF \
d8925d3
   -DINSTALL_QM3C2_PLUGIN=ON \
d8925d3
   -DINSTALL_QPCL_PLUGIN=OFF \
d8925d3
   -DINSTALL_QPCV_PLUGIN=ON \
d8925d3
   -DINSTALL_QPHOTOSCAN_IO_PLUGIN=ON \
d8925d3
   -DINSTALL_QPOISSON_RECON_PLUGIN=ON \
d8925d3
   -DINSTALL_QSRA_PLUGIN=ON \
d8925d3
   -DINSTALL_QSSAO_PLUGIN=ON \
d8925d3
   -DLIBLAS_INCLUDE_DIR=%{_includedir}/liblas \
d8925d3
   -DLIBLAS_RELEASE_LIBRARY_FILE=%{_libdir}/liblas.so.3 \
d8925d3
   -DOPTION_SUPPORT_3DCONNEXION_DEV=OFF \
d8925d3
   -DOPTION_USE_DXF_LIB=ON \
d8925d3
   -DOPTION_USE_GDAL=ON \
d8925d3
   -DOPTION_USE_LIBLAS=ON \
d8925d3
   -DOPTION_USE_SHAPE_LIB=ON \
d8925d3
   -DSHAPELIB_SOURCE_DIR=%{_includedir} \
ff8d8e0
%ifarch %ix86 x86_64
ff8d8e0
   -DINSTALL_QRANSAC_SD_PLUGIN=ON \
ff8d8e0
%else
ff8d8e0
   -DINSTALL_QRANSAC_SD_PLUGIN=OFF \
ff8d8e0
%endif
d8925d3
   ..
d8925d3
ff8d8e0
# QRANSAC_SD_PLUGIN on other arches: fatal error: xmmintrin.h: No such file or directory
d8925d3
d8925d3
00670f7
%make_build VERBOSE=1
d8925d3
popd
d8925d3
d8925d3
%install
d8925d3
pushd build
00670f7
%make_install VERBOSE=1
d8925d3
popd
d8925d3
d8925d3
# lower-case symblinks
d8925d3
ln -s ./%{cname} %{buildroot}%{_bindir}/%{name}
d8925d3
ln -s ./ccViewer %{buildroot}%{_bindir}/ccviewer
d8925d3
d8925d3
# icons
d8925d3
for RES in 16 32 64 256; do
d8925d3
  mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${RES}x${RES}/apps/
d8925d3
  cp qCC/images/icon/cc_icon_${RES}.png %{buildroot}%{_datadir}/icons/hicolor/${RES}x${RES}/apps/%{name}.png
d8925d3
  cp qCC/images/icon/cc_viewer_icon_${RES}.png %{buildroot}%{_datadir}/icons/hicolor/${RES}x${RES}/apps/ccviewer.png
d8925d3
done
d8925d3
d8925d3
# desktop files
d8925d3
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE3}
d8925d3
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE4}
d8925d3
d8925d3
d8925d3
%files
9496bc1
%doc README.md CONTRIBUTING.md CHANGELOG.md
d8925d3
%license license.txt license_headers.txt
d8925d3
%{_bindir}/%{name}
d8925d3
%{_bindir}/%{cname}
d8925d3
%{_bindir}/ccviewer
d8925d3
%{_bindir}/ccViewer
d8925d3
%{_libdir}/%{name}/
d8925d3
%{_datadir}/%{name}/
d8925d3
%exclude %{_datadir}/%{name}/CHANGELOG.md
d8925d3
%exclude %{_datadir}/%{name}/license.txt
d8925d3
%{_datadir}/icons/hicolor/*/apps/*.png
d8925d3
%{_datadir}/applications/*.desktop
d8925d3
9496bc1
%files doc
9496bc1
%doc doc
9496bc1
d8925d3
%changelog
1982e55
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.1-2
1982e55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
1982e55
5cf02a3
* Thu Feb 22 2018 Miro Hrončok <mhroncok@redhat.com> - 2.9.1-1
5cf02a3
- Updated to 2.9.1
5cf02a3
- Remove merged patch
5cf02a3
- Removed obsolete icon scriptlets
5cf02a3
- Require hicolor-icon-theme
00670f7
- Use make macros
9496bc1
- Split doc to doc subpackage
ff8d8e0
- Add fix for "other" arches, but exclude BE for now
5cf02a3
d8925d3
* Sat Sep 09 2017 Miro Hrončok <mhroncok@redhat.com> - 2.8.1-1
d8925d3
- Updated to 2.8.1
d8925d3
d8925d3
* Mon Jan 16 2017 Miro Hrončok <mhroncok@redhat.com> - 2.8.0-1
d8925d3
- Initial package adapted from openSUSE package