Use 'octave-config -p CANONICAL_HOST_TYPE' in macros

This commit is contained in:
Orion Poplawski 2016-12-07 11:01:23 -07:00
parent 22d0d4e8c1
commit af0420f223
2 changed files with 10 additions and 4 deletions

View File

@ -13,6 +13,9 @@
# Run an octave command - quietly with no startup files # Run an octave command - quietly with no startup files
%octave_cmd() octave -H -q --no-window-system --no-site-file --eval '%*'; %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 # Build unpacked source directory into a package tar file in a temporary location
# Pass -T to use source tarball # Pass -T to use source tarball
%octave_pkg_build(T) %{lua: %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_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") 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 -- 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 # Install a package. We use the octave pkg install command to install the
@ -36,7 +39,7 @@
%octave_pkg_install \ %octave_pkg_install \
mkdir -p %{buildroot}%{octprefix} \ mkdir -p %{buildroot}%{octprefix} \
mkdir -p %{buildroot}%{octarchprefix} \ 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 ] \ if [ -e %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m ] \
then \ 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 \
@ -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 # Run pkg tests - We need to reinstall to recreate 'octave_packages' so that
# octave can find the package, then remove 'octave_packages' again. # octave can find the package, then remove 'octave_packages' again.
%octave_pkg_check \ %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} %{nil}
# preun script - we need to remove our uninstall protection and perhaps # preun script - we need to remove our uninstall protection and perhaps

View File

@ -14,7 +14,7 @@
Name: octave Name: octave
Epoch: 6 Epoch: 6
Version: 4.2.0 Version: 4.2.0
Release: 3%{?rcver:.rc%{rcver}}%{?dist} Release: 4%{?rcver:.rc%{rcver}}%{?dist}
Summary: A high-level language for numerical computations Summary: A high-level language for numerical computations
Group: Applications/Engineering Group: Applications/Engineering
License: GPLv3+ License: GPLv3+
@ -422,6 +422,9 @@ fi
%{_pkgdocdir}/refcard*.pdf %{_pkgdocdir}/refcard*.pdf
%changelog %changelog
* Wed Dec 07 2016 Orion Poplawski <orion@cora.nwra.com> - 6:4.2.0-4
- Use 'octave-config -p CANONICAL_HOST_TYPE' in macros
* Wed Dec 07 2016 Orion Poplawski <orion@cora.nwra.com> - 6:4.2.0-3 * Wed Dec 07 2016 Orion Poplawski <orion@cora.nwra.com> - 6:4.2.0-3
- Use %%_host in macros - Use %%_host in macros