pcl/pcl.spec
2023-06-01 10:12:45 +08:00

163 lines
4.4 KiB
RPMSpec

%global apiversion 1.12
%global soversion 1.12
Name: pcl
Version: 1.12.1
Release: 1
Summary: Library for point cloud processing
License: BSD
URL: http://pointclouds.org/
Source0: %{name}-%{version}.tar.gz
# Look for external metslib, not upstream
Patch0: %{name}-1.12.0-metslib.patch
# Patch for PCLConfig.cmake to find pcl
Patch1: %{name}-1.12.0-fedora.patch
Patch2: %{name}-1.12.1-boost.patch
# For plain building
BuildRequires: cmake, gcc-c++, boost-devel
# Documentation
#BuildRequires: doxygen, graphviz, /usr/bin/sphinx-build
BuildRequires: doxygen, graphviz
# mandatory
#BuildRequires: eigen3-static, flann-devel, vtk-devel, gl2ps-devel, hdf5-devel, libxml2-devel, netcdf-cxx-devel, jsoncpp-devel, metslib-static, libXext-devel
BuildRequires: eigen3-static, flann-devel, gl2ps-devel, hdf5-devel, libxml2-devel, netcdf-devel, jsoncpp-devel, metslib-static, libXext-devel, flann-static
BuildRequires: texlive-latex
# To fix Imported target "VTK::Java" includes non-existent path "/usr/lib/jvm/java/include" in its INTERFACE_INCLUDE_DIRECTORIES
%ifarch %{java_arches}
BuildRequires: java-devel
%endif
# optional
BuildRequires: qt5-qtbase-devel, qhull-devel, libusbx-devel, gtest-devel, qt5-qtwebkit-devel
%ifarch %{ix86} x86_64
BuildRequires: openni-devel
%endif
%description
The Point Cloud Library (or PCL) is a large scale, open project for point
cloud processing.
The PCL framework contains numerous state-of-the art algorithms including
filtering, feature estimation, surface reconstruction, registration, model
fitting and segmentation.
%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
Requires: libusb-devel
Requires: flann-static
Requires: pkgconfig
#Requires: eigen3-devel, qhull-devel, flann-devel, vtk-devel
Requires: eigen3-devel, qhull-devel, flann-devel
%ifarch %{ix86} x86_64
Requires: openni-devel
%endif
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package tools
Summary: Point cloud tools and viewers
Requires: %{name} = %{version}-%{release}
%description tools
This package contains tools for point cloud file processing and viewers
for point cloud files and live Kinect data.
%package doc
Summary: PCL API documentation
BuildArch: noarch
%description doc
The %{name}-doc package contains API documentation for the Point Cloud
Library.
%prep
%setup -qn %{name}-%{name}-%{version}
%patch0 -p1 -b .metslib
%patch1 -p0 -b .fedora
%patch2 -p1 -b .boost
# Just to make it obvious we're not using any of these
rm -fr recognition/include/pcl/recognition/3rdparty/metslib
rm -fr surface/src/3rdparty/opennurbs
rm -rf surface/include/pcl/surface/3rdparty/opennurbs
%build
# try to reduce memory usage of compile process (can cause OOM errors
# esp. on ARM builders)
%global optflags %(echo %{optflags} | sed -e 's/-g /-g1 /' -e 's/-pipe //' -e's/-ffat-lto-objects/-fno-fat-lto-objects/')
mkdir build && cd build
%cmake \
-DCMAKE_BUILD_TYPE=None \
-DWITH_DOCS=ON \
-DWITH_CUDA=OFF \
-DWITH_VTK=OFF \
-DWITH_TUTORIALS=ON \
-DBUILD_apps=ON \
-DBUILD_global_tests=OFF \
-DOPENNI_INCLUDE_DIR:PATH=/usr/include/ni \
-DLIB_INSTALL_DIR=%{_lib} \
%ifarch x86_64
-DPCL_ENABLE_SSE=ON \
%else
-DPCL_ENABLE_SSE=OFF \
%endif
-DPCL_PKGCONFIG_SUFFIX:STRING="" \
-DBUILD_documentation=ON \
-DCMAKE_SKIP_RPATH=ON \
..
%make_build
%install
cd build
%make_install
# Just a dummy test
rm -f $RPM_BUILD_ROOT%{_bindir}/timed_trigger_test
mkdir -p $RPM_BUILD_ROOT%{_libdir}/cmake/pcl
mv $RPM_BUILD_ROOT%{_datadir}/%{name}-*/*.cmake $RPM_BUILD_ROOT%{_libdir}/cmake/pcl/
mv $RPM_BUILD_ROOT%{_datadir}/%{name}-*/Modules $RPM_BUILD_ROOT%{_libdir}/cmake/pcl/
%check
cd build
make test || true
%ldconfig_scriptlets
%files
%license LICENSE.txt
%doc AUTHORS.txt
%{_libdir}/*.so.%{version}
%{_libdir}/*.so.%{soversion}
%{_datadir}/%{name}-%{apiversion}
%files devel
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_libdir}/cmake/pcl
%files tools
%{_bindir}/pcl_*
# There are no .desktop files because the GUI tools are rather examples
# to understand a particular feature of PCL.
%files doc
%doc %{_datadir}/doc
%changelog
* Fri Apr 28 2023 will_niutao <niutao2@huawei.com> - 1.12.1-1
- init package for openEuler