File gwyddion.spec of Package gwyddion
#
# spec file for package gwyddion
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
# Only Python2 is supported
%if 0%{suse_version} >= 1550
%bcond_with python
%else
%bcond_without python
%endif
Name: gwyddion
Version: 2.61
Release: 0
License: GPL-2.0-or-later
Summary: An SPM data visualization and analysis tool
Group: Productivity/Scientific/Other
URL: http://gwyddion.net/
Source0: http://gwyddion.net/download/%{version}/%{name}-%{version}.tar.xz
BuildRequires: desktop-file-utils >= 0.9
BuildRequires: fdupes
BuildRequires: fftw3-devel >= 3.1
BuildRequires: findutils
BuildRequires: gcc-c++
BuildRequires: gettext
BuildRequires: glu-devel
BuildRequires: gtkglext-devel
BuildRequires: libtiff-devel >= 3.6
BuildRequires: perl >= 5.005
BuildRequires: pkgconfig
%if %{with python}
BuildRequires: python-devel >= 2.2
BuildRequires: python-gtk-devel
BuildRequires: python-numpy
BuildRequires: pkgconfig(gtksourceview-2.0)
%endif
BuildRequires: ruby >= 1.8
BuildRequires: sed
BuildRequires: update-desktop-files
BuildRequires: xorg-x11-libXmu-devel
BuildRequires: xz
BuildRequires: pkgconfig(glib-2.0) >= 2.8
BuildRequires: pkgconfig(gtk+-2.0) >= 2.8
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(pango) >= 1.10
# TODO: More file formats
#BuildRequires: webp-devel
#BuildRequires: cfitsio-devel
#BuildRequires: hdf5-devel
#BuildRequires: openexr-devel
# The only packaged perl module is private, don't expose it.
%define __perl_provides %{nil}
%define pkglibdir %{_libdir}/%{name}
%define pkgdatadir %{_datadir}/%{name}
%define pkgincludedir %{_includedir}/%{name}
%define gtkdocdir %{_datadir}/gtk-doc/html
%description
Gwyddion is a modular SPM (Scanning Probe Microscopy) data visualization and
analysis tool written with Gtk+.
It can be used for all most frequently used data processing operations
including: leveling, false color plotting, shading, filtering, denoising, data
editing, integral transforms, grain analysis, profile extraction, fractal
analysis, and many more. The program is primarily focused on SPM data analysis
(e.g. data obtained from AFM, STM, NSOM, and similar microscopes). However, it
can also be used for analysis of SEM (Scanning Electron Microscopy) data or any
other 2D data.
%package devel
Summary: Headers, libraries and tools for Gwyddion module development
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
# This pulls everything else
Requires: fftw3-devel
Requires: gtkglext-devel
Requires: pkgconfig(glib-2.0)
Requires: pkgconfig(gtk+-2.0) >= 2.8
Requires: pkgconfig(pango)
%description devel
Header files, libraries and tools for Gwyddion module and plug-in development.
This package also contains the API documentation and sample plug-ins in various
programming languages.
%prep
%setup -q
# Don't install .la files.
sed -i -e '/# Install the pseudo-library/,/^$/d' ltmain.sh
# Replace universal /usr/bin/env shbang with the real thing.
sed -i -e '1s/env *//' plugins/*.{py,rb,pl}
%build
%configure \
--docdir=%{_defaultdocdir}/%{name} \
--without-pascal \
--disable-rpath \
--with-fftw3 \
--with-gl \
%{?with_python:--with-gtksourceview} \
%{?without_python:--without-python} \
%{nil}
%make_build
%install
%make_install
# https://github.com/openSUSE/brp-check-suse/issues/4 category limitations:
%suse_update_desktop_file -i -r -G "ImageAnalysis" %{name} Science Math
%find_lang %{name}
# Get rid of .la files if some silly distros (hello Mandriva) overwrote our
# fixed libtool with some crap.
find %{buildroot} -name \*.la -print -delete
# Perl, Python, and Ruby modules are private, remove the Perl man page.
rm -f %{buildroot}%{_mandir}/man3/Gwyddion::dump.*
%fdupes %{buildroot}%{_datadir}
%fdupes %{buildroot}%{_libdir}/%{name}
# Fix executable permissions
chmod -x %{buildroot}%{pkglibdir}/include/gwyconfig.h
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files -f %{name}.lang
%doc AUTHORS INSTALL NEWS README THANKS
%license COPYING
%{_bindir}/%{name}
%{_bindir}/%{name}-thumbnailer
%dir %{pkgdatadir}
%dir %{pkgdatadir}/glmaterials
%dir %{pkgdatadir}/gradients
%dir %{pkgdatadir}/pixmaps
%dir %{pkgdatadir}/ui
%{pkgdatadir}/glmaterials/*
%{pkgdatadir}/gradients/*
%{pkgdatadir}/user-guide-modules
%{pkgdatadir}/pixmaps/*.png
%{pkgdatadir}/pixmaps/*.ico
%{pkgdatadir}/ui/*
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/%{name}-thumbnailer.1*
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%dir %{pkglibdir}
%dir %{pkglibdir}/modules
%dir %{pkglibdir}/modules/cmap/
%dir %{pkglibdir}/modules/file
%dir %{pkglibdir}/modules/graph
%dir %{pkglibdir}/modules/layer
%dir %{pkglibdir}/modules/process
%dir %{pkglibdir}/modules/tool
%dir %{pkglibdir}/modules/volume/
%dir %{pkglibdir}/modules/xyz/
%{pkglibdir}/modules/*.so
%{pkglibdir}/modules/cmap/*.so
%{pkglibdir}/modules/file/*.so
%{pkglibdir}/modules/graph/*.so
%{pkglibdir}/modules/layer/*.so
%{pkglibdir}/modules/process/*.so
%{pkglibdir}/modules/tool/*.so
%{pkglibdir}/modules/volume/*.so
%{pkglibdir}/modules/xyz/*.so
%{_libdir}/*.so.*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/metainfo/*.xml
%{_datadir}/mime/packages/%{name}.xml
%dir %{_datadir}/thumbnailers/
%{_datadir}/thumbnailers/%{name}.thumbnailer
%if %{with python}
%dir %{pkgdatadir}/pygwy
%{pkgdatadir}/pygwy/*
%dir %{_datadir}/gtksourceview-2.0/
%dir %{_datadir}/gtksourceview-2.0/language-specs/
%{_datadir}/gtksourceview-2.0/language-specs/pygwy.lang
%{python2_sitearch}/gwy.so
%endif
%files devel
%doc devel-docs/CODING-STANDARDS
%doc data/%{name}.vim
%{pkgincludedir}/app/*.h
%{pkgincludedir}/libdraw/*.h
%{pkgincludedir}/libprocess/*.h
%{pkgincludedir}/libgwyddion/*.h
%{pkgincludedir}/libgwydgets/*.h
%{pkgincludedir}/libgwymodule/*.h
%dir %{pkgincludedir}/app
%dir %{pkgincludedir}/libdraw
%dir %{pkgincludedir}/libprocess
%dir %{pkgincludedir}/libgwyddion
%dir %{pkgincludedir}/libgwydgets
%dir %{pkgincludedir}/libgwymodule
%dir %{pkgincludedir}
%{_libdir}/*.so
%{_libdir}/pkgconfig/gwyddion.pc
# Documentation
%doc %{gtkdocdir}/libgwyapp/*
%doc %{gtkdocdir}/libgwydraw/*
%doc %{gtkdocdir}/libgwyprocess/*
%doc %{gtkdocdir}/libgwyddion/*
%doc %{gtkdocdir}/libgwydgets/*
%doc %{gtkdocdir}/libgwymodule/*
%doc %dir %{gtkdocdir}/libgwyapp
%doc %dir %{gtkdocdir}/libgwydraw
%doc %dir %{gtkdocdir}/libgwyprocess
%doc %dir %{gtkdocdir}/libgwyddion
%doc %dir %{gtkdocdir}/libgwydgets
%doc %dir %{gtkdocdir}/libgwymodule
%doc %dir %{gtkdocdir}
%doc %dir %{_datadir}/gtk-doc
%{pkglibdir}/include/gwyconfig.h
%dir %{pkglibdir}/include
# Plug-ins and plug-in devel stuff
%{pkglibdir}/perl/Gwyddion/*
%dir %{pkglibdir}/perl/Gwyddion
%dir %{pkglibdir}/perl
%if %{with python}
%{pkglibdir}/python/Gwyddion/*
%dir %{pkglibdir}/python/Gwyddion
%dir %{pkglibdir}/python
%endif
%{pkglibdir}/ruby/gwyddion/*
%dir %{pkglibdir}/ruby/gwyddion
%dir %{pkglibdir}/ruby
%doc %{_defaultdocdir}/%{name}/plugins
%changelog