SHA256
1
0
forked from pool/PDAL
PDAL/PDAL.spec
Martin Pluskal 09d379acc5 Accepting request 477823 from home:bruno_friedmann:branches:Application:Geo
- Update to version 1.4.0
  visit https://github.com/PDAL/PDAL/releases/tag/1.4.0 and
  https://github.com/PDAL/PDAL/releases/tag/1.3.0 for all 
  improvements done since 1.2
- Packaging :
  + Add cfb888a04897f9704d5bdfaf4d2979e9ff303aab.patch
    Fix for being he only distribution with laszip header not in 
    subdir. See upstream https://github.com/PDAL/PDAL/issues/1503
  + Move to boost-devel split for TW
  + Comment Requires for build documentation.
  + Remove -WL,no-undefined flag from linker (otherwise we can't
    build) upstream use dlopen.
  + Clean-up and adapt cmake flag and options

OBS-URL: https://build.opensuse.org/request/show/477823
OBS-URL: https://build.opensuse.org/package/show/Application:Geo/PDAL?expand=0&rev=3
2017-03-09 08:35:40 +00:00

324 lines
10 KiB
RPMSpec

#
# spec file for package PDAL
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 Friedmann Bruno, Ioda-Net Sàrl, Charmoille, Switzerland.
#
# 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/
#
#@TODO: plugins PCL LASZIP P2G
# python breathe for doc
# python3
# Mandatory : build -doc appart (too much texlive used otherwise)
# Ask upstream to clarify seems sofull_version is build version
%define soname 4
%define sovers 4
%define sofull_version 5.0.0
%define lname pdal
Name: PDAL
Version: 1.4.0
Release: 0
Summary: Point Data Abstraction Library. GDAL for point cloud data
#@todo verify with upstream if not BSD-3
License: BSD-2-Clause
Group: Productivity/Graphics/CAD
Url: http://www.pdal.io/
Source0: http://download.osgeo.org/pdal/%{name}-%{version}-src.tar.bz2
Source1: http://download.osgeo.org/pdal/%{name}-%{version}-src.tar.bz2.md5
# Source2: https://www.pdal.io/PDAL.pdf
# Upstream issue#1503 has hardcoded /usr/include/laszip/laszip.hpp
Patch0: https://github.com/PDAL/PDAL/commit/cfb888a04897f9704d5bdfaf4d2979e9ff303aab.patch
# Override the problem of libpsl5 in tumbleweed
%if 0%{?suse_version} >= 1330
BuildRequires: libpsl5
%endif
BuildRequires: bash-completion
%if 0%{?suse_version} > 1325
BuildRequires: libboost_headers-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_program_options-devel
%else
BuildRequires: boost-devel
%endif
BuildRequires: cairo-devel
BuildRequires: cmake >= 2.8
BuildRequires: cunit-devel
BuildRequires: curl-devel
BuildRequires: fdupes
BuildRequires: freeglut-devel
# Needed for tests
BuildRequires: gdal
BuildRequires: gcc-c++
BuildRequires: googletest-devel
BuildRequires: hdf5-devel
BuildRequires: libcgal-devel
BuildRequires: libgdal-devel
BuildRequires: libgeos-devel
BuildRequires: libgeotiff-devel
BuildRequires: libght-devel
BuildRequires: jsoncpp-devel
BuildRequires: laszip-devel
BuildRequires: liblas-devel
BuildRequires: libproj-devel
BuildRequires: libspatialindex-devel
BuildRequires: libtiff-devel
BuildRequires: libxml2-devel
BuildRequires: netcdf-devel
BuildRequires: pkg-config
BuildRequires: postgresql-devel >= 9.1
BuildRequires: libpq5 >= 9.1
# We don't have it yet
# BuildRequires: pointcloud-devel
BuildRequires: python-Cython
BuildRequires: python-devel
BuildRequires: python-numpy-devel
BuildRequires: python-setuptools
# BuildRequires: python3-devel
# BuildRequires: python3-numpy-devel
BuildRequires: sqlite3-devel
BuildRequires: zlib-devel
# Needed for documentation but we don't build it.
# BuildRequires: dblatex
# BuildRequires: doxygen
# BuildRequires: python-docutils
# BuildRequires: python-Sphinx
# BuildRequires: python3-docutils
# BuildRequires: python3-Sphinx
# For doc but only in TW
# BuildRequires: python-sphinxcontrib-breathe
# Doesn't exist on obs BuildRequires: python3-breathe
Requires: lib%{name}%{soname} = %{version}
Recommends: bash-completion
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
PDAL is a C++ BSD library for translating and manipulating point cloud data.
It is very much like the GDAL library which handles raster and vector data.
See Readers and Writers for data formats PDAL supports, and see Filters for
filtering operations that you can apply with PDAL.
In addition to the library code, PDAL provides a suite of command-line
applications that users can conveniently use to process, filter, translate,
and query point cloud data. See Applications for more information.
Developers and Sponsorship
PDAL is developed by Howard Butler, Michael Gerlek, Andrew Bell, Brad Chambers
and others. Find out more about who contributes to PDAL at Contributors.
Website :
https://www.pdal.io
This package provides tools & utilities using PDAL library libpdal
%package -n lib%{name}%{soname}
Provides: lib%{lname}%{soname}
Summary: Point Data Abstraction Library. GDAL for point cloud data
%description -n lib%{name}%{soname}
PDAL is a C++ BSD library for translating and manipulating point cloud data.
It is very much like the GDAL library which handles raster and vector data.
See Readers and Writers for data formats PDAL supports, and see Filters for
filtering operations that you can apply with PDAL.
In addition to the library code, PDAL provides a suite of command-line
applications that users can conveniently use to process, filter, translate,
and query point cloud data. See Applications for more information.
Developers and Sponsorship
PDAL is developed by Howard Butler, Michael Gerlek, Andrew Bell, Brad Chambers
and others. Find out more about who contributes to PDAL at Contributors.
Website :
https://www.pdal.io
Note
PDAL should not be confused with PCL (Point Cloud Library).
PCL is a library specifically designed to provide algorithmic analysis and
modification of point clouds. PDAL provides a limited interface to the PCL's
facilities, but does not in general attempt to duplicate its capabilites.
PDAL is focused more on data access and translation than PCL. See
filters.pclblock for more background.
%package -n %{name}-devel
Summary: Development files and tools for PDAL applications
Group: Development/Libraries/C and C++
Requires: lib%{name}%{soname} = %{version}
Requires: boost-devel
Requires: cmake
Requires: zlib-devel
Provides: lib%{name}%{soname}-devel = %{version}
Provides: lib%{lname}%{soname}-devel = %{version}
Provides: lib%{name}-devel
%description -n %{name}-devel
This package provides the headers files and tools you may need to
develop applications using PDAL.
%package -n %{name}-doc
Summary: Documentation, examples and demos for PDAL
Group: Productivity/Graphics/CAD
Requires: %{name} = %{version}
BuildArch: noarch
%description -n %{name}-doc
This package provides the documentation and sources of examples and data demos of
PDAL algorithms.
%prep
%setup -q -n %{name}-%{version}-src
%patch0 -p1
#Cleanup spurious perms in documentation
find ./doc/ -type f -exec chmod -v 0644 {} \;
find ./doc/ -type f -iname "*.orig" -o -iname ".gitignore" -delete
find ./doc/ -type f -iname "*.ai" -delete
%build
%if 0%{?suse_version} == 1310
# Make things more secure, but only on 13.1 (by default on 13.2+)
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
export CFLAGS="%{optflags} -fPIE -pie"
export CXXFLAGS="%{optflags} -fPIE -pie"
%endif
%cmake \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,now" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,now" \
-DLIB_INSTALL_DIR=%{_libdir} \
-DLIB_NAME=lib%{name} \
-DINCLUDE_INSTALL_DIR=%{_includedir} \
-DENABLE_CTEST=ON \
-DWITH_COMPLETION=ON \
-DWITH_TESTS=ON \
-DWITH_LASZIP=ON \
-DLASZIP_INCLUDE_DIR=%{_includedir} \
-DWITH_GEOTIFF=%{_includedir}/libgeotiff \
-DGEOTIFF_INCLUDE_DIR=%{_includedir}/libgeotiff \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_PLUGIN_PYTHON=ON \
-DBUILD_PLUGIN_HEXBIN=OFF \
-DBUILD_PLUGIN_ICEBRIDGE=OFF \
-DBUILD_PLUGIN_NITF=OFF \
-DBUILD_PLUGIN_P2G=OFF \
-DBUILD_PLUGIN_PGPOINTCLOUD=ON \
-DBUILD_PLUGIN_SQLITE=ON \
-DBUILD_PLUGIN_GREYHOUND=OFF \
-DBUILD_PLUGIN_PCL=OFF \
..
make VERBOSE=1 %{?_smp_mflags}
# Make documentation once fixed upstream
# make doxygen html man pdf
# Make the python part should be build in a dedicated .spec
# It need pdal-config to work
# pushd ../python
# python setup.py build
# popd
%install
pushd build
make DESTDIR=%{buildroot} install %{?_smp_mflags}
popd
# pushd ../python
# python setup.py install
# popd
#No .la lib
find %{buildroot} -type f -name "*.la" -o -name "*.a" -delete -print
%if 0%{?suse_version}
%fdupes %{buildroot}
%fdupes doc
%endif
# Not finished yet
#%%check
#pushd build
#export LD_LIBRARY_PATH=%%{buildroot}%%{_libdir}:${LD_LIBRARY_PATH}
#export GDAL_DATA=/usr/share/gdal/
#ctest -V
#popd
%post -n lib%{name}%{soname} -p /sbin/ldconfig
%postun -n lib%{name}%{soname} -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_bindir}/pdal
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/pdal
%files -n lib%{name}%{soname}
%defattr(-,root,root,-)
%doc AUTHORS.txt LICENSE.txt README.md ChangeLog
%{_libdir}/libpdal_base.so.%{sofull_version}
%{_libdir}/libpdal_plang.so.%{sofull_version}
# Plugins exist with their
%{_libdir}/libpdal_plugin_filter_predicate.so.%{sofull_version}
%{_libdir}/libpdal_plugin_filter_programmable.so.%{sofull_version}
%{_libdir}/libpdal_plugin_reader_sqlite.so.%{sofull_version}
%{_libdir}/libpdal_plugin_writer_sqlite.so.%{sofull_version}
%{_libdir}/libpdal_plugin_reader_pgpointcloud.so.%{sofull_version}
%{_libdir}/libpdal_plugin_writer_pgpointcloud.so.%{sofull_version}
%{_libdir}/libpdal_util.so.%{sofull_version}
%files -n %{name}-devel
%defattr(-,root,root,-)
%doc AUTHORS.txt LICENSE.txt README.md CONTRIBUTING.md
%{_includedir}/pdal
%{_libdir}/libpdal_base.so.%{sovers}
%{_libdir}/libpdal_base.so
%{_libdir}/libpdal_plang.so.%{sovers}
%{_libdir}/libpdal_plang.so
%{_libdir}/libpdal_plugin_filter_predicate.so
%{_libdir}/libpdal_plugin_filter_predicate.so.%{sovers}
%{_libdir}/libpdal_plugin_filter_programmable.so
%{_libdir}/libpdal_plugin_filter_programmable.so.%{sovers}
%{_libdir}/libpdal_plugin_reader_sqlite.so
%{_libdir}/libpdal_plugin_reader_sqlite.so.%{sovers}
%{_libdir}/libpdal_plugin_writer_sqlite.so
%{_libdir}/libpdal_plugin_writer_sqlite.so.%{sovers}
%{_libdir}/libpdal_plugin_reader_pgpointcloud.so
%{_libdir}/libpdal_plugin_reader_pgpointcloud.so.%{sovers}
%{_libdir}/libpdal_plugin_writer_pgpointcloud.so
%{_libdir}/libpdal_plugin_writer_pgpointcloud.so.%{sovers}
%{_libdir}/libpdal_util.so.%{sovers}
%{_libdir}/libpdal_util.so
%{_libdir}/libpdalcpp.so
%{_libdir}/pkgconfig/pdal.pc
%{_bindir}/pdal-config
%dir %{_libdir}/pdal/
%dir %{_libdir}/pdal/cmake
%{_libdir}/pdal/cmake/PDAL*.cmake
%files -n %{name}-doc
%defattr(-,root,root,-)
%doc doc
%changelog