File mathgl.spec of Package mathgl

#
# spec file for package mathgl
#
# Copyright (c) 2016 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/
#


%define octave_args --no-window-system --norc

Name:           mathgl
%define libname libmgl
Version:        2.3.4
Release:        0
# oct_version must be x.y.z
%define oct_version %{version}
%define somajor 7.4.1
%define libversion 7_4_1
Summary:        Cross-platform library for making high-quality scientific graphics
License:        GPL-3.0
Group:          Productivity/Scientific/Other
Url:            http://mathgl.sourceforge.net
Source:         http://downloads.sourceforge.net/mathgl/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM mathgl-fix-python-module-path.patch -- Make python modules install arch-depended
Patch1:         mathgl-fix-python-module-path.patch
# PATCH-FEATURE-UPSTREAM mathgl-examples-install.patch -- Enable examples install
Patch2:         mathgl-examples-install.patch
# PATCH-FIX-OPENSUSE mathgl-doc-path.patch -- Locate documentation to right place
Patch3:         mathgl-doc-path.patch
# PATCH-FIX-OPENSUSE udav-help-path.patch -- fix path to documentation directory
Patch4:         udav-help-path.patch
# PATCH-FIX-OPENSUSE mathgl-texmf-dir.patch -- set correct path to texmf directory
Patch5:         mathgl-texmf-dir.patch
# PATCH-FIX-OPENSUSE mathgl-oldtexinfo.patch -- fix build with old texinfo
Patch6:         mathgl-oldtexinfo.patch
BuildRequires:  cmake >= 2.8.12
BuildRequires:  desktop-file-utils
BuildRequires:  fltk-devel
BuildRequires:  freeglut-devel
BuildRequires:  gcc-c++
BuildRequires:  giflib-devel
BuildRequires:  gsl-devel
BuildRequires:  hdf5-devel
BuildRequires:  libQtWebKit-devel
BuildRequires:  libharu-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libqt4-devel >= 4.8
%if 0%{?suse_version} >= 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
BuildRequires:  libQt5WebKit5-devel
BuildRequires:  libQt5WebKitWidgets-devel
BuildRequires:  libqt5-qtbase-devel
%endif
BuildRequires:  libtiff-devel
BuildRequires:  libtool
BuildRequires:  lua51-devel
%if 0%{?suse_version} > 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
BuildRequires:  octave-devel
%endif
BuildRequires:  openmpi-devel
BuildRequires:  python-devel
BuildRequires:  python-numpy-devel
BuildRequires:  swig
BuildRequires:  texinfo
BuildRequires:  texlive-filesystem
BuildRequires:  texlive-latex
%if 0%{?suse_version} >= 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
BuildRequires:  wxWidgets-devel >= 3
%else
BuildRequires:  wxWidgets-devel
%define _use_internal_dependency_generator 0
%define __find_requires %wx_requires
%endif

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%if 0%{?fedora_version}
BuildRequires:  fltk-fluid
BuildRequires:  libXmu-devel
BuildRequires:  texi2html
BuildRequires:  texinfo-tex
%define _defaultdocdir %{_datadir}/doc/packages
%endif

%description
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package -n     %{libname}%{libversion}
Summary:        MathGL is a cross-platform library for making high-quality scientific graphics
Group:          System/Libraries
Requires:       %{name}-fonts >= %{version}
# FIXME temporary, octave-mathgl is inconsistent with octave 4.0 due to SWIG
%if 0%{?suse_version} < 1315 || 0%{?suse_version} == 1320
Obsoletes:      octave-mathgl
%endif

%description -n %{libname}%{libversion}
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package -n     %{libname}-mpi%{libversion}
Summary:        MathGL library with MPI support
Group:          System/Libraries

%description -n %{libname}-mpi%{libversion}
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package -n     %{libname}-fltk%{libversion}
Summary:        MathGL FLTK widget library for making high-quality scientific graphics
Group:          System/Libraries

%description -n %{libname}-fltk%{libversion}
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package -n     %{libname}-glut%{libversion}
Summary:        MathGL window library for making high-quality scientific graphics
Group:          System/Libraries

%description -n %{libname}-glut%{libversion}
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package -n     %{libname}-qt4-%{libversion}
Summary:        MathGL Qt4 widget library for making high-quality scientific graphics
Group:          System/Libraries

%description -n %{libname}-qt4-%{libversion}
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package -n     %{libname}-qt5-%{libversion}
Summary:        MathGL Qt5 widget library for making high-quality scientific graphics
Group:          System/Libraries

%description -n %{libname}-qt5-%{libversion}
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package -n     %{libname}-wnd%{libversion}
Summary:        MathGL window library for making high-quality scientific graphics
Group:          System/Libraries

%description -n %{libname}-wnd%{libversion}
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package -n     %{libname}-wx%{libversion}
Summary:        MathGL wxWidget library for making high-quality scientific graphics
Group:          System/Libraries

%description -n %{libname}-wx%{libversion}
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

%package        cgi
Summary:        MathGL CGI binary
Group:          Productivity/Scientific/Other

%description    cgi
This package contains mathGL binary for parsing CGI scripts.

%package        devel
Summary:        Libraries and header files for MathGL library
Group:          Development/Libraries/Other
Requires:       %{libname}%{libversion} = %{version}
Requires:       %{libname}-fltk%{libversion} = %{version}
Requires:       %{libname}-glut%{libversion} = %{version}
Requires:       %{libname}-qt4-%{libversion} = %{version}
%if 0%{?suse_version} >= 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
Requires:       %{libname}-qt5-%{libversion} = %{version}
%endif
Requires:       %{libname}-wnd%{libversion} = %{version}
Requires:       %{libname}-wx%{libversion} = %{version}
Requires:       cmake
%if 0%{?suse_version}
Recommends:     %{name}-doc
%endif

%description    devel
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package contains libraries and header files for developing
applications that use MathGL.

%package        devel-static
Summary:        Static libraries for MathGL library
Group:          Development/Libraries/Other
Requires:       mathgl-devel = %{version}

%description    devel-static
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package contains static libraries for developing applications
that use MathGL.

%package        doc
Summary:        Documentation for MathGL
Group:          Documentation/HTML
BuildArch:      noarch

%description    doc
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package provides the documentation for MathGL in HTML format.

%package        doc-pdf
Summary:        Documentation for MathGL
Group:          Documentation/Other
BuildArch:      noarch

%description    doc-pdf
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package provides the documentation for MathGL in PDF format.

%package        doc-ru
Summary:        Russian documentation for MathGL
Group:          Documentation/Other
Provides:       locale(mathgl-doc:ru)
Requires:       mathgl-doc = %{version}
BuildArch:      noarch

%description    doc-ru
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package provides Russian documentation for MathGL.

%package        examples
Summary:        Examples for %{name} library
Group:          Productivity/Scientific/Other

%description    examples
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package contains examples of using MathGL.

%package        fonts
Summary:        Fonts for MathGL library
Group:          System/X11/Fonts
BuildArch:      noarch

%description    fonts
This package contains command fonts for MathGL library.

%package        lua
Summary:        Lua interface for MathGL library
Group:          Productivity/Scientific/Other

%description    lua
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package provides lua interface for MathGL.

%if 0%{?suse_version} > 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
%package -n     octave-mathgl
Summary:        Octave interface for MathGL library
Group:          Productivity/Scientific/Other
Requires:       octave-cli

%description -n octave-mathgl
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package provides Octave interface for MathGL.
%endif

%package -n     python-mathgl
Summary:        Libraries and header files for MathGL library
Group:          Productivity/Scientific/Other
Requires:       python-base

%description -n python-mathgl
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package provides the python bindings for MathGL.

%package        tex
Summary:        MathGL scripts in LaTeX document
Group:          Productivity/Publishing/TeX/Base
Provides:       tex(mgltex.sty)
Requires:       mathgl-tools >= %{version}
Recommends:     mathgl-tex-doc = %{version}
BuildArch:      noarch
Requires(pre):          texlive
Requires(post):         coreutils
Requires(postun):       coreutils
Requires(postun):       texlive
Requires(posttrans):    texlive

%description    tex
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package allows to use MathGL scripts in LaTeX documents.

%package        tex-doc
Summary:        Documentation for mglTeX
Group:          Productivity/Publishing/TeX/Base
BuildArch:      noarch

%description    tex-doc
MathGL is a cross-platform library for making high-quality scientific
graphics. It provides fast data plotting and handling of large data
arrays, as well as  window and console modes and for easy embedding
into other programs. MathGL integrates into FLTK, Qt and
OpenGL applications.

This package provides documentation for mglTeX.

%package        tools
Summary:        Command line tools for MathGL library
Group:          Productivity/Scientific/Other

%description    tools
This package contains command line tools for making high-quality scientific graphics.

%package -n     udav
Summary:        Data handling and plotting tool
Group:          Productivity/Scientific/Other

%description -n udav
UDAV is cross-platform program for data arrays visualization based
on MathGL library. It support wide spectrum of graphics,
simple script language and visual data handling and editing. It has
window interface for data viewing, changing and plotting.Also it
can execute MGL scripts, setup and rotate graphics and so on.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%if 0%{?suse_version} <= 1320
%patch6 -p1
%endif

# Correct octave-mathgl version
sed -i 's/2.0/%{oct_version}/' lang/DESCRIPTION

# Correct location of numpy/arrayobject.h header file
numpy_h=%{python_sitearch}/numpy/core/include/numpy/arrayobject.h
sed -i "s|<numpy/arrayobject.h>|\"${numpy_h}\"|" lang/numpy.i

# convert EOL encodings, maintaining timestames
sed -i 's/\r$//' AUTHORS README

%build
cmake \
      -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix}  \
      -DMGL_LIB_INSTALL_DIR:PATH=%{_lib}      \
      -DTEXMFDIR:PATH=%{_datadir}/texmf/      \
      -DCMAKE_C_FLAGS="%{optflags}"	      \
      -DCMAKE_CXX_FLAGS="%{optflags}"	      \
      -Denable-double=on                      \
      -Denable-mpi=on                         \
      -Denable-pthread=off                    \
      -Denable-openmp=on                      \
      -Denable-ltdl=on                        \
      -Denable-gsl=on                         \
      -Denable-jpeg=on                        \
      -Denable-png=on                         \
      -Denable-zlib=on                        \
      -Denable-pdf=on                         \
      -Denable-gif=on                         \
      -Denable-hdf5=on                        \
      -Denable-opengl=on                      \
      -Denable-glut=on                        \
      -Denable-fltk=on                        \
      -Denable-wx=on                          \
      -Denable-qt4=on                         \
      %if 0%{?suse_version} >= 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
      -Denable-qt5=on                         \
      %endif
      -Denable-python=on                      \
      -Denable-lua=on                         \
      %if 0%{?suse_version} > 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
      -Denable-octave=on                      \
      %else
      -Denable-octave=off                     \
      %endif
      -Denable-octave-install=off             \
      -Denable-mgltex=on                      \
      -Denable-json-sample=off                \
      -Denable-doc-html=on                    \
      -Denable-doc-pdf-en=on                  \
      %if 0%{?suse_version} <= 1320
      -Denable-texi2html=on                   \
      %endif
      .

make %{?_smp_mflags}

%install
%make_install

%if 0%{?suse_version} > 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}
# # Install octave-mathgl
mkdir -p %{buildroot}%{_libdir}/octave/packages
mkdir -p %{buildroot}%{_datadir}/octave/packages
octave %{octave_args} --eval "pkg prefix %{buildroot}%{_datadir}/octave/packages %{buildroot}%{_libdir}/octave/packages; pkg install lang/%{name}.tar.gz"
# rm %%{buildroot}%%{_datadir}/octave/packages/*/packinfo/.autoload
# remove octave module archive
rm %{buildroot}%{_datadir}/%{name}/%{name}.tar.gz
%endif

# Install docs
install -m 644 {AUTHORS,ChangeLog.txt,README,COPYING} %{buildroot}%{_docdir}/%{name}/
install -m 644 texinfo/{classes.pdf,mgl_en.pdf} %{buildroot}%{_docdir}/%{name}/

# move mgl.cgi
install -d %{buildroot}/srv/www/cgi-bin/
mv %{buildroot}%{_datadir}/%{name}/mgl.cgi %{buildroot}/srv/www/cgi-bin/mgl.cgi

# Qt libraries
rm %{buildroot}%{_libdir}/libmgl-qt.so.%{somajor}
ln -s libmgl-qt4.so.%{somajor} %{buildroot}%{_libdir}/libmgl-qt.so.%{somajor}

# LaTeX package (based on TeXLive spec files)
mkdir -p %{buildroot}/var/adm/update-scripts
ln -sf %{_datadir}/texmf/texconfig/zypper.py \
    %{buildroot}/var/adm/update-scripts/texlive-mgltex-%{version}-%{release}-zypper

# %%post doc
# %%install_info --info-dir=%%{_infodir} %%{_infodir}/%%{name}_en.info.gz
# %%install_info --info-dir=%%{_infodir} %%{_infodir}/%%{name}_en.info-1.gz
# %%install_info --info-dir=%%{_infodir} %%{_infodir}/%%{name}_en.info-2.gz
# 
# %%postun doc
# %%install_info_delete --info-dir=%%_infodir %%{_infodir}/%%{name}_en.info.gz
# %%install_info_delete --info-dir=%%_infodir %%{_infodir}/%%{name}_en.info-1.gz
# %%install_info_delete --info-dir=%%_infodir %%{_infodir}/%%{name}_en.info-2.gz

%post -n %{libname}%{libversion} -p /sbin/ldconfig

%postun -n %{libname}%{libversion} -p /sbin/ldconfig

%post -n %{libname}-mpi%{libversion} -p /sbin/ldconfig

%postun -n %{libname}-mpi%{libversion} -p /sbin/ldconfig

%post -n %{libname}-fltk%{libversion} -p /sbin/ldconfig

%postun -n %{libname}-fltk%{libversion} -p /sbin/ldconfig

%post -n %{libname}-glut%{libversion} -p /sbin/ldconfig

%postun -n %{libname}-glut%{libversion} -p /sbin/ldconfig

%post -n %{libname}-qt4-%{libversion} -p /sbin/ldconfig

%postun -n %{libname}-qt4-%{libversion} -p /sbin/ldconfig

%if 0%{?suse_version} >= 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
%post -n %{libname}-qt5-%{libversion} -p /sbin/ldconfig

%postun -n %{libname}-qt5-%{libversion} -p /sbin/ldconfig
%endif

%post -n %{libname}-wnd%{libversion} -p /sbin/ldconfig

%postun -n %{libname}-wnd%{libversion} -p /sbin/ldconfig

%post -n %{libname}-wx%{libversion} -p /sbin/ldconfig

%postun -n %{libname}-wx%{libversion} -p /sbin/ldconfig

%if 0%{?suse_version} > 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
%post -n octave-mathgl
octave -qf %{octave_args} --eval "pkg rebuild -auto mathgl"

%postun -n octave-mathgl
octave -qf %{octave_args} --eval "pkg rebuild"
%endif

%post tex
mkdir -p /var/run/texlive
> /var/run/texlive/run-mktexlsr
> /var/run/texlive/run-update

%postun tex
if test $1 = 0; then
    %{_bindir}/mktexlsr 2> /dev/null || :
    exit 0
fi
mkdir -p /var/run/texlive
> /var/run/texlive/run-mktexlsr
> /var/run/texlive/run-update

%posttrans tex
test -f /var/run/texlive/run-update || exit 0
test -z "$ZYPP_IS_RUNNING" || exit 0
VERBOSE=false %{_datadir}/texmf/texconfig/update || :
rm -f /var/run/texlive/run-update

%files -n %{libname}%{libversion}
%defattr(-,root,root)
%{_libdir}/libmgl.so.%{somajor}*

%files -n %{libname}-mpi%{libversion}
%defattr(-,root,root)
%{_libdir}/libmgl-mpi.so.%{somajor}*

%files -n %{libname}-fltk%{libversion}
%defattr(-,root,root)
%{_libdir}/libmgl-fltk.so.%{somajor}*

%files -n %{libname}-glut%{libversion}
%defattr(-,root,root)
%{_libdir}/libmgl-glut.so.%{somajor}*

%files -n %{libname}-qt4-%{libversion}
%defattr(-,root,root)
%{_libdir}/libmgl-qt.so.%{somajor}*
%{_libdir}/libmgl-qt4.so.%{somajor}*

%if 0%{?suse_version} >= 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
%files -n %{libname}-qt5-%{libversion}
%defattr(-,root,root)
%{_libdir}/libmgl-qt5.so.%{somajor}*
%endif

%files -n %{libname}-wnd%{libversion}
%defattr(-,root,root)
%{_libdir}/libmgl-wnd.so.%{somajor}*

%files -n %{libname}-wx%{libversion}
%defattr(-,root,root)
%{_libdir}/libmgl-wx.so.%{somajor}*

%files cgi
%defattr(-,root,root)
/srv/www/cgi-bin/mgl.cgi
%{_mandir}/man1/mgl.cgi.1.gz

%files devel
%defattr(-,root,root)
%{_includedir}/mgl2/
%{_libdir}/libmgl*.so
%{_libdir}/cmake/mathgl2/

%files devel-static
%defattr(-,root,root)
%{_libdir}/*.a

%files doc
%defattr(-,root,root)
%dir %{_docdir}/mathgl
%doc %{_docdir}/mathgl/png/
%doc %{_docdir}/mathgl/udav/
%doc %{_docdir}/mathgl/*.html
%exclude %{_docdir}/mathgl/*.pdf
%doc %{_docdir}/mathgl/*.png
%doc %{_docdir}/mathgl/AUTHORS
%doc %{_docdir}/mathgl/ChangeLog.txt
%doc %{_docdir}/mathgl/README
%doc %{_docdir}/mathgl/COPYING
%exclude %{_docdir}/mathgl/mathgl_ru.html
%exclude %{_docdir}/mathgl/mgl_ru.html
# %%{_infodir}/%%{name}_en.info*.gz

%files doc-pdf
%defattr(-,root,root)
%doc %{_docdir}/mathgl/*.pdf

%files doc-ru
%defattr(-,root,root)
%doc %{_docdir}/mathgl/mathgl_ru.html
%doc %{_docdir}/mathgl/mgl_ru.html

%files examples
%defattr(-,root,root)
%{_bindir}/mgl*example

%files fonts
%defattr(-,root,root)
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/fonts/

%files lua
%defattr(-,root,root)
%{_libdir}/mgl-lua.so

%if 0%{?suse_version} > 1320  || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} == 1 )
%files -n octave-mathgl
%defattr(-,root,root)
%{_datadir}/octave/packages/%{name}-%{oct_version}/
%{_libdir}/octave/packages/%{name}-%{oct_version}/
%endif

%files -n python-mathgl
%defattr(-,root,root)
%{python_sitearch}/*

%files tex
%defattr(-,root,root)
%{_datadir}/texmf/tex/latex/mgltex/
/var/adm/update-scripts/texlive-mgltex-%{version}-%{release}-zypper

%files tex-doc
%defattr(-,root,root)
%{_datadir}/texmf/doc/latex/mgltex/

%files tools
%defattr(-,root,root)
%{_bindir}/mglconv
%{_bindir}/mglview
%{_mandir}/man1/mglconv.1.gz
%{_mandir}/man1/mglview.1.gz
%{_mandir}/man5/mgl.5.gz

%files -n udav
%defattr(-,root,root)
%{_bindir}/udav
%{_datadir}/pixmaps/udav.png
%{_datadir}/applications/udav.desktop
%{_datadir}/mime/packages/mgl.xml
%{_datadir}/udav/
%{_mandir}/man1/udav.1.gz

%changelog
openSUSE Build Service is sponsored by