liblas/liblas.spec

119 lines
3.2 KiB
RPMSpec
Raw Permalink Normal View History

%define git_commit %(echo %version | cut -d. -f5)
%define git_tag %(echo %version | cut -d. -f1-3)
Name: liblas
Version: 1.8.1.20240404git.96d4dc9
Release: 2mamba
Summary: C++ library and programs for reading and writing ASPRS LAS format with LiDAR data
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://liblas.org/
Source: https://github.com/libLAS/libLAS.git/%{git_tag}@%{git_commit}/libLAS-%{version}.tar.bz2
Patch0: liblas-1.8.1.20240404git.96d4dc9-gdal-2.5.patch
Patch1: liblas-1.8.1.20240404git.96d4dc9-fix-cmake-remove-liblas-depends.patch
License: BSD
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libboost-devel
BuildRequires: libgcc
BuildRequires: libgdal-devel
BuildRequires: libgeotiff-devel
BuildRequires: libproj-devel
BuildRequires: libstdc++6-devel
BuildRequires: libtiff-devel
## AUTOBUILDREQ-END
BuildRequires: cmake
%description
C++ library and programs for reading and writing ASPRS LAS format with LiDAR data.
%package devel
Group: Development/Libraries
Summary: Development files for %{name}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description devel
This package contains libraries and header files for developing applications that use %{name}.
%package tools
Group: Applications/Scientific
Summary: Utility applications for %{name}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description tools
This package contains utility applications for %{name}.
%debug_package
%prep
%setup -q -n libLAS-%{version}
%define _default_patch_fuzz 2
%patch 0 -p1 -b .gdal-2.5
%patch 1 -p1
%build
%cmake \
-DCMAKE_CXX_FLAGS="-std=gnu++11" \
-DLIBLAS_LIB_SUBDIR="%{_lib}" \
-DWITH_GDAL=ON \
-DWITH_GEOTIFF=ON \
-DWITH_UTILITIES=ON
# TODO:
# -DWITH_LASZIP=ON \
# -DCMAKE_INSTALL_RPATH=/usr/lib/laszip2 \
# -DLASZIP_INCLUDE_DIR=/usr/include \
# -DLASZIP_LIBRARY=/usr/lib/laszip2/liblaszip.so \
%cmake_build
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%cmake_install
rm -rf %{buildroot}%{_datadir}/liblas/doc
# Requires pkgconfig(geotiff) which does not exist
rm -f %{buildroot}%{_libdir}/pkgconfig/liblas.pc
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_libdir}/liblas.so.*
%{_libdir}/liblas_c.so.*
%doc AUTHORS LICENSE.txt
%files devel
%defattr(-,root,root)
%dir %{_includedir}/liblas
%{_includedir}/liblas/*
%{_libdir}/liblas.so
%{_libdir}/liblas_c.so
%dir %{_libdir}/cmake/libLAS
%{_libdir}/cmake/libLAS/liblas-*.cmake
%files tools
%defattr(-,root,root)
%{_bindir}/las2col
%{_bindir}/las2las
%{_bindir}/las2ogr
%{_bindir}/las2pg
%{_bindir}/las2txt
%{_bindir}/lasblock
%{_bindir}/lasinfo
%{_bindir}/ts2las
%{_bindir}/txt2las
%changelog
* Wed May 08 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8.1.20240404git.96d4dc9-2mamba
- add patch to cmake fles to not include liblas-depends.cmake which causes build failure to vtk
* Mon May 06 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8.1.20240404git.96d4dc9-1mamba
- package created using the webbuild interface