%define octave_api 52 %bcond_without audio %bcond_without gui %bcond_without java Name: octave Epoch: 0 Version: 4.4.1 Release: %mkrel 3 Summary: High-level language for numerical computations License: GPLv3+ Group: Sciences/Mathematics Source0: http://ftp.gnu.org/gnu/octave/%{name}-%{version}.tar.xz Source4: octave-2.1.36-emac.lisp URL: http://www.octave.org/ Obsoletes: octave3 < %{epoch}:%{version}-%{release} Provides: octave3 = %{epoch}:%{version}-%{release} Provides: octave(api) = api-v%{octave_api} Requires: gnuplot # (Anssi) for makeinfo which is needed for "help foo" command: Requires: texinfo Requires: graphicsmagick Requires(post): desktop-file-utils Requires(postun): desktop-file-utils Requires(post): rpm-helper BuildRequires: lzip BuildRequires: bison BuildRequires: blas-devel BuildRequires: dejagnu BuildRequires: desktop-file-utils BuildRequires: emacs BuildRequires: emacs-bin BuildRequires: fftw-devel >= 0:3.0.1 BuildRequires: flex BuildRequires: gcc-gfortran BuildRequires: glpk-devel BuildRequires: gnuplot-nox # (Abel) not strictly needed, but play safe BuildRequires: gperf BuildRequires: hdf5-devel BuildRequires: lapack-devel BuildRequires: pkgconfig(ncurses) BuildRequires: readline-devel BuildRequires: texinfo BuildRequires: texinfo-tex BuildRequires: texlive BuildRequires: pkgconfig(libpcre) BuildRequires: pkgconfig(libcurl) # (Lev) needed to support sparse matrix functionality BuildRequires: suitesparse-devel # (Lev) other useful libraries BuildRequires: qhull-devel BuildRequires: qrupdate-devel # (Lev) for new experimental plotting BuildRequires: fltk-devel BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) # (Mitya) for eigs and svds to work BuildRequires: pkgconfig(arpack) # to make imread more functional BuildRequires: pkgconfig(GraphicsMagick) # (Mitya) GUI %if %{with gui} BuildRequires: pkgconfig(QtCore) BuildRequires: pkgconfig(QtGui) BuildRequires: pkgconfig(QtNetwork) BuildRequires: pkgconfig(QtOpenGL) BuildRequires: qscintilla-qt4-devel %endif # (Mitya) Java interface %if %{with java} BuildRequires: java-devel %endif # (Mitya) rendering stuff BuildRequires: gl2ps-devel BuildRequires: pkgconfig(osmesa) # (Mitya) Audio processing %if %{with audio} BuildRequires: pkgconfig(portaudio-2.0) BuildRequires: pkgconfig(sndfile) %endif # (eatdirt) fix some warnings for icon generation BuildRequires: icoutils BuildRequires: librsvg %description GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language. Octave has extensive tools for solving common numerical linear algebra problems, finding the roots of nonlinear equations, integrating ordinary functions, manipulating polynomials, and integrating ordinary differential and differential-algebraic equations. It is easily extensible and customizable via user-defined functions written in Octave's own language, or using dynamically loaded modules written in C++, C, Fortran, or other languages. %package devel Summary: Development headers and files for Octave Group: Development/C Obsoletes: octave3-devel < %{epoch}:%{version}-%{release} Provides: octave3-devel = %{epoch}:%{version}-%{release} Requires: %{name} = %{epoch}:%{version}-%{release} Requires: blas-devel Requires: fftw-devel Requires: gcc-c++ Requires: gcc-gfortran Requires: hdf5-devel Requires: lapack-devel Requires: readline-devel Requires: zlib-devel Requires: gnuplot-nox Requires: pstoedit Requires: transfig Provides: mkoctfile = %{epoch}:%{version}-%{release} %description devel The octave-devel package contains files needed for developing applications which use GNU Octave. This package is necessary if you intend to install external packages (for example, through Octave forge) in Octave. %package doc Summary: Documentation for Octave, a numerical computational language Group: Sciences/Mathematics BuildArch: noarch %description doc GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language. This package contains documentation of Octave in various formats. %prep %setup -q #this command just returns the API number hardcoded in configure.ac #and ensures that it matches the one defined above OCTAVE_API=`%{__sed} -nr 's/^OCTAVE_API_VERSION="api-v([[:digit:]]+)"/\1/p' configure.ac` test "x${OCTAVE_API}" = x%{octave_api} || exit 1 %{__cp} -a %{SOURCE4} octave.el %build %define enable64 no export CPPFLAGS="%{optflags} -DH5_USE_16_API" export GNUPLOT=%{_bindir}/gnuplot-nox %{configure2_5x} --enable-dl \ --enable-shared \ --disable-static \ --enable-64=%{enable64} \ --with-amd="-lamd -lsuitesparseconfig" \ --with-camd="-lcamd -lsuitesparseconfig" \ --with-colamd="-lcolamd -lsuitesparseconfig" \ --with-ccolamd="-lccolamd -lsuitesparseconfig" # (Mitya) Because of gnuplot-nox used for build, Octave will set it as default gnuplot binary. # Revert it to original gnuplot. #{__sed} -i 's/gnuplot-nox/gnuplot/' scripts/plot/util/gnuplot_binary.m %{make_build} OCTAVE_RELEASE="%{distribution} %{version}-%{release}" LDFLAGS="-lgfortran -llapack -lGL -lGLU -lpthread" # emacs mode %{_bindir}/emacs -batch -q -no-site-file -f batch-byte-compile %{name}.el %check #%%{make} check %install %{make_install} # Make library links %{__mkdir_p} %{buildroot}/etc/ld.so.conf.d /bin/echo "%{_libdir}/octave-%{version}" > %{buildroot}/etc/ld.so.conf.d/octave-%{_arch}.conf # Remove RPM_BUILD_ROOT from ls-R files %{__perl} -pi -e "s,%{buildroot},," %{buildroot}%{_libexecdir}/octave/ls-R %{__perl} -pi -e "s,%{buildroot},," %{buildroot}%{_datadir}/octave/ls-R %{_bindir}/find %{buildroot} -name "*.oct" -print0 | %{_bindir}/xargs -t -0 -r strip --strip-unneeded %{__mkdir_p} %{buildroot}%{_sysconfdir}/emacs/site-start.d %{__cp} -a %{name}.elc %{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.elc %{__cp} -a %{name}.el %{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.el # prepare documentation %{__rm} -rf package-doc %{__mkdir_p} package-doc %{__mkdir_p} package-doc/interpreter/octave.html/ /bin/ln doc/interpreter/octave.html/*.html package-doc/interpreter/octave.html/ %{__mkdir_p} package-doc/liboctave/liboctave.html/ /bin/ln doc/liboctave/liboctave.html/*.html package-doc/liboctave/liboctave.html/ %{__mkdir_p} package-doc/examples %{__cp} -a examples/[[:lower:]]* package-doc/examples/ %{__cp} -a doc/liboctave/liboctave.info %{buildroot}%{_infodir}/ # Create desktop file %{__mv} %{buildroot}%{_datadir}/applications/org.octave.Octave.desktop \ %{buildroot}%{_datadir}/applications/octave.desktop %{_bindir}/desktop-file-install --add-category Education --remove-category Development \ --dir %{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/octave.desktop # Create directories for add-on packages HOST_TYPE=`%{buildroot}%{_bindir}/octave-config -p CANONICAL_HOST_TYPE` %{__mkdir_p} %{buildroot}%{_libexecdir}/octave/site/oct/%{octave_api}/$HOST_TYPE %{__mkdir_p} %{buildroot}%{_libexecdir}/octave/site/oct/$HOST_TYPE %{__mkdir_p} %{buildroot}%{_datadir}/octave/packages /bin/touch %{buildroot}%{_datadir}/octave/octave_packages #multiarch_includes %{buildroot}%{_includedir}/octave-%{version}/octave/config.h %multiarch_includes %{buildroot}%{_includedir}/octave-%{version}/octave/*.h %post %create_ghostfile %{_datadir}/octave/octave_packages root root 0664 %files %defattr(0644,root,root,0755) %doc NEWS* README %doc examples %defattr(-,root,root,0755) %{_bindir}/octave* %config(noreplace) /etc/ld.so.conf.d/* %{_libdir}/octave* %{_datadir}/octave %{_datadir}/metainfo/org.octave.Octave.appdata.xml %{_datadir}/icons/*/*/apps/octave.png %{_datadir}/icons/*/*/apps/octave.svg %exclude %{_datadir}/octave/octave_packages %ghost %{_datadir}/octave/octave_packages %if "%{_libdir}" != "%{_libexecdir}" %{_libexecdir}/octave %endif %{_mandir}/man*/octave* %{_infodir}/octave.info* %{_datadir}/applications/* %config(noreplace) %_sysconfdir/emacs/site-start.d/octave.el* %files devel %defattr(0644,root,root,0755) #%%doc doc/liboctave %defattr(-,root,root) %{_bindir}/mkoctfile* %{_includedir}/octave-%{version} %dir %{multiarch_includedir}/octave-* %multiarch %{multiarch_includedir}/octave-*/octave/*.h %multiarch %{multiarch_includedir}/octave-*/octave/*.cc %{_mandir}/man*/mkoctfile* %files doc %defattr(0644,root,root,0755) %doc doc/refcard/*.pdf %doc doc/interpreter/*.pdf %doc doc/liboctave/*.pdf %doc package-doc/* %{_infodir}/liboctave.*