/usr/bin/ff-pkg-download is in freefem++ 3.26-2-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #!/bin/sh
ff=$0;
bb=`basename $0`
DIR=`dirname $ff`
pp=`pwd`
DESTDIR=""
if [ -n "$1" ] ; then
DESTDIR="$1/"
elif [ $bb = $ff -a \( '.' = "$DIR" -o -z "$DIR" \) ] ; then
ff=`which $0`
DIR=`dirname $ff`
if [ '.' = "$DIR" -o -z "$DIR" ] ; then
echo Sorry cant find the Directory place of $0
fi
fi
case $DIR in
/*) ;;
[.]) DIR=$pp;;
*) DIR="$pp/$DIR"
esac
DIRP=`dirname $DIR`
#echo "WWWWW" $DIRP
if [ -d "$DESTDIR$DIRP/download/lib" -a -d "$DESTDIR$DIRP/download/include" ] ; then
DIR="$DIRP/download"
elif [ -d "$DESTDIR$DIRP/lib" -a -d "$DESTDIR$DIRP/include" ] ; then
DIR="$DIRP"
else
DIR=/usr/lib/ff++/3.26-2
fi
if [ -d $DESTDIR$DIR/lib -a -d $DESTDIR$DIR/include ] ; then
LIB="$DIR/lib"
INC="$DIR/include"
cd "$DESTDIR$LIB"
# set -x
for i in $LIB/WHERE.* ; do
test -f $i && ( sed "s;@DIR@;$DIR;" <$i )
done
# return
for la in arpack umfpack amd fftw3 blas lapack mmg3d; do
l=`echo $la |sed -e s/^tet$/tetgen/`
if [ ! -f $LIB/WHERE.$l ]; then
if [ -z "$l" ];then l="$la";fi
if ( ls "lib$la"[-._0-9]*a 1>/dev/null 2>/dev/null ) ; then
ll=`ls "lib$la"[-._0-9]*a|grep [.]a`
if [ -n "$ll" ]; then
lib=`expr "$ll" : lib'\(.*\).a'`
echo $l LD "'"-L$LIB"'" "'"-l$lib"'"
if [ -d $INC/$la ] ; then
echo $l INCLUDE "'"-I$INC/$la"'"
else
echo $l INCLUDE "'"-I$INC"'"
fi
fi
fi
fi
done
else
echo error not directory $DIR/lib and $DIR/include $DIRP
fi
|