File saga-gis-ltr.spec of Package saga-gis-ltr

#
# spec file for package saga-gis-ltr
#
# 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 http://bugs.opensuse.org/
#

%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects

Summary:        SAGA GIS - System for Automated Geoscientific Analyses
License:        GPL-1.0+ and LGPL-2.1
Group:          Applications/GIS
Name:           saga-gis-ltr
Version:        2.3.1
Release:        0
Url:            http://www.saga-gis.org/
%define sgdirname saga
Source:         %{sgdirname}_%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  dos2unix
# dxflib/dl_dxf.h is not found by configure script.
# BuildRequires:  dxflib-devel
BuildRequires:  fdupes
BuildRequires:  fftw3-devel
BuildRequires:  gcc-c++
BuildRequires:  libgdal-devel >= 1.5
BuildRequires:  libharu-devel >= 2.0.8
# Liblas is not found by configure script. (Version mismatch?)
# BuildRequires:  liblas-devel
# Not yet compatible with proj6
BuildRequires:  proj5-devel
BuildRequires:  libsvm-devel
BuildRequires:  libtool
%if 0%{?suse_version} > 1500
BuildRequires:  opencv3-devel
%else
BuildRequires:  opencv-devel
%endif
BuildRequires:  python-devel
BuildRequires:  swig
BuildRequires:  unixODBC-devel
BuildRequires:  vigra-devel
# SAGA needs the no STL version
BuildRequires:  wxWidgets-3_0-nostl-devel >= 3
# Conflicts with latest SAGA
Conflicts:      saga-gis

%description
SAGA (System for Automated Geoscientific Analyses) provides (geo-)scientists 
an effective but easy learnable and user friendly platform for the implementation 
of geoscientific methods using SAGA's API. SAGA is written in C++ programming 
language and follows an object oriented approach.

System Developers are Olaf Conrad, Thomas Schorr, Stefan Liersch, Victor Olaya 
and Andre Ringeler. For modules please read description supplied with each module 
on information about the responsible authors.

%package devel
Summary:        Development files for SAGA
Group:          Development/Libraries
Requires:       %{name} = %{version}

%description devel
SAGA (System for Automated Geoscientific Analyses) provides (geo-)scientists 
an effective but easy learnable and user friendly platform for the implementation 
of geoscientific methods using SAGA's API. SAGA is written in C++ programming 
language and follows an object oriented approach.

System Developers are Olaf Conrad, Thomas Schorr, Stefan Liersch, Victor Olaya 
and Andre Ringeler. For modules please read description supplied with each module 
on information about the responsible authors.
This package includes the development files for SAGA GIS.

%package -n python-%{name}
Summary:        Python bindings for SAGA
Group:          Development/Libraries
Requires:       %{name} = %{version}
Requires:       python

%description -n python-%{name}
SAGA (System for Automated Geoscientific Analyses) provides (geo-)scientists 
an effective but easy learnable and user friendly platform for the implementation 
of geoscientific methods using SAGA's API. SAGA is written in C++ programming 
language and follows an object oriented approach.

System Developers are Olaf Conrad, Thomas Schorr, Stefan Liersch, Victor Olaya 
and Andre Ringeler. For modules please read description supplied with each module 
on information about the responsible authors.
This package includes the Python bindings for SAGA GIS.

%prep
%setup -q -n %{sgdirname}-%{version}
dos2unix AUTHORS
dos2unix NEWS
chmod -x AUTHORS COPYING NEWS ChangeLog

%build
%if 0%{?sle_version} == 120300 && 0%{?is_opensuse}
# Fix build for openSUSE Leap 42.3, by using c++11 std
export CXXFLAGS=" -std=c++11"
%endif
%configure \
	--enable-python
make %{?_smp_mflags}

%install
%make_install
# Add xpm icon
mkdir -p %{buildroot}/usr/share/pixmaps
cp ./src/saga_core/saga_gui/res/xpm/saga_icon_32.xpm %{buildroot}/usr/share/pixmaps/saga_icon_32.xpm
chmod -x %{buildroot}/usr/share/pixmaps/saga_icon_32.xpm
# Remove 8x8 and 80x80 icons
rm -rf %{buildroot}%{_prefix}/share/icons/hicolor/8x8/
rm -rf %{buildroot}%{_prefix}/share/icons/hicolor/80x80/

%fdupes %{buildroot}

%files
%defattr(-,root,root)
%{_bindir}/saga_*
%{_libdir}/*.so
%dir %{_libdir}/saga
%{_libdir}/saga/*.so
%{_libdir}/*.la
%{_libdir}/saga/*.la
%{_mandir}/man1/saga*.gz
%doc AUTHORS COPYING NEWS ChangeLog
%{_prefix}/share/pixmaps/saga_icon_32.xpm
%{_prefix}/share/pixmaps/*.png
%{_prefix}/share/applications/*.desktop
%dir %{_prefix}/share/saga
%{_prefix}/share/saga/*
%dir %{_prefix}/share/appdata
%{_prefix}/share/appdata/saga*
%{_prefix}/share/icons/hicolor/*/apps/saga.png

%files devel
%defattr(-,root,root)
%{_includedir}/*

%files -n python-%{name}
%defattr(-,root,root)
%dir %{python_sitearch}
%{python_sitearch}/

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%changelog
openSUSE Build Service is sponsored by