lpsolve-extra _unstable_ port information

Info2: <<
Package: lpsolve-extra
Description: External Language Interfaces for lpsolve
Version: 5.5.2.0
Revision: 1
# rev-up and adapt next line at version-increases of lpsolve or glpk
Type: glpk (4.44), maj (5.5)

BuildDepends: lpsolve%type_raw[maj]-dev (>= %v-1), glpk (>= %type_raw[glpk]-1), bison, flex, sed | ssed, fink (>= 0.24.12)
Depends: lpsolve%type_raw[maj]-shlibs (>= %type_raw[maj].0.0-1)

# we need the lp_solve source again, for yacc_read.c lp_Hash.c lp_utils.c shared/{commonlib,myblas}.c and colamd/colamd.c
Source: mirror:sourceforge:lpsolve/lp_solve_%v_source.tar.gz
Source-MD5: 167c0fb4ab178e0b7ab50bf0a635a836
# those are the real sources:
Source2: mirror:sourceforge:lpsolve/lp_solve_%v_xli_MathProg_source.tar.gz
Source2-MD5: ce59814ac2857b2407bc90f716b0342b
Source3: mirror:sourceforge:lpsolve/lp_solve_%v_xli_CPLEX_source.tar.gz
Source3-MD5: 1c5285c4dfe96461d83e606e174195de
Source4: mirror:sourceforge:lpsolve/lp_solve_%v_xli_DIMACS_source.tar.gz
Source4-MD5: dcfb45d81a8619521e814c7c854f1367
Source5: mirror:sourceforge:lpsolve/lp_solve_%v_xli_LINDO_source.tar.gz
Source5-MD5: 27b3d2ddce2ba21e33ee21b495b0efb0
Source6: mirror:sourceforge:lpsolve/lp_solve_%v_bfp_GLPK_source.tar.gz
Source6-MD5: b42c91798f593a9a62cb3ca661369836
Source7: mirror:sourceforge:lpsolve/lp_solve_%v_bfp_LUSOL_source.tar.gz
Source7-MD5: 4252ce513b9914fa998fe20c838a588e
Source8: mirror:sourceforge:lpsolve/lp_solve_%v_bfp_etaPFI_source.tar.gz
Source8-MD5: 2d01a13c9e530512349fb3dbaa56dfe1
Source9: mirror:sourceforge:lpsolve/lp_solve_%v_doc.tar.gz
Source9-MD5: 7886d6b94477c821c88142c3730f4e65
Source9ExtractDir: lp_solve_%type_raw[maj]/doc
# ZIMPL needs more work _ this version doesn't even seem to fit lpsolve55 ..
#Source10: http://personales.upv.es/arodrigu/SolverWS/descargas/xli_ZIMPL.zip
#Source10-MD5: 274645d82a31bc9f7ffc8b758811c285
#Source10ExtractDir: lp_solve_%type_raw[maj]/xli/xli_ZIMPL
Source11: mirror:gnu:glpk/glpk-%type_raw[glpk].tar.gz
Source11-MD5: f2ac7013bc0420d730d052e7ba24bdb1
#
SourceDirectory: lp_solve_%type_raw[maj]

PatchFile: lpsolve.patch
PatchFile-MD5: f27f7a5dbd1d2411e2b83ac7db502bf9
PatchScript: <<
#!/bin/sh -ev
N=lpsolve
v=%v
p=%p
b=%b
t=%type_raw[maj]
. %{PatchFile}

#### ZIMPL
# sed -r -e 's,CPLEX,ZIMPL,' -e "s,^(src=).*,\1'lp_ZIMPL.c'," < xli/xli_CPLEX/ccc > xli/xli_ZIMPL/ccc
#### the ccc files
sed -ri.bak -e "{
# remove colamd from the srcs; never needed :
s,[-./Ia-z]*colamd(\.c|) ,,
# set optimisation flags; use -Os for the non time-critical parts
s,opts='',opts='-Os'\nopts=\"\$opts -fstrict-aliasing\",
# -fpic not availaible on MacOSX, -fPIC default
s, \-fpic,,
# link as bundles
s,so=\"\-s.*,so='-bundle',
# strip (and -lc -lm are libSystem, which is always there)
s: \-lc \-lm: -Wl,-x -dead_strip -exported_symbols_list ../exp_sym:
# Remove from the srcs everything which is already in the lib
# (the differences in -D flags do not matter), and link with the lib.
# /^src=/s,\.\./\.\./[^ ']*,,g
# s,\-Wl,-L%p/lib -llpsolve &,
# Finally use by preference the installed lpsolve headers _ doesn't matter irrespective of the previous choice _ ,
# so the only files we still need from Source1 (if previous choice is not commented out) are yacc_read.c and lp_Hash.c
s,\-I\.\./\.\./,-I%p/include/lpsolve/,g
s,\-I\.\./\.\.,-I%p/include/lpsolve &,
}" */*/ccc
# SpaceChars is used :
sed -ri -e '/static char SpaceChars/{ i */
a /*
}' xli/xli_DIMACS/lp_Dimacs.c
# Else plenty of errors "'struct _lprec' has no member named 'lpfunc'" in those 2 complilations :
sed -ri -e '/RELEASE/s,0,2,' xli/xli_DIMACS/lp_{Dimacs,network}.c
# No xli_glpsql.c to be found _ neither in the buildir, nor on my machine, nor on the net..
# Let is provisionally replace it by a compilation of glpsql.c; but this needs a real include-dir for mysql:
sed -ri -e 's,/usr,%p,' -e 's,xli_glpsql,${glpkdir}/src/glpsql,' xli/xli_MathProg/ccc

#### glpk
# the bfp would still build with glpk-4.14, given the following changes _ but would still require
# a special build of glpk, installing a number of headers that have become internal _ not worth it.
# # accomodate changes in glpk 4.14
# perl -pi -e 's,glp_inv_,inv_,g' bfp/bfp_GLPK/lp_glpkLU.c
# # link the bfp with glpk (4.14) instead of re-compiling:
# perl -pi.bak -e 's, \$\{glpk\},,; s,I\$\{glpkdir\},I%p,; s,\-Wl,-L%p/lib -lglpk $&,' bfp/bfp_GLPK/ccc
# for xli_MathProg, use the downloaded glpk-4.13 :
perl -pi -e 's,=/glpk.*,=%b/../glpk-%type_raw[glpk],' {bfp/bfp_GLPK,xli/xli_MathProg}/ccc
<<
CompileScript: <<
#!/bin/sh -ev
export PATH=%p/lib/flex/bin:$PATH
export CPATH=%p/lib/flex/include:%p/include
export LIBRARY_PATH=%p/lib/flex/lib:%p/lib
# skip bfp_GLPK for the moment :
sed -i '1i return 0' bfp/bfp_GLPK/ccc

for d in xli/xli_CPLEX xli/xli_LINDO; do cd $d; . ./*.bat; cd -; done
for d in bfp xli; do \
cd $d
D=`echo $d|tr "[:lower:]" "[:upper:]"`
sed -r -e '/EXPORTS/d' -e 's,^ +,_,' < lp_$D.def > exp_sym
for n in ${d}_*; do cd $n; . ./ccc; cd -; done
cd ..
done
<<
InstallScript: <<
#!/bin/sh -ev
# bundles
mkdir -p %i/lib
cp -p */*/*.so %i/lib
chmod 644 %i/lib/*
# Headers
for d in bfp xli; do \
cd $d
mkdir -p %i/include/lpsolve/$d
cp *.{def,h,c} %i/include/lpsolve/$d
for n in ${d}_* ; do mkdir -p %i/include/lpsolve/$d/$n; cp $n/*.h %i/include/lpsolve/$d/$n; done
cd ..
done
# the following are already in lpsolve
rm -f %i/include/lpsolve/bfp/{lp_BFP,bfp_LUSOL/lp_LUSOL}.h
# docs
sed -ri -e '/^(This directory|To build)/d' -e '/^$/d' xli/*/readme.txt
mkdir -p %i/share/doc/%n/examples/lpsolve %i/share/doc/%n/examples/DIMACS %i/share/doc/lpsolve%type_raw[maj]-shlibs
mv doc %i/share/doc/%n/html
echo "#!/bin/sh
open html/contents.htm" > %i/share/doc/%n/viewdoc
echo "#!/bin/sh
open html/search.htm" > %i/share/doc/%n/searchdoc
chmod a+x %i/share/doc/%n/{view,search}doc
ln -s other/README.txt %i/share/doc/%n/readme_lpsolve
ln -s ../lpsolve%type_raw[maj]-shlibs %i/share/doc/%n/other
ln -s ../%n %i/share/doc/lpsolve%type_raw[maj]-shlibs/extras
cp -p xli/xli_DIMACS/*.net xli/xli_DIMACS/*.htm %i/share/doc/%n/examples/DIMACS
ln -s examples/DIMACS %i/share/doc/%n/DIMACS
# And since we had anyway to expand the src of lpsolve, we can as well install its demo
# Here we delete the $src, and link instead with the dylib, forgetting our scruples about different '-D' flags ...
# for a demo, the risk is compensated by the gain in space : 18K vs > 600K
cd demo
sed -ri -e 's,\$src ,,' -e 's,\$math \$dl,%p/lib/liblpsolve.dylib -mdynamic-no-pic -Os -fstrict-aliasing -s -dead_strip,' ccc
sh -ev ccc
cp -p demo %i/share/doc/%n/examples/lpsolve
ln -s examples/lpsolve/demo %i/share/doc/%n/lpsolve_demo
<<

DocFiles: <<
bfp/bfp_LUSOL/LUSOL/LUSOL-overview.txt:overview_LUSOL
xli/xli_CPLEX/readme.txt:readme_CPLEX
xli/xli_LINDO/readme.txt:readme_LINDO
xli/xli_MathProg/readme.txt:readme_MathProg
<<
DescDetail: <<
External Language Interfaces (XLI) and Basis Factorization Packages (BFP)
for the linear (mixed integer) programming solver lpsolve.
<<

DescPackaging: <<
<<

DescUsage: <<
For doc and demos, cf %p/share/doc/%n
For a (lpsolve, not lpsolve-extra) demo, type : %p/share/doc/%n/lpsolve_demo
Mailing list is at lp_solve@yahoogroups.com
<<
License: LGPL
HomePage: http://sourceforge.net/projects/lpsolve/
Maintainer: JF Mertens
<<