From af0420f223186a64e7bcdf46dece8a3a876585e9 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Dec 07 2016 18:01:23 +0000 Subject: Use 'octave-config -p CANONICAL_HOST_TYPE' in macros --- diff --git a/macros.octave b/macros.octave index be6981a..74626c8 100644 --- a/macros.octave +++ b/macros.octave @@ -13,6 +13,9 @@ # 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 # Pass -T to use source tarball %octave_pkg_build(T) %{lua: @@ -25,7 +28,7 @@ -- 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") -- Extract the build tarball for debuginfo generation - print(rpm.expand("tar xf %{octpkg}-%{version}-%{_host}-%{octave_api}.tar.gz\\n")) + print(rpm.expand("tar xf %{octpkg}-%{version}-%{octave_host}-%{octave_api}.tar.gz\\n")) } # Install a package. We use the octave pkg install command to install the @@ -36,7 +39,7 @@ %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","%{octpkg}-%{version}-%{_host}-%{octave_api}.tar.gz");unlink(pkg("local_list"));unlink(pkg("global_list")); \ +%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","%{octpkg}-%{version}-%{octave_host}-%{octave_api}.tar.gz");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 \ @@ -49,7 +52,7 @@ echo "endfunction" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \ # Run pkg tests - We need to reinstall to recreate 'octave_packages' so that # octave can find the package, then remove 'octave_packages' again. %octave_pkg_check \ -%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","%{octpkg}-%{version}-%{_host}-%{octave_api}.tar.gz");pkg("load","%{octpkg}");runtests("%{buildroot}%{octpkgdir}");unlink(pkg("local_list"));unlink(pkg("global_list")); \ +%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","%{octpkg}-%{version}-%{octave_host}-%{octave_api}.tar.gz");pkg("load","%{octpkg}");runtests("%{buildroot}%{octpkgdir}");unlink(pkg("local_list"));unlink(pkg("global_list")); \ %{nil} # preun script - we need to remove our uninstall protection and perhaps diff --git a/octave.spec b/octave.spec index cc3debf..2af1d05 100644 --- a/octave.spec +++ b/octave.spec @@ -14,7 +14,7 @@ Name: octave Epoch: 6 Version: 4.2.0 -Release: 3%{?rcver:.rc%{rcver}}%{?dist} +Release: 4%{?rcver:.rc%{rcver}}%{?dist} Summary: A high-level language for numerical computations Group: Applications/Engineering License: GPLv3+ @@ -422,6 +422,9 @@ fi %{_pkgdocdir}/refcard*.pdf %changelog +* Wed Dec 07 2016 Orion Poplawski - 6:4.2.0-4 +- Use 'octave-config -p CANONICAL_HOST_TYPE' in macros + * Wed Dec 07 2016 Orion Poplawski - 6:4.2.0-3 - Use %%_host in macros