[Pkg-octave-devel] Re: OctavePackaging

David Bateman adb014 at gmail.com
Sat May 12 10:52:41 UTC 2007


Rafael Laboissiere wrote:
> * David Bateman <adb014 at gmail.com> [2007-05-11 23:09]:
> 
>> Isn't there an automatic install process from CRAN? The same for Perl
>> from CPAN? Debian must live with these secondary package managers as
>> well. So my question was how does it?
> 
> http://wiki.debian.org/AliothPkgBioc
> 

To demonstrate my idea, I've updated the SRPM builds in octave-forge
with the ideas discussed. If you take the pkg.m from the CVS with a
2.9.10 RPM installed then the attached SRPM will build to an RPM that
can be installed with the "rpm -Uvh", can't be uninstalled with "pkg
uninstall <package>" and contains architecture dependent directories.

I also attach the corresponding SPEC file for the SRPM if you aren't on
an RPM based system so you can see how I modified the SPEC.

Regards
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: octave_signal-1.0.0-1mdk.src.rpm
Type: audio/x-pn-realaudio-plugin
Size: 115170 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-octave-devel/attachments/20070512/b3413895/octave_signal-1.0.0-1mdk.src-0001.bin
-------------- next part --------------
Name:           octave_signal
Version:	1.0.0
Release:	1%{?distsuffix}
Summary:	Signal Processing.
Group:		Applications/Engineering
License:	GPL version 2 or later
URL:		http://octave.sourceforge.net
Source0:	http://downloads.sourceforge.net/octave/signal-1.0.0.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root

## Package installs in a directory tree specific to the installed
## version of octave, so the following version dependency is necessary.
%define octave_ep  %(rpm -q --qf '%%{epoch}' octave)
%define octave_ver %(rpm -q --qf '%%{version}' octave)

Requires:	octave = %{octave_ep}:%{octave_ver}

BuildRequires:	octave >= 2.9.7
BuildRequires:	gcc-c++ gcc-gfortran libstdc++-devel
BuildRequires:	libstdc++-devel 
BuildRequires:  %(rpm -q --qf '%%{name}' %(rpm -q -f `which mkoctfile`))

%define builtpackage signal-1.0.0.tar.gz
%define octave octave-%{octave_ver}

%description
Signal processing tools, including filtering, windowing and display functions.

%prep
rm -fr signal-1.0.0
mkdir signal-1.0.0
cd signal-1.0.0
cp %{_sourcedir}/signal-1.0.0.tar.gz .
chmod a+r signal-1.0.0.tar.gz
mkdir -p install/signal
mkdir install/signal/inst

%build
cd signal-1.0.0
HOME=`pwd` %{octave} -H -q --no-site-file --eval "pkg('prefix',[pwd(),'/install']);pkg('local_list',[pwd(),'/install/.octave_packages']);pkg('global_list',[pwd(),'/install/.octave_packages']);pkg('install','-nodeps','signal-1.0.0.tar.gz')"
cd install
mv signal-1.0.0/packinfo/* signal
rm -rf signal-1.0.0/packinfo
if [ -d signal-1.0.0/doc ]; then mv signal-1.0.0/doc signal; fi
if [ -d signal-1.0.0/bin ]; then mv signal-1.0.0/bin signal; fi
if [ -e signal-1.0.0/PKG_ADD ]; then mv signal-1.0.0/PKG_ADD signal; fi
if [ -e signal-1.0.0/PKG_DEL ]; then mv signal-1.0.0/PKG_DEL signal; fi
mv signal-1.0.0/* signal/inst
rm -fr signal-1.0.0.tar.gz
cat << EOF > signal/on_uninstall.m
function on_uninstall (desc)
  error ("Can not uninstall signal-1.0.0 installed by the RPM package manager");
endfunction
EOF
tar czf ../%{builtpackage} signal

%install
cd signal-1.0.0
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_datadir}
cp %{builtpackage} %{buildroot}%{_datadir}

%post
%{octave} -H -q --no-site-file --eval "warning('off','all');pkg('install','%{_datadir}/%{builtpackage}')"
rm %{_datadir}/%{builtpackage}

%postun
%{octave} -H -q --no-site-file --eval "prefix=pkg('prefix');unlink(fullfile(prefix,'signal-1.0.0','on_uninstall.m');pkg('uninstall','signal')"

%clean
rm -fr %{buildroot}

%files
%defattr(-,root,root)
%{_datadir}/*

%changelog
# Changelog for packages rebuilt on stable releases (leave it first):
%{!?_with_unstable:* %(LC_ALL=C date +"%a %b %d %Y") %{packager} %{version}-%{release}}
%{!?_with_unstable: - rebuild of %{version}-%{rel}%{?distsuffix} for %{distversion}}

* Sat May 12 2007 The Octave Community 1.0.0-1%{?distsuffix}
- Automatically created from octave-forge package


More information about the Pkg-octave-devel mailing list