octave 7.2.0-2 (znver1;aarch64;x86_64) 2022-15266
10002

Status published
Submitter mandian [@T] tutanota.com
Platform rolling
Repository unsupported
URL https://abf.openmandriva.org/build_lists/234979
Packages
octave-7.2.0-2.znver1.source
octave-7.2.0-2.znver1.binary
octave-debuginfo-7.2.0-2.znver1.debuginfo
octave-debugsource-7.2.0-2.znver1.binary
octave-devel-7.2.0-2.znver1.binary
octave-doc-7.2.0-2.znver1.binary
octave-7.2.0-2.aarch64.source
octave-7.2.0-2.aarch64.binary
octave-debuginfo-7.2.0-2.aarch64.debuginfo
octave-debugsource-7.2.0-2.aarch64.binary
octave-devel-7.2.0-2.aarch64.binary
octave-doc-7.2.0-2.aarch64.binary
octave-7.2.0-2.x86_64.source
octave-7.2.0-2.x86_64.binary
octave-debuginfo-7.2.0-2.x86_64.debuginfo
octave-debugsource-7.2.0-2.x86_64.binary
octave-devel-7.2.0-2.x86_64.binary
octave-doc-7.2.0-2.x86_64.binary
Build Date 2022-09-26 17:00:42 +0000 UTC
Last Updated 2022-09-30 15:57:27.395331975 +0000 UTC
$ git diff --patch-with-stat --summary fbd354f2b6ee5592a23252780abc0feda241f6ba..c6064c39ba289cc7a1735b92dbb8ba696074f15c

 .abf.yml           |  2 +-
 check-update.sh    |  2 ++
 octave-java2.patch | 19 +++++++++++
 octave.macros      | 63 ++++++++++++++++++++++++------------
 octave.spec        | 93 +++++++++++++++++++++++++++++++++++++++---------------
 5 files changed, 131 insertions(+), 48 deletions(-)
 create mode 100755 check-update.sh
 create mode 100644 octave-java2.patch

diff --git a/.abf.yml b/.abf.yml
index a501fa6..c041100 100644
--- a/.abf.yml
+++ b/.abf.yml
@@ -1,2 +1,2 @@
 sources:
-  octave-6.4.0.tar.xz: 5257b286cad4b1944fde5568207dbf6024d7600b
+  octave-7.2.0.tar.xz: 15cf0629355b8baff7ed24ec28bce01783a9e5f2
diff --git a/check-update.sh b/check-update.sh
new file mode 100755
index 0000000..b740b0d
--- /dev/null
+++ b/check-update.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+curl https://www.octave.org/download 2>/dev/null |grep 'is the latest stable release' |sed -e 's,</strong>.*,,;s,.* ,,'
diff --git a/octave-java2.patch b/octave-java2.patch
new file mode 100644
index 0000000..79fc0f6
--- /dev/null
+++ b/octave-java2.patch
@@ -0,0 +1,19 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -2446,12 +2446,12 @@
+   AC_MSG_CHECKING([for Java version])
+   java_version=[`"$JAVA" -version 2>&1 | $SED -n -e 's/^[^ ]* version[^0-9"]*"\([^"]*\)".*/\1/p'`]
+   AC_MSG_RESULT([$java_version])
+-  java_major=[`echo $java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\1/'`]
+-  java_minor=[`echo $java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\2/'`]
+-  if test $java_major -gt 1 || (test $java_major -eq 1 && test $java_minor -ge 5); then
++  java_major=[`echo $java_version | $SED -e 's/^\([0-9][0-9]*\).*$/\1/'`]
++  #java_minor=[`echo $java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\2/'`]
++  if test $java_major -gt 2; then
+     :  # Version is OK.  Do nothing.
+   else
+-    warn_java="Java version is too old (< 1.5).  Octave will not be able to call Java methods."
++    warn_java="Java version is too old (< 2).  Octave will not be able to call Java methods."
+     break
+   fi
+ 
diff --git a/octave.macros b/octave.macros
index 03510c2..1438fe8 100644
--- a/octave.macros
+++ b/octave.macros
@@ -9,56 +9,77 @@
 %octarchprefix %{_libdir}/octave/packages
 %octpkgdir %{octprefix}/%{octpkg}-%{version}
 %octpkglibdir %{octarchprefix}/%{octpkg}-%{version}
-%octhost %(octave-config -p CANONICAL_HOST_TYPE || echo 0)
 
 # Run an octave command - quietly with no startup files
 %octave_cmd() octave -H -q --no-window-system --no-site-file --eval '%*';
 
+# For compiled tarfile name
+%octave_host %(octave-config -p CANONICAL_HOST_TYPE || echo 0)
+
 # Build unpacked source directory into a package tar file in a temporary location
-#octave_pkg_build %octave_cmd pkg build '-verbose' '-nodeps' %{_tmppath}/%{name}-%{version}-%{release}.%{_arch} %{_builddir}/%{buildsubdir}
 # Pass -T to use source tarball
 %octave_pkg_build(T) %{lua: 
-  if (rpm.expand("%{-T}") == "") then
-    octpkg_tarfile = rpm .expand("%{_tmppath}/%{octpkg}-%{version}.tar.gz")
-    print("tar czf "..octpkg_tarfile.." -C "..rpm.expand("%{_builddir} %{buildsubdir}").."\\n")
-  else
+  if (rpm.expand("%{-T}") == "-T") then
     octpkg_tarfile = rpm.expand("%{SOURCE0}")
-  end
-  -- print(rpm.expand("%octave_cmd pkg build -verbose -nodeps %{_builddir}/%{buildsubdir} "..octpkg_tarfile).."\\n")
-  print(rpm.expand("octave -H -q --no-window-system --no-site-file --eval 'pkg build -verbose -nodeps %{_builddir}/%{buildsubdir} "..octpkg_tarfile).."'\\n")
-  -- Define %octave_tar_suffix according to arch
-  if (rpm.expand("%{?buildarch}") ~= "noarch") then
-    rpm.define("octave_tar_suffix %{octhost}-%{octave_api}")
   else
-    rpm.define("octave_tar_suffix any-none")
+    octpkg_tarfile = rpm.expand("%{_tmppath}/%{octpkg}-%{version}.tar.gz")
+    print("tar czf "..octpkg_tarfile.." -C "..rpm.expand("%{_builddir} %{buildsubdir}").."\\n")
   end
-  -- Extract the build tarball for debuginfo generation
-  print(rpm.expand("tar xf %{octpkg}-%{version}-%{octave_tar_suffix}.tar.gz\\n"))
+  -- Avoid a warning from pkg build about making the build directory
+  -- and use a clean directory as octave pkg build will delete contents
+  print(rpm.expand("mkdir -p %{_builddir}/%{buildsubdir}/build\\n"))
+  -- This fails to keep the arguments to %octave_cmd for some reason
+  -- print(rpm.expand("%octave_cmd pkg build -verbose -nodeps %{_builddir}/%{buildsubdir} "..octpkg_tarfile).."\\n")
+  print(rpm.expand("octave -H -q --no-window-system --no-site-file --eval 'pkg build -verbose -nodeps %{_builddir}/%{buildsubdir}/build "..octpkg_tarfile).."'\\n")
+  -- Extract the source tarball for debuginfo generation
+  print(rpm.expand("tar xf "..octpkg_tarfile.." -C %{_builddir}/%{buildsubdir}/build\\n"))
 }
 
 # Install a package.  We use the octave pkg install command to install the
 # built package into the buildroot.  We also put a note to prevent the root
 # user from removing the package with the octave pkg uninstall command
+# We call unlink to remove the 'octave_packages' file which contains the
+# buildroot string and needs to be generated at package install time.
 %octave_pkg_install \
-mkdir -p %{buildroot}/%{octprefix} \
-mkdir -p %{buildroot}/%{octarchprefix} \
-%octave_cmd pkg("prefix","%{buildroot}/%{octprefix}","%{buildroot}/%{octarchprefix}");pkg("global_list",fullfile("%{buildroot}/%{octshareprefix}","octave_packages"));pkg("local_list",fullfile("%{buildroot}/%{octshareprefix}","octave_packages"));pkg("install","-nodeps","-verbose","%{_builddir}/%{buildsubdir}/%{octpkg}-%{version}-%{octave_tar_suffix}.tar.gz");unlink(pkg("local_list"));unlink(pkg("global_list")); \
+mkdir -p %{buildroot}%{octprefix} \
+mkdir -p %{buildroot}%{octarchprefix} \
+%octave_cmd pkg("prefix","%{buildroot}%{octprefix}","%{buildroot}%{octarchprefix}");pkg("global_list",fullfile("%{buildroot}%{octshareprefix}","octave_packages"));pkg("local_list",fullfile("%{buildroot}%{octshareprefix}","octave_packages"));pkg("install","-nodeps","-verbose",glob("%{_builddir}/%{buildsubdir}/build/%{octpkg}-%{version}-*.tar.gz"){1,1});unlink(pkg("local_list"));unlink(pkg("global_list")); \
 if [ -e %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m ] \
 then \
-    mv %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m.orig \
+  mv %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m.orig \
 fi \
 echo "function on_uninstall (desc)" > %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
-echo "  error ('Can not uninstall %s installed by the openmandriva package manager', desc.name);" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
+echo "# This function is used to handle packages installed by admin through %{vendor} package manager." >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
+echo "  error ('Can not uninstall %s installed by the %{vendor} package manager', desc.name);" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
 echo "endfunction" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
+if [ -e %{_builddir}/%{buildsubdir}/build/%{octpkg}-%{version}/*.metainfo.xml ] \
+then \
+  echo "Found .metainfo.xml appdata file" \
+  mkdir -p %{buildroot}/%{_metainfodir} \
+  cp -p %{_builddir}/%{buildsubdir}/build/%{octpkg}-%{version}/*.metainfo.xml %{buildroot}/%{_metainfodir}/ \
+  appstream-util validate-relax --nonet %{buildroot}/%{_metainfodir}/*.metainfo.xml \
+else \
+  echo "Did not find a .metainfo.xml appdata file" \
+fi \
+%{nil}
+
+# Run pkg tests - We need to reinstall to recreate 'octave_packages' so that
+# octave can find the package, then remove 'octave_packages' again, and re-strip
+# any shared objects.
+%octave_pkg_check \
+%octave_cmd pkg("prefix","%{buildroot}%{octprefix}","%{buildroot}%{octarchprefix}");pkg("local_list",fullfile("%{buildroot}%{octshareprefix}","octave_packages"));pkg("list");pkg("install","-verbose",glob("%{_builddir}/%{buildsubdir}/build/%{octpkg}-%{version}-*.tar.gz"){1,1});pkg("load","%{octpkg}");pkg("list");oruntests("%{buildroot}%{octpkgdir}");unlink(pkg("local_list")); \
+/usr/lib/rpm/brp-strip %{__strip} \
 %{nil}
 
 # preun script - we need to remove our uninstall protection and perhaps
 # run the package's own uninstall script.
 %octave_pkg_preun \
-rm %{octpkgdir}/packinfo/on_uninstall.m \
 if [ -e %{octpkgdir}/packinfo/on_uninstall.m.orig ]; then \
   mv %{octpkgdir}/packinfo/on_uninstall.m.orig %{octpkgdir}/packinfo/on_uninstall.m \
   cd %{octpkgdir}/packinfo \
   %octave_cmd l=pkg("list");on_uninstall(l{cellfun(@(x)strcmp(x.name,"%{octpkg}"),l)}); \
+else \
+  echo > %{octpkgdir}/packinfo/on_uninstall.m \
 fi \
 %{nil}
+
diff --git a/octave.spec b/octave.spec
index 386eb10..550e546 100644
--- a/octave.spec
+++ b/octave.spec
@@ -1,26 +1,29 @@
-%global octave_api api-v56
+# Can't mix clang (C/C++) and gcc (fortran) when using LTO
 %global _disable_lto 1
 
-%bcond_without	atlas
-%bcond_with	docs
+%global octave_api api-v57
+
+%bcond_with	atlas
+%bcond_without	docs
 %bcond_without	java
 %bcond_with	jit
 %bcond_without	64bit_support
 
 Summary:	High-level language for numerical computations
 Name:		octave
-Version:	6.4.0
-Release:	1
+Version:	7.2.0
+Release:	2
 License:	GPLv3+
 Group:		Sciences/Mathematics
 Url:		https://www.octave.org/
 Source0:	https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
+# from fedora with slight modification
 Source10:	%{name}.macros
 Source20:	octave-2.1.36-emac.lisp
 # Based on https://hg.savannah.gnu.org/hgweb/octave/raw-rev/b876de975edf
-Patch0:		octave-sundials6.patch
-# fix usage of bsdtar with unpack
-#Patch1:		octave-4.2.0-bsdtar.patch
+#Patch0:		octave-sundials6.patch
+# fix java check
+Patch1:		octave-java2.patch
 # This patch is required when installing all sagemath dependencies,
 # otherwise it will fail with a message like:
 #
@@ -43,10 +46,11 @@ BuildRequires:	ghostscript-devel
 BuildRequires:	gl2ps-devel
 BuildRequires:	glpk-devel
 BuildRequires:	gnuplot
+BuildRequires:	gomp-devel
 BuildRequires:	gperf
 BuildRequires:	hdf5-devel
 %if %{with java}
-BuildRequires:	java-devel
+BuildRequires:	jdk-current
 #BuildRequires:	javapackages-local
 %endif
 BuildRequires:	icoutils
@@ -75,6 +79,7 @@ BuildRequires:	pkgconfig(libcurl)
 BuildRequires:	pkgconfig(lapack)
 BuildRequires:	pkgconfig(libpcre)
 BuildRequires:	pkgconfig(ncurses)
+#BuildRequires:	pkgconfig(ompi)
 #BuildRequires:	pkgconfig(osmesa)
 BuildRequires:	pkgconfig(pixman-1)
 BuildRequires:	pkgconfig(portaudio-2.0)
@@ -85,9 +90,12 @@ BuildRequires:	pkgconfig(Qt5OpenGL)
 BuildRequires:	pkgconfig(Qt5PrintSupport)
 BuildRequires:	pkgconfig(Qt5Help)
 BuildRequires:	pkgconfig(Qt5Xml)
+BuildRequires:	pkgconfig(RapidJSON)
 BuildRequires:	pkgconfig(readline)
 BuildRequires:	pkgconfig(sndfile)
+BuildRequires:	pkgconfig(xcursor)
 BuildRequires:	pkgconfig(xext)
+BuildRequires:	pkgconfig(xfixes)
 BuildRequires:	pkgconfig(xft)
 BuildRequires:	pkgconfig(xinerama)
 BuildRequires:	pkgconfig(xrender)
@@ -135,17 +143,23 @@ C++, C, Fortran, or other languages.
 %doc examples INSTALL.OCTAVE
 %config(noreplace) %{_sysconfdir}/ld.so.conf.d/octave-*.conf
 %{_bindir}/%{name}*
-%{_libdir}/%{name}/site
+%dir %{_libdir}/octave/
+%dir %{_libdir}/octave/%{version}
+#{_libdir}/%{name}/site
 %{_libdir}/%{name}/%{version}/oct
 %{_libdir}/%{name}/%{version}/site
+%{_libdir}/%{name}/%{version}/mkoctfile-%{version}
+%{_libdir}/%{name}/%{version}/octave-config-%{version}
 %{_libdir}/%{name}/%{version}/*.so.*
+%{_libdir}/%{name}/packages/
+%{_libdir}/%{name}/site/
 %{_libexecdir}/%{name}/
-%{_datadir}/applications/*
+%{_datadir}/applications/*.desktop
 %{_datadir}/icons/hicolor/*/apps/%{name}.png
 %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
 %{_datadir}/metainfo/org.octave.Octave.appdata.xml
 %dir %{_datadir}/%{name}
-%{_datadir}/%{name}/%{version}%{?rctag}/
+%{_datadir}/%{name}/%{version}/
 %{_datadir}/%{name}/ls-R
 %ghost %{_datadir}/%{name}/octave_packages
 %{_datadir}/%{name}/packages/
@@ -236,6 +250,10 @@ This package contains documentation of Octave in various formats.
 %autosetup -p1
 
 %build
+# FIXME: lingnu fails with clang compiler
+export CC=gcc
+export CXX=g++
+
 %configure \
 	--enable-shared \
 	--disable-static \
@@ -252,25 +270,44 @@ This package contains documentation of Octave in various formats.
 # lrelease doesn't require -qt option
 sed -i -e 's|LRELEASEFLAGS="-qt=\$qt_version"|LRELEASEFLAGS=""|g' ./configure
 
-%make_build OCTAVE_RELEASE="%{distribution} %{version}-%{release}"
+%make_build OCTAVE_RELEASE="%{version}-%{release} by %{distribution}"
+
+# docs
+%if %{with docs}
+	export TEXINFO_XS_PARSER=0
+	make html info pdf
+%endif
 
 %install
-%make_install || :
+%make_install
 
 # docs
 %if %{with docs}
-	%make install-data install-html install-info install-pdf DESTDIR=%{buildroot}
+	export TEXINFO_XS_PARSER=0
+	make install-data install-html install-info install-pdf DESTDIR=%{buildroot}
 %endif
 
 # Make library links
-install -dm 0755 %{buildroot}/etc/ld.so.conf.d
-/bin/echo "%{_libdir}/octave-%{version}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
-
-# Remove RPM_BUILD_ROOT from ls-R files
-perl -pi -e "s,%{buildroot},," %{buildroot}%{_libexecdir}/%{name}/ls-R
-perl -pi -e "s,%{buildroot},," %{buildroot}%{_datadir}/%{name}/ls-R
+install -dm 0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d
+/bin/echo "%{_libdir}/%{name}/%{version}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
+
+# FIXME: octave can't find his libraries when building octave add-on packages
+mv %{buildroot}%{_bindir}/octave-config-%{version} %{buildroot}%{_libdir}/%{name}/%{version}/octave-config-%{version}
+ln -s %{_libdir}/%{name}/%{version}/octave-config-%{version} %{buildroot}%{_bindir}/octave-config-%{version}
+mv %{buildroot}%{_bindir}/mkoctfile-%{version} %{buildroot}%{_libdir}/%{name}/%{version}/mkoctfile-%{version}
+cat > %{buildroot}%{_bindir}/mkoctfile-%{version} <<EOF
+#!/bin/bash
+exec %{_libdir}/%{name}/%{version}/mkoctfile-%{version} -L%{_libdir}/%{name}/%{version} "\$@"
+EOF
+chmod +x %{buildroot}%{_bindir}/mkoctfile-%{version}
+
+# remove RPM_BUILD_ROOT from ls-R files
+#touch %{buildroot}%{_libexecdir}/%{name}/ls-R
+#sed -i -e "s|%{buildroot}||g" %{buildroot}%{_libexecdir}/%{name}/ls-R
 touch %{buildroot}%{_datadir}/%{name}/ls-R
+sed -i -e "s|%{buildroot}||g" %{buildroot}%{_datadir}/%{name}/ls-R
 
+# strip .oct files
 %{_bindir}/find %{buildroot} -name "*.oct" -print0 | %{_bindir}/xargs -t -0 -r strip --strip-unneeded
 
 # .desktop
@@ -281,13 +318,17 @@ desktop-file-install \
 	%{buildroot}%{_datadir}/applications/org.octave.Octave.desktop
 
 # packages
-HOST_TYPE=`%{buildroot}%{_bindir}/octave-config -p CANONICAL_HOST_TYPE`
-install -dm 0755 %{buildroot}%{_libexecdir}/octave/site/oct/%{octave_api}/$HOST_TYPE
-install -dm 0755 %{buildroot}%{_libexecdir}/octave/site/oct/$HOST_TYPE
-install -dm 0755 %{buildroot}%{_datadir}/octave/packages/
+HOST_TYPE=`%{buildroot}%{_libdir}/%{name}/%{version}/octave-config-%{version} -p CANONICAL_HOST_TYPE`
+install -dm 0755 %{buildroot}%{_libdir}/%{name}/site/oct/%{octave_api}/$HOST_TYPE
+install -dm 0755 %{buildroot}%{_libdir}/%{name}/site/oct/$HOST_TYPE
+install -dm 0755 %{buildroot}%{_libdir}/%{name}/packages
+install -dm 0755 %{buildroot}%{_datadir}/%{name}/packages
 /bin/touch %{buildroot}%{_datadir}/octave/octave_packages
 
-# rpm
+# rpm macros
 install -dm 0755 %{buildroot}%{_sysconfdir}/rpm/macros.d/
 install -pm 0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/rpm/macros.d/%{name}.macros
 
+# remove static lib stuff
+find %{buildroot}%{_libdir} -name \*.la -delete
+
Not Available

mandian [@T] tutanota.comNo Comment.61d 18hrs
benbullard79 [@T] cox.netNo Comment.61d 00hrs
benbullard79 [@T] cox.netNo Comment.61d 00hrs