File octave.spec of Package octave

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


# gnuplot 0 -> use native graphics (didn't worked to me, TODO)
%define gnuplot 0

Name:           octave
Version:        3.6.2
Release:        0
License:        GPL-3.0+
Summary:        A High Level Programming Language
%define apiver  v48+
Url:            http://www.octave.org/
Group:          Productivity/Scientific/Math
Source:         %{name}-%{version}.tar.bz2
BuildRequires:  bison
BuildRequires:  dejagnu
BuildRequires:  flex
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  gcc-fortran
BuildRequires:  glpk-devel
BuildRequires:  gmp-devel
BuildRequires:  gperf
BuildRequires:  hdf5-devel
BuildRequires:  liblcms-devel
BuildRequires:  pcre-devel
BuildRequires:  pkg-config
BuildRequires:  qhull-devel
BuildRequires:  qrupdate-devel
BuildRequires:  readline-devel
BuildRequires:  termcap
BuildRequires:  texlive-devel
BuildRequires:  texlive-latex
BuildRequires:  zlib-devel
BuildRequires:  fftw3-devel
BuildRequires:  libMagick++-devel
BuildRequires:  libcurl-devel
BuildRequires:  xorg-x11-libSM-devel
BuildRequires:  xorg-x11-libX11-devel
BuildRequires:  xorg-x11-libXext-devel
BuildRequires:  suitesparse-devel
BuildRequires:  blas-devel
BuildRequires:  lapack-devel
%if %{gnuplot} == 0
# for native graphics
BuildRequires:  Mesa-devel
BuildRequires:  fltk-devel
BuildRequires:  fontconfig-devel
BuildRequires:  xorg-x11-devel
%else
BuildRequires:  gnuplot
Requires:       gnuplot
%endif
Requires:       gcc-fortran
Requires:       texinfo
Recommends:     blas-devel
Recommends:     fftw3
Recommends:     fftw3-devel
Recommends:     fftw3-threads
Recommends:     fftw3-threads-devel
Recommends:     gcc
Recommends:     hdf5
Recommends:     libhdf5-devel
Recommends:     make
Recommends:     octave-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Octave is a high level programming language. It is designed for the
solution of numeric problems. There is a command line interface
supplied.

%package devel
Summary:        Development files for octave
Group:          Productivity/Scientific/Math
Requires:       %{name} = %{version}

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

%prep
%setup -q

%build
export CPPFLAGS="-DH5_USE_16_API"
%configure --libexecdir=%{_libdir} --with-magick=ImageMagick --with-umfpack="-lumfpack -lcholmod -lcolamd -llapack"
make

%install
%makeinstall
# see bnc#557340
mkdir -p %{buildroot}/%{_sysconfdir}/ld.so.conf.d
echo %{_libdir}/%{name}-%{version} > %{buildroot}/%{_sysconfdir}/ld.so.conf.d/%{name}.conf
rm %{buildroot}/%{_libdir}/%{name}/%{version}/*.la

%clean
rm -rf %{buildroot}

%post
/sbin/ldconfig
%install_info --info-dir=%{_infodir} %{_infodir}/octave.info.gz

%postun
/sbin/ldconfig
%install_info_delete --info-dir=%{_infodir} %{_infodir}/octave.info.gz

%files
%defattr(-,root,root,-)
%doc AUTHORS BUGS COPYING NEWS
%doc README ChangeLog etc
%doc doc/interpreter/octave.pdf doc/liboctave/liboctave.pdf
%doc doc/refcard/refcard-a4.pdf doc/refcard/refcard-legal.pdf
%doc doc/refcard/refcard-legal.pdf
%doc %{_infodir}/*.gz
%doc %{_mandir}/man1/*.gz
%{_bindir}/*
%config %{_sysconfdir}/ld.so.conf.d/%{name}.conf
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/%{version}
%{_libdir}/%{name}/%{version}/oct
%{_libdir}/%{name}/%{version}/lib*.so.*
%{_datadir}/octave/
%{_libdir}/%{name}/site

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/%{name}/%{version}/lib*.so
%{_libdir}/%{name}/api-%{apiver}

%changelog