%define octave_api 59 %define major 11 %define majorinterp 12 %define guimajor 10 %bcond_without audio %bcond_without gui %bcond_without java %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: octave Epoch: 0 Version: 9.1.0 Release: %mkrel 1 Summary: High-level language for numerical computations License: GPLv3+ Group: Sciences/Mathematics URL: https://www.octave.org/ Source0: https://ftp.gnu.org/gnu/octave/%{name}-%{version}.tar.xz Source1: macros.octave Source4: octave-2.1.36-emac.lisp # Patch from https://savannah.gnu.org/bugs/?54607, merged from opensuse # (see https://savannah.gnu.org/bugs/download.php?file_id=48434 Patch0: 0001-Disable-signal-handler-thread-avoid-duplicate-signal.patch # fix output for pslatexstandalone or pdflatexstandalone Patch1: 0001-Fix-amsmath-required-package-in-pslatexstandalone-or.patch # from git upstream Obsoletes: octave3 < %{epoch}:%{version}-%{release} Provides: octave3 = %{epoch}:%{version}-%{release} Provides: octave(api) = api-v%{octave_api} Recommends: gnuplot # Required for exporting in EPS from GUI plot Requires: epstool # (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 #(eatdirt) qtoctave is dead, does not work with this version and #octave now provides octave --gui Obsoletes: qtoctave <= 0.10.1 Provides: qtoctave = %{version}-%{release} 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: pkgconfig(readline) BuildRequires: texinfo BuildRequires: texinfo-tex BuildRequires: texlive BuildRequires: pkgconfig(libpcre2-8) BuildRequires: pkgconfig(libcurl) # (Lev) needed to support sparse matrix functionality BuildRequires: suitesparse-devel >= 5.0 # (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) # build against Qt6 %if %{with gui} BuildRequires: pkgconfig(Qt6Core) BuildRequires: pkgconfig(Qt6Gui) BuildRequires: pkgconfig(Qt6Network) BuildRequires: pkgconfig(Qt6OpenGL) BuildRequires: pkgconfig(Qt6OpenGLWidgets) BuildRequires: pkgconfig(Qt6PrintSupport) BuildRequires: pkgconfig(Qt6Help) BuildRequires: pkgconfig(Qt6Xml) BuildRequires: pkgconfig(Qt6Core5Compat) BuildRequires: qscintilla-qt6-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 BuildRequires: sundials-devel # For JSON support. # There were issues with rapidjson and prettywriter requirements; ensure to have the patched package: # (see https://github.com/Tencent/rapidjson/issues/909 and https://github.com/Tencent/rapidjson/issues/1718) BuildRequires: pkgconfig(RapidJSON) >= 1.1.0-6 %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 # beware: for correct building function uncompress2() is required in zlib which is # available since zlib 1.2.12. # (mga8's zlib have, however, removed uncompress2() function from its zlib-1.2.12) Requires: zlib-devel >= 1.2.12 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 %autopatch -p1 #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 # flag to control building octave with 64bit array indexes %define enable64 no export CPPFLAGS="%{optflags} -DH5_USE_16_API" export GNUPLOT=%{_bindir}/gnuplot-nox export JAVA_HOME="%{_prefix}/lib/jvm/java" export EGREP="grep -E" %{configure} \ --enable-shared \ --disable-static \ --enable-64=%{enable64} \ --with-amd="-lamd -lsuitesparseconfig" \ --with-camd="-lcamd -lsuitesparseconfig" \ --with-colamd="-lcolamd -lsuitesparseconfig" \ --with-ccolamd="-lccolamd -lsuitesparseconfig" \ --enable-link-all-dependencies \ --disable-rpath \ --with-qrupdate \ --with-cxsparse \ --disable-docs ##(eatdirt) --with-gnu-ld enable-link-dep is required to import and ##compile octave third party packages. See bug 25616 # (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 %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/*.h #(eatdirt) remove .la files find %{buildroot}%{_libdir} -name "*.la" -delete echo %{buildroot}%{_libdir} #(eatdirt) trigger libification with symlinks (thanks tv) pushd %{buildroot}%{_libdir} ln -s ./octave/%{version}/liboctave.so liboctave.so ln -s ./octave/%{version}/liboctinterp.so liboctinterp.so ln -s ./octave/%{version}/liboctgui.so liboctgui.so popd # rpm macros mkdir -p %{buildroot}%{macrosdir} cp -p %SOURCE1 %{buildroot}%{macrosdir} %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/* #(eatdirt) fix packaging of libraries (.so files go to devel) %{_libdir}/octave/site %{_libdir}/octave/%{version}/oct %{_libdir}/octave/%{version}/liboctave.so.%{major}{,.*} %{_libdir}/octave/%{version}/liboctinterp.so.%{majorinterp}{,.*} %{_libdir}/octave/%{version}/liboctgui.so.%{guimajor}*{,.*} %{_datadir}/octave %{_datadir}/metainfo/org.octave.Octave.metainfo.xml %{_datadir}/icons/*/*/apps/octave.png %{_datadir}/icons/*/*/apps/octave.svg %exclude %{_datadir}/octave/octave_packages %ghost %{_datadir}/octave/octave_packages #(eatdirt) why should they be the same? #if "#{_libdir}" != "#{_libexecdir}" #{_libexecdir}/octave #endif %{_libexecdir}/octave #{_mandir}/man*/octave* #{_infodir}/octave.info* %{_datadir}/applications/* %config(noreplace) %_sysconfdir/emacs/site-start.d/octave.el* %files devel %{macrosdir}/macros.octave %{_bindir}/mkoctfile* %{_libdir}/pkgconfig/*.pc #(eatdirt) adding library devel files %{_libdir}/octave/%{version}/*.so %{_libdir}/*.so %{_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.*