File cgal.spec of Package cgal
#
# spec file for package cgal
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2014 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 : clarify and split licence correctly, GPL & LGPL 3+ version
#@TODO : split package in coherent parts
#@TODO : rename parts (inspirated by sfcgal packaging)
#@TODO : ask for rename and take into account the obsolete existant thing. like libcgal deps
%define _sover 13
%define _sourcename CGAL
%define _libname libCGAL%{_sover}
Name: cgal
Version: 4.12.2
Release: 0
Summary: Computational Geometry Algorithms Library
License: GPL-3.0-or-later AND LGPL-3.0-or-later
Group: Productivity/Graphics/CAD
Url: http://www.cgal.org/
# You will need to update the magic numbers from the download urls on updating
Source0: https://github.com/CGAL/cgal/releases/download/releases%%2FCGAL-%{version}/CGAL-%{version}.tar.xz
Source1: https://github.com/CGAL/cgal/releases/download/releases%%2FCGAL-%{version}/CGAL-%{version}-doc_html.tar.xz
Source2: cgal-rpmlintrc
BuildRequires: blas-devel
BuildRequires: cmake >= 2.8.11
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: glu-devel
BuildRequires: gmp-devel
BuildRequires: lapack-devel
BuildRequires: libQt5OpenGL-devel >= 5.3
BuildRequires: libboost_atomic1_66_0-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_thread-devel
BuildRequires: libqt5-qtbase-devel >= 5.3
BuildRequires: libqt5-qtscript-devel >= 5.3
BuildRequires: libqt5-qtsvg-devel >= 5.3
BuildRequires: libqt5-qttools-devel >= 5.3
BuildRequires: mpfr-devel
BuildRequires: xz
BuildRequires: zlib-devel
Requires: libcgal-devel = %{version}
%description
CGAL provides geometric algorithms in a C++ library.
The library offers data structures and algorithms like
triangulations, Voronoi diagrams, Boolean operations on polygons and
polyhedra, point set processing, arrangements of curves, surface and
volume mesh generation, geometry processing, alpha shapes, convex
hull algorithms, shape analysis, AABB and KD trees.
%package -n %{_libname}
Summary: Computational Geometry Algorithms Library
License: GPL-3.0-or-later AND LGPL-3.0-or-later
Group: System/Libraries
%description -n %{_libname}
CGAL provides geometric algorithms in a C++ library.
The library offers data structures and algorithms like
triangulations, Voronoi diagrams, Boolean operations on polygons and
polyhedra, point set processing, arrangements of curves, surface and
volume mesh generation, geometry processing, alpha shapes, convex
hull algorithms, shape analysis, AABB and KD trees.
%package devel
Summary: Development files and tools for CGAL applications
License: GPL-3.0-or-later AND LGPL-3.0-or-later AND BSL-1.0
Group: Development/Libraries/C and C++
Requires: %{_libname} = %{version}
Requires: blas
Requires: boost-devel
Requires: cmake
Requires: gmp-devel
Requires: lapack
Requires: mpfr-devel
#Requires: qt-devel
Requires: zlib-devel
#For compatibility with package looking for our old name
Provides: libcgal-devel = %{version}
%description devel
This package provides the headers files and tools you may need to
develop applications using CGAL.
%package demo-examples-devel
Summary: Example & demo files for CGAL library usage
License: GPL-3.0-or-later AND LGPL-3.0-or-later AND BSL-1.0 AND MIT
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}
BuildArch: noarch
%description demo-examples-devel
This package provides the sources of examples and demos of
CGAL algorithms. You can study them, compile and test CGAL
library.
%package doc
Summary: Documentation CGAL algorithms
License: GPL-3.0-or-later AND LGPL-3.0-or-later
Group: Documentation/HTML
BuildArch: noarch
%description doc
This package provides the documentation for CGAL algorithms.
%prep
%setup -q -n CGAL-%{version} -a1
%build
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
export CFLAGS="%{optflags} -fPIE -pie"
export CXXFLAGS="%{optflags} -fPIE -pie"
%cmake \
-DCGAL_INSTALL_LIB_DIR=%{_lib} \
-DCMAKE_BUILD_TYPE=Release \
make %{?_smp_mflags}
# Unfortunately take +6600sec locally.
# So we just deliver the source code in cgal package.
# -DWITH_examples=true \
# -DWITH_demos=true \
%install
%cmake_install
install -d %{buildroot}/%{_datadir}/CGAL/examples
install -d %{buildroot}/%{_datadir}/CGAL/demo
cp -a examples/* %{buildroot}/%{_datadir}/CGAL/examples
cp -a demo/* %{buildroot}/%{_datadir}/CGAL/demo
# Clean doc wrongly placed by make install
rm -rfv %{buildroot}/%{_datadir}/doc/CGAL-%{version}
# no macos here.
rm %{buildroot}/%{_bindir}/cgal_make_macosx_app
%fdupes doc_html
%fdupes %{buildroot}/%{_datadir}
%post -n %{_libname} -p /sbin/ldconfig
%postun -n %{_libname} -p /sbin/ldconfig
%files -n %{_libname}
%license LICENSE*
%doc AUTHORS CHANGES.md
%{_libdir}/libCGAL.so.%{_sover}*
%{_libdir}/libCGAL_Core.so.%{_sover}*
%{_libdir}/libCGAL_ImageIO.so.%{_sover}*
%{_libdir}/libCGAL_Qt5.so.%{_sover}*
%files devel
%license LICENSE*
%doc AUTHORS CHANGES.md
%{_includedir}/CGAL
%{_libdir}/libCGAL.so
%{_libdir}/libCGAL_Core.so
%{_libdir}/libCGAL_ImageIO.so
%{_libdir}/libCGAL_Qt5.so
%{_libdir}/cmake/CGAL
%{_bindir}/*
%{_mandir}/man1/cgal_create_cmake_script.1%{?ext_man}
%files demo-examples-devel
%license LICENSE*
%doc AUTHORS CHANGES.md
%{_datadir}/CGAL
%files doc
%license LICENSE*
%doc AUTHORS CHANGES.md
%doc doc_html
%changelog