File IfcOpenShell.spec of Package IfcOpenShell
#
# spec file for package IfcOpenShell
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%define svgfill_tag 4d2aa7acf7
%define _soversion 0_6
%if 0%{?suse_version} > 1500
%bcond_without boost_signals2
%else
%bcond_with boost_signals2
%endif
Name: IfcOpenShell
Version: 0.7.0a6
Release: 0
Summary: Open source IFC toolkit and geometry engine
License: LGPL-3.0-only
Group: Productivity/Graphics/CAD
URL: http://ifcopenshell.org/
Source0: https://github.com/IfcOpenShell/IfcOpenShell/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://github.com/IfcOpenShell/svgfill/archive/%{svgfill_tag}.tar.gz#/svgfill-%{svgfill_tag}.tar.gz
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: hdf5-devel
BuildRequires: libboost_headers-devel
BuildRequires: libboost_program_options-devel
BuildRequires: libboost_regex-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_thread-devel
BuildRequires: libxml2-devel
BuildRequires: memory-constraints
BuildRequires: openCOLLADA-devel
BuildRequires: pkgconfig
BuildRequires: python3-devel
BuildRequires: python3-pyparsing
BuildRequires: svgpp-devel
BuildRequires: swig
BuildRequires: cmake(CGAL)
BuildRequires: cmake(OpenCASCADE) >= 7.4.0
BuildRequires: cmake(nlohmann_json)
BuildRequires: pkgconfig(gmp)
BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(mpfr)
%if %{without boost_signals2}
BuildRequires: libboost_signals-devel
%endif
%description
IfcOpenShell is an open source software library
for working with the Industry Foundation Classes (IFC) file format,
commonly used for BIM(Building Information Modelling).
Currently supported IFC releases are IFC2x3 TC1 and IFC4 Add2 TC1.
iIfcOpenShell uses OpenCASCADE internally to convert the implicit geometry
in IFC files into explicit geometry that any software CAD or modelling package can understand.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: libIfcOpenShell-%{_soversion} = %{version}
%description devel
IfcOpenShell is an open source software library
for working with the Industry Foundation Classes (IFC) file format,
commonly used for BIM(Building Information Modelling).
Currently supported IFC releases are IFC2x3 TC1 and IFC4 Add2 TC1.
This subpackage contains header files.
%package -n libIfcOpenShell-%{_soversion}
Summary: Shared libraries for %{name}
Group: System/Libraries
%description -n libIfcOpenShell-%{_soversion}
IfcOpenShell is an open source software library
for working with the Industry Foundation Classes (IFC) file format,
commonly used for BIM(Building Information Modelling).
Currently supported IFC releases are IFC2x3 TC1 and IFC4 Add2 TC1.
This subpackage contains shared libraries.
%package -n python3-IfcOpenShell
Summary: IfcOpenShell Python modules
Group: Development/Languages/Python
%description -n python3-IfcOpenShell
IfcOpenShell is an open source software library
for working with the Industry Foundation Classes (IFC) file format,
commonly used for BIM(Building Information Modelling).
Currently supported IFC releases are IFC2x3 TC1 and IFC4 Add2 TC1.
This subpackage contains Python3 modules.
%prep
%setup -q -b 1
rmdir src/svgfill
(cd src; ln -sf ../../svgfill-%{svgfill_tag}* svgfill)
# Make svgfill library static
sed -i -e 's/^install/# \0/' \
-e '/add_library/ s/libsvgfill/libsvgfill STATIC /' src/svgfill/CMakeLists.txt
%build
%limit_build -m 2100
CFLAGS="$OPTFLAGS -fno-strict-aliasing" \
CXXFLAGS="$OPTFLAGS -fno-strict-aliasing" \
%cmake \
-S ../cmake/ \
-DCMAKE_LIB_INSTALL_DIR:PATH=%{_libdir} \
-DBINDIR=%{_bindir} \
-DLIBDIR=%{_libdir} \
-DINCLUDEDIR=%{_includedir} \
-DOCC_INCLUDE_DIR=%{_includedir}/opencascade \
-DGMP_LIBRARY_DIR=%{_libdir} \
-DHDF5_LIBRARIES="hdf5;hdf5_cpp" \
-DJSON_INCLUDE_DIR=%{_includedir} \
-DLIBXML2_INCLUDE_DIR=%{_includedir}/libxml \
-DLIBXML2_LIBRARIES=%{_libdir}/libxml2.so \
-DMPFR_LIBRARY_DIR=%{_libdir} \
-DOPENCOLLADA_INCLUDE_DIR=%{_includedir} \
-DOPENCOLLADA_LIBRARY_DIR=%{_libdir} \
-DPYTHON_EXECUTABLE=%{_bindir}/python3 \
-DBUILD_CONVERT:BOOL=ON \
-DBUILD_EXAMPLES:BOOL=OFF \
-DBUILD_GEOMSERVER:BOOL=ON \
-DBUILD_IFCGEOM:BOOL=ON \
-DBUILD_IFCPYTHON:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCOLLADA_SUPPORT:BOOL=ON \
-DENABLE_BUILD_OPTIMIZATIONS:BOOL=ON \
-DGLTF_SUPPORT:BOOL=ON \
-DIFCCONVERT_DOUBLE_PRECISION:BOOL=ON \
-DIFCXML_SUPPORT:BOOL=ON \
%{nil}
%cmake_build
%install
%cmake_install
rm %{buildroot}/%{_libdir}/*.a
%fdupes %{buildroot}/%{_prefix}
%post -n libIfcOpenShell-%{_soversion} -p /sbin/ldconfig
%postun -n libIfcOpenShell-%{_soversion} -p /sbin/ldconfig
%files
%license COPYING
%{_bindir}/IfcConvert
%{_bindir}/IfcGeomServer
%files devel
%{_libdir}/libIfcGeom.so
%{_libdir}/libIfcParse.so
%{_libdir}/libSerializers.so
%{_includedir}/*
%files -n libIfcOpenShell-%{_soversion}
%{_libdir}/libIfcGeom.so.*
%{_libdir}/libIfcParse.so.*
%{_libdir}/libSerializers.so.*
%files -n python3-IfcOpenShell
%{python3_sitearch}/*
%changelog