File libE57Format.spec of Package libE57Format

#
# spec file for package librE57Format (Version 0.6.3)
#
# Copyright (c) 2011-2015 Rallaz
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

# norootforbuild

%define pkg_name libE57Format
%define lib_name E57Format

Name:		libE57Format2

Summary:	A library to provide read & write support for the E57 file format
Version:	2.2.0
Release:	0
URL:		https://github.com/asmaloney/libE57Format/tree/v2.2.0
License:	BSL-1.0
Group:		Development/Libraries/C and C++

Source:		%{pkg_name}-%{version}.tar.xz
Patch2:     e57-includes.patch
Patch3:     E57cmake-version.patch
BuildRoot:	%_tmppath/%name-%version-build
#BuildRequires:	gcc-c++, libtool, pkgconfig, automake, autoconf
BuildRequires:	cmake >= 3
BuildRequires:	gcc-c++
BuildRequires:  pkgconfig(xerces-c)

%description
Reference Implementation of the ASTM 3D Imaging Format.
A file format for interchange of 3D (laser) imaging data.

%package -n %{pkg_name}-devel
Summary:	Development files for libE57Format
Group:		Development/Libraries/C and C++
Requires:	%name = %version

%description -n %{pkg_name}-devel
Reference Implementation of the ASTM 3D Imaging Format.
A file format for interchange of 3D (laser) imaging data.

%prep
%setup -q -n %{pkg_name}-%{version}
sed -i 's,LIBRARY DESTINATION lib,LIBRARY DESTINATION %{_lib},g' CMakeLists.txt
sed -i 's,lib/cmake/E57Format,%{_lib}/cmake/E57Format,g' CMakeLists.txt
%patch2 -p1
%patch3 -p1

%build
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
export CFLAGS="%{optflags} -fPIC -fno-strict-aliasing"
export CXXFLAGS="%{optflags} -fPIC -fno-strict-aliasing -std=c++14 -DSUPPORT_TOPO_STREAM_OPERATORS"
%cmake ..

%make_build VERBOSE=1


%install
%cmake_install VERBOSE=1

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -n %{name}
%defattr(-,root,root)
%{_libdir}/%{pkg_name}.so.*

%files -n %{pkg_name}-devel
%defattr(-,root,root)
%doc CHANGELOG.md README.md LICENSE.md
%{_libdir}/%{pkg_name}.so
%{_includedir}/%{lib_name}/
%dir %{_libdir}/cmake/%{lib_name}
%{_libdir}/cmake/%{lib_name}/*.cmake

%changelog
* Wed Sep 29 2021 rallazz@gmail.com version 2.2.0
- created package
openSUSE Build Service is sponsored by