File kalzium.spec of Package kalzium4

# spec file for package kalzium
# Copyright (c) 2015 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
%bcond_with ob3

Name:           kalzium
Version:        16.08.3
Release:        0
Summary:        Periodic Table of Elements
License:        GPL-2.0+
Group:          Productivity/Scientific/Chemistry
Source0:        %{name}-%{version}.tar.xz
Patch:          fix-build-with-ocaml-4.04.patch
# PATCH-UNFIX-UPSTREAM -- build may fail with recent eigen3 versions if avogadro is built with eigen2 (as in Leap 15.0)
Patch1:         switch-to-eigen3.diff
Patch2:         prefer-const-variable-over-define.patch
Patch3:         Add-support-for-OpenBabel-3.x.patch
BuildRequires:  avogadro-devel
BuildRequires:  boost-devel
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150100
# Tumbleweed and Leap 15.1 build avogadro with eigen3 meanwhile
BuildRequires:  eigen3-devel
BuildRequires:  libeigen2-devel
BuildRequires:  fdupes
BuildRequires:  freeglut-devel
BuildRequires:  glew-devel
BuildRequires:  libkde4-devel
%if %{with ob3} || 0%{?suse_version} <= 1500
BuildRequires:  libopenbabel-devel
BuildRequires:  openbabel2-devel
BuildRequires:  python-devel
BuildRequires:  xz
# currently in DOESNOTBUILD (2008-07-03)
%ifnarch ppc ppc64 s390 s390x
BuildRequires:  ocaml
BuildRequires:  ocaml-facile-devel
Provides:       kde4-kalzium = 4.3.0
Obsoletes:      kde4-kalzium < 4.3.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Kalzium shows a periodic table of the elements.

%package devel
Summary:        Periodic Table of Elements
Group:          Development/Libraries/KDE
Requires:       kalzium = %{version}

%description devel
Kalzium shows a periodic table of the elements.

%setup -q
%patch -p1
%if 0%{?suse_version} <= 1500 && 0%{?sle_version} < 150100
# build with eigen2 to avoid a type conflict and fix the build on Leap 15.0, needs to be removed if avogadro should once be built with eigen3...
%patch1 -Rp1
# Fix "error: expected unqualified-id before numeric constant" with eigen3
%patch2 -p1
%if %{with ob3} && 0%{?suse_version} > 1500
%patch3 -p1

%ifarch ppc ppc64
export RPM_OPT_FLAGS="%{optflags} -mminimal-toc"
  %cmake_kde4 -d build

  %kde4_makeinstall -C build
  %fdupes -s %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%doc %lang(en) %{_kde4_htmldir}/en/kalzium/
%dir %{_kde4_appsdir}/desktoptheme
%dir %{_kde4_appsdir}/desktoptheme/default
%dir %{_kde4_appsdir}/desktoptheme/default/widgets
%dir %{_kde4_datadir}/metainfo

%files devel

openSUSE Build Service is sponsored by