File scidavis.spec of Package scidavis

#
# spec file for package scidavis
#
# Copyright (c) 2013 SUSE LINUX Products 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 http://bugs.opensuse.org/
#


# See also http://en.opensuse.org/openSUSE:Shared_library_packaging_policy


Name:           scidavis
Version:        2.8
Release:        0
Summary:        Plotting application
License:        GPL-2.0+
Group:          Development/Libraries/C and C++
Url:            http://scidavis.sourceforge.net
Source0:        scidavis-%{version}.tar.gz
BuildRequires:  gcc-c++ cmake boost-devel gsl-devel python3-devel muparser-devel python3-sip-devel python3-qt5-devel python3-QtPy
Requires: python3-qt5

## use  % dump or (eg % {echo:stuff = 0% {rhel}}) to see predefined macros
#%dump
#%{echo:stuff = %{?rhel}%{!?rhel:7}}

%define noAssistant 1


%if "%{_vendor}"=="suse"
%define qmake qmake-qt5
BuildRequires: glu-devel
%endif

%if "%{_vendor}"=="redhat"
%define qmake %_qt5_qmake
BuildRequires: python3-pyqt5-sip qt5-qtbase-devel qt5-qtsvg-devel qt5-linguist mesa-libGLU-devel
# RedHat systems don't support QtAssistant, so disable it...
%define noAssistant 1
%endif

%global debug_package %{nil}

%description
The %{name} package contains the SciDaVis application and resource files.

%prep
%setup -n scidavis-%{version}

%define baseconfig -DBUILD_QWT=ON -DBUILD_QWTPLOT3D=ON -DORIGIN_IMPORT=ON -DSCRIPTING_PYTHON=ON -DCMAKE_INSTALL_PREFIX:PATH=%{buildroot}/usr
#%if %{noAssistant}
#%define config %{baseconfig} CONFIG+=noassistant
#%else
%define config %{baseconfig}
#%endif

%build
env PYTHON=python3 cmake %{config} .
env PYTHON=python3 make VERBOSE=1 %{?_smp_mflags}
#env PYTHON=python3 make VERBOSE=1

%install
make install
# current scidavis source code requires the executables to be in a parent directory to translations
mkdir -p %{buildroot}/usr/share/scidavis/translations
mv %{buildroot}/usr/bin/scidavis %{buildroot}/usr/share/scidavis/
ln -sf /usr/share/scidavis/scidavis %{buildroot}/usr/bin/scidavis
cp scidavis/translations/*.qm %{buildroot}/usr/share/scidavis/translations

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr (-,root,root)
%{_bindir}/scidavis
/usr/share/*
/usr/etc/*
/usr/lib64
## why are these files only generated on Redhat?
#%if %{_vendor}==redhat
#/etc/scidavisrc.pyc
#/etc/scidavisrc.pyo
#%endif
%dir
/usr/etc
#/usr/lib64

%changelog
openSUSE Build Service is sponsored by