File occt.spec of Package occt

# spec file for package occt
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

Name:           occt
Version:        7.2.0
%define soname 7
Release:        0
Summary:        OpenCASCADE Official Edition
License:        LGPL-2.1 WITH OCCT-exception-1.0
Group:          Productivity/Graphics/CAD
# Password protected URL, factory validation will fail
Source0:        opencascade-%{version}.tgz
Patch1:         fix_build.patch
Provides:       OpenCASCADE = %{version}
BuildRequires:  bison
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  tcl-devel
BuildRequires:  tk-devel
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xmu)
BuildRequires:  pkgconfig(xt)
#Requires:       tcsh

OpenCASCADE is a suite for 3D surface and solid modeling, visualization, data
exchange and rapid application development. It is an excellent platform for
development of numerical simulation software including CAD/CAM/CAE, AEC and
GIS, as well as PDM applications.

%package devel
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Provides:       OpenCASCADE-devel = %{version}
Requires:       %{name} = %{version}
Requires:       %{name}-DRAWEXE = %{version}
Requires:       libopencascade%{soname} = %{version}
Requires:       freetype2-devel
Requires:       tcl-devel
Requires:       tk-devel
Requires:       pkgconfig(gl)
Requires:       pkgconfig(glu)
Requires:       pkgconfig(x11)
Requires:       pkgconfig(xext)
Requires:       pkgconfig(xmu)
Requires:       pkgconfig(xt)
Conflicts:      oce-devel

%description devel
This package contains the files needed for development with OpenCASCADE.

%package -n libopencascade%{soname}
Summary:        OpenCASCADE libraries
Group:          Development/Libraries/C and C++

%description -n libopencascade%{soname}
This package contain the needed libraries for OpenCASCADE

%package DRAWEXE
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Conflicts:      oce-DRAWEXE

%description DRAWEXE
This package contains the DRAWEXE executable of OpenCASCADE.

%setup -q -n opencascade-%{version}
%patch1 -p0

mkdir build && cd build
%if "%{_libdir}" == "/usr/lib64"
make %{?_smp_mflags}

cd ..
./gendoc -refman
# fix permission bits
find doc README.txt LICENSE_LGPL_21.txt OCCT_LGPL_EXCEPTION.txt -type f | xargs chmod 0644

cd build
make install DESTDIR=%buildroot

chmod 0755 %buildroot/usr/bin/*

if [ "%_libdir" == "/usr/lib64" ] ;then
  mkdir -p %buildroot/usr/lib64
  mv %buildroot/usr/lib/lib* %buildroot/usr/lib64/

rm -rf %buildroot/usr/share/doc

%fdupes -s %{buildroot}

%post -n libopencascade%{soname} -p /sbin/ldconfig

%postun -n libopencascade%{soname} -p /sbin/ldconfig


%files -n libopencascade%{soname}

%files DRAWEXE

%files devel
%doc doc/refman/html

openSUSE Build Service is sponsored by