TOPDIR="$(cd $(dirname $(which $0)); pwd)"
-PKGADD=$TOPDIR/src/pkgadd
-PKGMK_CONF=$TOPDIR/src/pkgmk.conf
+PKGADD=$TOPDIR/pkgadd
+PKGADD_CONF=$TOPDIR/pkgadd.conf
+PKGMK_CONF=$TOPDIR/pkgmk-cross.conf
. $PKGMK_CONF
if [ -z "$CLFS" ]; then
touch $CLFS/var/lib/pkg/db
fi
-$PKGADD -r $CLFS $@
+# be sure that the path to package file exists
+# and if not prepend the package dir variable
+ARGS=""
+while [ "$1" ]; do
+ case $1 in
+ *.pkg.tar.*)
+ PATH_TO_PACKAGE="$1"
+ if [ ! -f "$PATH_TO_PACKAGE" ]; then
+ PATH_TO_PACKAGE="$PKGMK_PACKAGE_DIR/$PATH_TO_PACKAGE"
+ fi
+ ARGS="$ARGS $PATH_TO_PACKAGE"
+ ;;
+ *)
+ ARGS="$ARGS $1"
+ ;;
+ esac
+ shift
+done
-# 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
+$PKGADD -c $PKGADD_CONF -r $CLFS $ARGS
# End of file