File pcl.spec of Package pcl
#
# spec file for package pcl
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define libversion 1.12
Name: pcl
Version: 1.12.0
Release: 0
Summary: The Point Cloud Library
License: BSD-3-Clause-Clear
Group: Productivity/Scientific/Other
URL: https://pointclouds.org/
Source0: https://github.com/PointCloudLibrary/%{name}/archive/%{name}-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: eigen3-devel
BuildRequires: fdupes
BuildRequires: flann-devel
BuildRequires: gdal-devel
BuildRequires: geotiff-devel
BuildRequires: glew-devel
BuildRequires: libgomp1
%if 0%{?suse_version} || 0%{?fedora_version}
%else
%endif
%if 0%{?suse_version}
BuildRequires: geotiff-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_headers-devel
BuildRequires: libboost_iostreams-devel
BuildRequires: libboost_program_options-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_thread-devel
%else
BuildRequires: libgeotiff-devel
BuildRequires: boost-devel
%endif
# Required
BuildRequires: java-devel
BuildRequires: pkgconfig(Qt5Concurrent)
#BuildRequires: python38-devel
BuildRequires: python3-devel
BuildRequires: sqlite3-devel
#BuildRequires: pkgconfig(Qt5Core)
#BuildRequires: pkgconfig(Qt5OpenGL)
#BuildRequires: pkgconfig(Qt5OpenGLExtensions)
#BuildRequires: pkgconfig(Qt5Sql)
#BuildRequires: pkgconfig(Qt5WebKitWidgets)
#BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: libpcap-devel
#BuildRequires: openni-devel
# Something above needs something below
BuildRequires: libusb-1_0-devel
BuildRequires: libXt-devel
#BuildRequires: libvtk1
BuildRequires: libvtk1-openmpi3
BuildRequires: llvm-clang
BuildRequires: libxml2-devel
BuildRequires: python3
# Avoid oom
BuildRequires: memory-constraints
BuildRequires: metslib-devel
BuildRequires: pkgconfig
BuildRequires: proj-devel
# doc building
BuildRequires: python3-Sphinx
# Optional
BuildRequires: qhull_r-devel
BuildRequires: unzip
#BuildRequires: openmpi3-libs
BuildRequires: vtk-devel
#BuildRequires: vtk-openmpi3-qt
BuildRequires: vtk-openmpi3-devel
BuildRequires: pkgconfig(sm)
%package -n doc
Summary: The Point Cloud Library documentation
Group: Development/Libraries/C and C++
%package -n lib%{name}-%{libversion}
Summary: The Point Cloud Library
Group: Development/Libraries/C and C++
%package -n lib%{name}-devel
Summary: The Point Cloud Library
Group: Development/Libraries/C and C++
Requires: lib%{name}-%{libversion} = %{version}
%description
The Point Cloud Library (or PCL) is a large scale, open project for 2D/3D image
and point cloud processing. The PCL framework contains numerous state-of-the art
algorithms including filtering, feature estimation, surface reconstruction,
registration, model fitting and segmentation. These algorithms can be used, for
example, to filter outliers from noisy data, stitch 3D point clouds together,
segment relevant parts of a scene, extract key-points and compute descriptors to
recognize objects in the world based on their geometric appearance, and create
surfaces from point clouds and visualize them -- to name a few.
%description -n lib%{name}-%{libversion}
The Point Cloud Library (or PCL) is a large scale, open project for 2D/3D image
and point cloud processing.
This package contain the lib
%description -n lib%{name}-devel
The Point Cloud Library (or PCL) is a large scale, open project for 2D/3D image
and point cloud processing.
This package contains the header files.
%description -n doc
The Point Cloud Library (or PCL) is a large scale, open project for 2D/3D image
and point cloud processing.
This package contains the documentation.
%prep
%setup -q -n pcl-pcl-%{version}
%build
%limit_build -m 4096
%define _lto_cflags %{nil}
export CC=clang
export CXX=clang++
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
export CFLAGS="%{optflags} -fpie -fpic -fPIE"
export CXXFLAGS="%{optflags} -fpie -fpic -fPIE"
# bypass bug 927268 for PowerPC if clang is used above in place of gcc
tmpflags="%{optflags}"
%ifarch ppc64 ppc64le
%limit_build -m 2048
tmpflags=${tmpflags/-fstack-protector}
tmpflags=${tmpflags/-strong}
%endif
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
export CFLAGS="%{optflags} -fPIE -pie -fno-strict-aliasing"
export CXXFLAGS="%{optflags} -fPIE -pie -fno-strict-aliasing"
%cmake
%make_jobs
%install
%cmake_install
sed -i 's,//,/,g' $(grep // %{buildroot}/%{_libdir}/pkgconfig/*.pc -l)
find %{buildroot} -type f -name "*.la" -delete -print
%fdupes %{buildroot}
#ls -Rl %%{buildroot}
%post -n lib%{name}-%{libversion} -p /sbin/ldconfig
%postun -n lib%{name}-%{libversion} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc README.md CHANGES.md AUTHORS.txt
%license LICENSE.txt
%defattr(0755,root,root)
%{_bindir}/%{name}_*
%defattr(0644,root,root)
%files -n lib%{name}-%{libversion}
%defattr(0644,root,root)
%license LICENSE.txt
%{_libdir}/lib%{name}_*.so.%{libversion}
%{_libdir}/lib%{name}_*.so.%{version}
%files -n lib%{name}-devel
%defattr(0644,root,root)
%dir %{_datadir}/%{name}-%{libversion}
%{_datadir}/%{name}-%{libversion}/*.cmake
%{_datadir}/%{name}-%{libversion}/Modules
%{_datadir}/%{name}-%{libversion}/Modules/*.cmake
%dir %{_includedir}/%{name}-%{libversion}
%{_includedir}/%{name}-%{libversion}/*
%{_libdir}/libpcl_*.so
%{_libdir}/pkgconfig/pcl_*.pc
#%%files -n doc
#%%defattr(-,root,root)
#%%doc doc
#%%license LICENSE.txt
%changelog