File avogadrolibs.spec of Package avogadrolibs

# spec file for package avogadrolibs
# Copyright (c) 2018 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:           avogadrolibs
Version:        0.9.0
Release:        0
Summary:        Molecular simulation and visualization environment
# License note: There are GPL plugins in the source, but they are neither built nor installed by the package
License:        BSD-3-Clause
Group:          Productivity/Scientific/Other
#PATCH-FIX-OPENSUSE -- 0002-create-soversion-libs.patch -- Make the libs versioned
Patch0:         0002-create-soversion-libs.patch
#PATCH-FIX-OPENSUSE -- fix-linking-issues.patch -- Ensure that the qtplugins are linked properly
Patch1:         fix-linking-issues.patch
#PATCH-FIX-OPENSUSE -- use-system-libjsoncpp.patch -- Use the system libjsoncpp
Patch2:         use-system-libjsoncpp.patch
#PATCH-FIX-UPSTREAM fix-gcc-version-check.patch
Patch3:         fix-gcc-version-check.patch
# PATCH-FIX-UPSTREAM -- Fix-build-with-Qt-511.patch
Patch4:         Fix-build-with-Qt-511.patch
BuildRequires:  cmake
BuildRequires:  eigen3-devel
BuildRequires:  fdupes
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  glew-devel
BuildRequires:  glu-devel
BuildRequires:  jsoncpp-devel
BuildRequires:  libSM-devel
BuildRequires:  libXt-devel
BuildRequires:  pkgconfig
BuildRequires:  python-devel
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5Widgets)

In order to tackle molecular simulation and visualization challenges in key areas of materials
science, chemistry and biology it is necessary to move beyond fixed software applications. The
Avogadro project is in the final stages of an ambitious rewrite of its core data structures,
algorithms and visualization capabilities. The project began as a grass roots effort to address
deficiencies observed by many of the early contributors in existing commercial and open source
solutions. Avogadro is now a robust, flexible solution that can tie in to and harness the power of
VTK for additional analysis and visualization capabilities.

%package -n libavogadrolibs-suse0
Summary:        Main libraries for Avogadro
Group:          System/Libraries
Requires:       %{name}

%description -n libavogadrolibs-suse0
This package contains the main Avogadros libraries.

%package devel
Summary:        Development files for Avogadro
Group:          Development/Libraries/C and C++
Requires:       libavogadrolibs-suse0 = %{version}

%description devel
This package contains files to develop applications using
Avogadros libraries.

%autosetup -p1

# Remove unnecessary bits
# This file is part of the standard cmake install
rm cmake/GenerateExportHeader.cmake
# No longer needed when building against system libjsoncpp
rm -rf thirdparty/jsoncpp
rm thirdparty/CMakeLists.txt

mkdir -p build
pushd build
# FIXME: you should use %%cmake macros
      -DCMAKE_C_FLAGS="%{optflags} -DNDEBUG" \
      -DCMAKE_CXX_FLAGS="%{optflags} -DNDEBUG" \
      -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-Bsymbolic-functions" \
      -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-Bsymbolic-functions" \
      -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-Bsymbolic-functions" \
      -DINSTALL_DOC_DIR=%{_defaultdocdir} \

pushd build
make %{?_smp_mflags}

pushd build
%fdupes %{buildroot}

%post   -n libavogadrolibs-suse0 -p /sbin/ldconfig
%postun -n libavogadrolibs-suse0 -p /sbin/ldconfig

%doc %{_defaultdocdir}/%{name}
%license COPYING

%files -n libavogadrolibs-suse0
%license COPYING

%files devel
%license COPYING