linear-algebra-oct stable port information

Info2: <<
Package: linear-algebra%type_pkg[-atlas]-oct%type_pkg[oct]
Version: 2.1.0
Type: oct (3.2.4 3.4.3 3.6.0 3.6.1), forge (linear-algebra), -atlas (boolean), gcc (4.6)
Revision: 3
Architecture: <<
(%type_raw[-atlas] != -atlas) powerpc,
(%type_raw[-atlas] != -atlas) i386
<<
Maintainer: Alexander Hansen
# unfortunately, Homepage won't do types
Homepage: http://octave.sourceforge.net/linear-algebra/index.html
Description: Additional linear algebra code for Octave
DescDetail: <<
Additional linear algebra code, including general SVD and matrix functions.

This package provides the following functions:

Matrix functions:
cartprod
cod
condeig
funm
lobpcg
ndcovlt
rotparams
rotv
smwsolve
thfm
Matrix factorization:
gsvd
Block sparse matrices:
@blksparse/blksparse
@blksparse/blksize
@blksparse/ctranspose
@blksparse/display
@blksparse/full
@blksparse/ismatrix
@blksparse/isreal
@blksparse/issparse
@blksparse/minus
@blksparse/mldivide
@blksparse/mrdivide
@blksparse/mtimes
@blksparse/plus
@blksparse/size
@blksparse/sparse
@blksparse/subsref
@blksparse/transpose
@blksparse/uminus
@blksparse/uplus
Iterative techniques:
pgmres
Kronecker Products:
@kronprod/kronprod
@kronprod/columns
@kronprod/ctranspose
@kronprod/det
@kronprod/disp
@kronprod/display
@kronprod/full
@kronprod/inv
@kronprod/iscomplex
@kronprod/ismatrix
@kronprod/isreal
@kronprod/issparse
@kronprod/issquare
@kronprod/minus
@kronprod/mldivide
@kronprod/mpower
@kronprod/mtimes
@kronprod/numel
@kronprod/plus
@kronprod/rank
@kronprod/rdivide
@kronprod/rows
@kronprod/size
@kronprod/size_equal
@kronprod/sparse
@kronprod/times
@kronprod/trace
@kronprod/transpose
@kronprod/uminus
@kronprod/uplus
<<

License: GPL3+

# All octave-forge packages have to have the following BuildDepends:
# octave%type_pkg[oct]-dev | octave%type_pkg[oct]-atlas-dev,
# fftw3,
# ( %type_pkg[oct] = 305 ) hdf5.7-oldapi,
# ( %type_pkg[oct] != 305 ) hdf5.7
#
# Packages which serve only Octave-3.0.5 or only Octave > 3.0.5 need
# not use the conditional, of course.

BuildDepends: <<
(%type_raw[-atlas] = -atlas) atlas,
(%type_raw[-atlas] = -atlas) liboctave%type_pkg[oct]-atlas-dev,
(%type_raw[-atlas] != -atlas) liboctave%type_pkg[oct]-veclib-dev,
( %type_pkg[oct] << 360 ) liboctave%type_pkg[oct]-gcc%type_pkg[gcc]-dev,
( %type_pkg[oct] >= 360 ) liboctave%type_pkg[oct]-dev,
fftw3,
( %type_pkg[oct] != 305 ) hdf5.7
<<
Depends: <<
(%type_raw[-atlas] = -atlas) atlas-shlibs,
(%type_raw[-atlas] = -atlas) octave%type_pkg[oct]-interpreter-atlas,
(%type_raw[-atlas] != -atlas) octave%type_pkg[oct]-interpreter-veclib,
( %type_pkg[oct] << 360 ) gcc%type_pkg[gcc]-shlibs
<<
Conflicts: <<
octave-forge,
%type_raw[forge]-atlas-oct%type_pkg[oct],
%type_raw[forge]-oct%type_pkg[oct]
<<
Replaces: <<
%type_raw[forge]-atlas-oct%type_pkg[oct],
%type_raw[forge]-oct%type_pkg[oct]
<<

Source-MD5: 939c044cbbcf1d112f18b29a9ae7746b

DescPackaging: <<
This package:
Use upstream patch that passes LAPACK_LIBS explicitly to allow the package
to build against Octave-3.6.x. It's OK for prior versions, too.
This will probably go away in the next release.

Common for all octave-forge packages:

We read in postinst and prerm template scripts installed by octaveN and modify
them to use the name of this package because Octave's package manager can't
cope with non-literal arguments.

The Type: forge (pkgname) is used to minimize what needs to be changed when
using this .info file as a template.
<<

#### Insert required changes here ####

SourceDirectory: %type_pkg[forge]
PatchFile: %{ni}.patch
PatchFile-MD5: 2ac72001c175c3182b0a93a01abbed0f

######################################

# Do not change anything from this point down, unless absolutely necessary,
# since the foo-oct%type_pkg[oct] packages are designed to be built/installed
# in the same way.

Source: mirror:sourceforge:/octave/%type_raw[forge]-%v.tar.gz

NoSetCPPFLAGS: true
NoSetLDFLAGS: true
SetLIBRARY_PATH: /usr/X11R6/lib:%p/lib
UseMaxBuildJobs: false
BuildAsNobody: false

CompileScript: <<
#!/bin/sh -ev
if [ $UID -ne 0 ]
then
echo "%n cannot be built with --build-as-nobody"
exit 1
fi
export OCTAVE=%p/bin/octave-%type_raw[oct]
# repack tarball, since octave-3.4.3 appears not to want to install
# from directories
if [ %type_pkg[oct] -ge 343 ]
then
cd ..
tar -cf %type_raw[forge].tar %type_raw[forge]
cd %b
pkgsrc=%type_raw[forge].tar
else pkgsrc=%type_raw[forge]
fi
%p/share/octave/%type_raw[oct]/scripts/octave-forge-compile.sh $pkgsrc
<<

InstallScript: <<
#!/bin/sh -ev
%p/share/octave/%type_raw[oct]/scripts/octave-forge-install.sh %type_raw[forge]-%v %i %b
mkdir -p %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
# copy template scripts
cp %p/share/octave/%type_raw[oct]/scripts/octave-forge-prerm %p/share/octave/%type_raw[oct]/scripts/octave-forge-postinst %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
cd %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
sed -i -e 's/@PKGNAME@/%type_raw[forge]-%v/' octave-forge-postinst
sed -i -e 's/@PKGNAME@/%type_raw[forge]/' octave-forge-prerm
chmod a+x octave-forge*
<<
PostInstScript: <<
if [ -s %p/var/octave/%type_raw[oct]/octave_packages ] && [ -f %p/var/octave/%type_raw[oct]/octave_packages ]
then
%p/share/octave/%type_raw[oct]/%type_raw[forge]-%v/octave-forge-postinst
else
mv %p/share/octave/%type_raw[oct]/packages/%type_raw[forge]-%v/octave_packages %p/var/octave/%type_raw[oct]/octave_packages
fi
<<

PreRmScript: %p/share/octave/%type_raw[oct]/%type_raw[forge]-%v/octave-forge-prerm
<<

linear-algebra-oct stable port .patch

diff -Nurd linear-algebra/src/Makefile linear-algebra.patched/src/Makefile
--- linear-algebra/src/Makefile 2011-11-02 14:36:05.000000000 -0400
+++ linear-algebra.patched/src/Makefile 2012-01-20 08:07:25.000000000 -0500
@@ -4,6 +4,8 @@
MKOCTFILE = mkoctfile
endif

+LAPACK_LIBS := $(shell mkoctfile -p LAPACK_LIBS)
+
DEFINES = -DHAVE_CONFIG_H -Wall
GSVD_OBJECTS = gsvd.o dbleGSVD.o CmplxGSVD.o
GSVD_TARGET = gsvd.oct
@@ -23,7 +25,7 @@
all : $(TARGETS) pgmres.oct

$(GSVD_TARGET) : $(GSVD_DEPENDS) $(GSVD_OBJECTS)
- $(MKOCTFILE) $(DEFINES) $(GSVD_OBJECTS) -o $@
+ $(MKOCTFILE) $(DEFINES) $(GSVD_OBJECTS) -o $@ ${LAPACK_LIBS}

$(GSVD_TEST) : $(GSVD_TARGET)

@@ -32,19 +34,19 @@
endif

%.d:%.cc
- $(MKOCTFILE) $(DEFINES) -M $<
+ $(MKOCTFILE) $(DEFINES) -M $<

%.o:%.cc
%.o:%.cc %.d
- $(MKOCTFILE) $(DEFINES) -c $<
+ $(MKOCTFILE) $(DEFINES) -c $<

%.o:%.f
- $(MKOCTFILE) $(DEFINES) -c $<
+ $(MKOCTFILE) $(DEFINES) -c $<
%.oct:%.o
$(MKOCTFILE) $(DEFINES) $< -o $@

%.oct: %.cc
- mkoctfile $(DEFINES) $< -o $@
+ mkoctfile $(DEFINES) $< -o $@ ${LAPACK_LIBS}

.phony: test
test: $(GSVD_TEST)

linear-algebra-oct _unstable_ port .patch