Add octave_pkg_check rpm macro, other macro cleanup

This commit is contained in:
Orion Poplawski 2015-07-31 08:17:24 -06:00
parent 9bf4ad0090
commit 5ebd21d577
2 changed files with 15 additions and 9 deletions

View File

@ -19,10 +19,12 @@
# 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 warning('off','all');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','%{_tmppath}/%{name}-%{version}-%{release}.%{_arch}/%{octpkg}-%{version}.tar.gz');unlink(pkg('local_list'));unlink(pkg('global_list')); \
mkdir -p %{buildroot}%{octprefix} \
mkdir -p %{buildroot}%{octarchprefix} \
%octave_cmd warning('off','all');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','%{_tmppath}/%{name}-%{version}-%{release}.%{_arch}/%{octpkg}-%{version}.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 \
@ -32,6 +34,12 @@ echo " error ('Can not uninstall %s installed by the redhat package manager', d
echo "endfunction" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
%{nil}
# 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 warning('off','all');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','%{_tmppath}/%{name}-%{version}-%{release}.%{_arch}/%{octpkg}-%{version}.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
# run the package's own uninstall script.
%octave_pkg_preun \

View File

@ -20,7 +20,7 @@
Name: octave
Epoch: 6
Version: 4.0.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: A high-level language for numerical computations
Group: Applications/Engineering
License: GPLv3+
@ -218,10 +218,6 @@ mkdir -p %{buildroot}%{_datadir}/%{name}/packages
mkdir -p %{buildroot}%{_libdir}/%{name}/packages
touch %{buildroot}%{_datadir}/%{name}/octave_packages
# work-around broken pre-linking (bug 524493)
#install -d %{buildroot}%{_sysconfdir}/prelink.conf.d
#echo "-b %{_bindir}/octave-%{version}" > %{buildroot}%{_sysconfdir}/prelink.conf.d/octave.conf
# Fix multilib installs
for include in config defaults oct-conf
do
@ -353,7 +349,6 @@ fi
%ghost %{_datadir}/octave/octave_packages
%{_datadir}/octave/packages/
%{_datadir}/octave/site/
#%{_sysconfdir}/prelink.conf.d/octave.conf
%files devel
%{macrosdir}/macros.octave
@ -371,6 +366,9 @@ fi
%{_pkgdocdir}/refcard*.pdf
%changelog
* Fri Jul 31 2015 Orion Poplawski <orion@cora.nwra.com> - 6:4.0.0-4
- Add octave_pkg_check rpm macro, other macro cleanup
* Tue Jul 14 2015 Orion Poplawski <orion@cora.nwra.com> - 6:4.0.0-3
- Add patch to fix build with texinfo 6.0