Update rpm macros per FPC comments
This commit is contained in:
parent
c8ee627a0e
commit
b62f115556
@ -1,13 +1,28 @@
|
|||||||
|
# Octave packaging macros
|
||||||
|
|
||||||
|
# Octave binary API provided
|
||||||
%octave_api %(octave-config -p API_VERSION || echo 0)}
|
%octave_api %(octave-config -p API_VERSION || echo 0)}
|
||||||
%_octshareprefix %{buildroot}%{_datadir}/octave
|
|
||||||
%_octprefix %{_octshareprefix}/packages
|
# Octave Package Directories
|
||||||
%_octarchprefix %{buildroot}%{_libexecdir}/octave/packages
|
%octshareprefix %{_datadir}/octave
|
||||||
|
%octprefix %{octshareprefix}/packages
|
||||||
|
%octarchprefix %{_libexecdir}/octave/packages
|
||||||
|
%octpkgdir %{octshareprefix}/%{octpkg}-%{version}
|
||||||
|
%octpkglibdir %{octarchprefix}/%{octpkg}-%{version}
|
||||||
|
|
||||||
|
# Run an octave command - quietly with no startup files
|
||||||
%octave_cmd() octave -H -q --no-site-file --eval "%*";
|
%octave_cmd() octave -H -q --no-site-file --eval "%*";
|
||||||
|
|
||||||
|
# Build Source0 into a package tar file in a temporary location
|
||||||
%octave_pkg_build %octave_cmd pkg build '-verbose' %{_tmppath}/%{name}-%{version}-%{release}.%{_arch} %SOURCE0
|
%octave_pkg_build %octave_cmd pkg build '-verbose' %{_tmppath}/%{name}-%{version}-%{release}.%{_arch} %SOURCE0
|
||||||
|
|
||||||
|
# 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
|
||||||
%octave_pkg_install \
|
%octave_pkg_install \
|
||||||
mkdir -p %{_octprefix} \
|
mkdir -p %{buildroot}/%{octprefix} \
|
||||||
mkdir -p %{_octarchprefix} \
|
mkdir -p %{buildroot}/%{octarchprefix} \
|
||||||
%octave_cmd warning('off','all');pkg('prefix','%{_octprefix}','%{_octarchprefix}');pkg('global_list',fullfile('%{_octshareprefix}','octave_packages'));pkg('local_list',fullfile('%{_octshareprefix}','octave_packages'));pkg('install','-nodeps','-verbose','%{_tmppath}/%{name}-%{version}-%{release}.%{_arch}/%{octpkg}-%{version}.tar.gz');unlink(pkg('local_list'));unlink(pkg('global_list')); \
|
%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 ] \
|
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 \
|
||||||
@ -16,6 +31,9 @@ echo "function on_uninstall (desc)" > %{buildroot}%{octpkgdir}/packinfo/on_unins
|
|||||||
echo " error ('Can not uninstall %s installed by the redhat package manager', desc.name);" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
|
echo " error ('Can not uninstall %s installed by the redhat package manager', desc.name);" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
|
||||||
echo "endfunction" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
|
echo "endfunction" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
|
# preun script - we need to remove our uninstall protection and perhaps
|
||||||
|
# run the package's own uninstall script.
|
||||||
%_octave_pkg_preun \
|
%_octave_pkg_preun \
|
||||||
rm %{octpkgdir}/packinfo/on_uninstall.m \
|
rm %{octpkgdir}/packinfo/on_uninstall.m \
|
||||||
if [ -e %{octpkgdir}/packinfo/on_uninstall.m.orig ]; then \
|
if [ -e %{octpkgdir}/packinfo/on_uninstall.m.orig ]; then \
|
||||||
@ -24,5 +42,3 @@ if [ -e %{octpkgdir}/packinfo/on_uninstall.m.orig ]; then \
|
|||||||
%octave_cmd l=pkg('list');on_uninstall(l{cellfun(@(x)strcmp(x.name,'%{octpkg}'),l)}); \
|
%octave_cmd l=pkg('list');on_uninstall(l{cellfun(@(x)strcmp(x.name,'%{octpkg}'),l)}); \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
%octpkgdir %{_datadir}/octave/packages/%{octpkg}-%{version}
|
|
||||||
%octpkglibdir %{_libexecdir}/octave/packages/%{octpkg}-%{version}
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: octave
|
Name: octave
|
||||||
Version: 3.4.0
|
Version: 3.4.0
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: A high-level language for numerical computations
|
Summary: A high-level language for numerical computations
|
||||||
Epoch: 6
|
Epoch: 6
|
||||||
Group: Applications/Engineering
|
Group: Applications/Engineering
|
||||||
@ -189,6 +189,9 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Feb 23 2011 Orion Poplawski <orion[AT]cora.nwra com> - 6:3.4.0-4
|
||||||
|
- Update rpm macros per FPC comments
|
||||||
|
|
||||||
* Mon Feb 14 2011 Orion Poplawski <orion[AT]cora.nwra com> - 6:3.4.0-3
|
* Mon Feb 14 2011 Orion Poplawski <orion[AT]cora.nwra com> - 6:3.4.0-3
|
||||||
- Add rpm macros
|
- Add rpm macros
|
||||||
- Rebuild should pick up fixed suitesparse
|
- Rebuild should pick up fixed suitesparse
|
||||||
|
Loading…
Reference in New Issue
Block a user