#!/bin/sh
-TOPDIR="$(cd $(dirname $0); pwd)"
+TOPDIR="$(cd $(dirname $(which $0)); pwd)"
PKGADD=$TOPDIR/src/pkgadd
PKGMK_CONF=$TOPDIR/src/pkgmk.conf
exit 1
fi
+if [ ! -f $CLFS/var/lib/pkg/db ]; then
+ install -d -m 0755 $CLFS/var/lib/pkg
+ touch $CLFS/var/lib/pkg/db
+fi
+
$PKGADD -r $CLFS $@
+# we shoudl avoid .la files when crosscompiling, these files
+# contains the libdir variable hardcoded which is used by libtool
+[ $? -eq 0 ] && find $CLFS -type f -name '*.la' -delete
+
# End of file