Improve cpkg.
This commit is contained in:
parent
67aaa66cea
commit
ced2bd22a1
16
src/cpkg
16
src/cpkg
@ -6,6 +6,7 @@ cleanup() {
|
||||
return
|
||||
fi
|
||||
rm -rf $PKGDIR
|
||||
rm -f $SCRIPT
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
@ -18,6 +19,8 @@ then
|
||||
shift
|
||||
PKGDIR="$1"
|
||||
shift
|
||||
SCRIPT=$1
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
@ -35,10 +38,19 @@ then
|
||||
exit 1
|
||||
fi
|
||||
PKGDIR=$(mktemp -d)
|
||||
fakeroot -- $0 -F "$PKGDIR" "$@" || exit $?
|
||||
SCRIPT=$(mktemp)
|
||||
fakeroot -- $0 -F "$PKGDIR" "$SCRIPT" "$@" || exit $?
|
||||
else
|
||||
env DESTDIR=$PKGDIR "$@"
|
||||
echo -e '#!/bin/bash\n' > $SCRIPT
|
||||
echo "$@" >> $SCRIPT
|
||||
chmod +x $SCRIPT
|
||||
env DESTDIR=$PKGDIR $SCRIPT
|
||||
|
||||
PKGNAME=$(basename $(pwd))
|
||||
if [ $PKGNAME = "build" ]
|
||||
then
|
||||
PKGNAME=$(basename $(cd ..;pwd))
|
||||
fi
|
||||
|
||||
PKGDEST="${FPKG_ROOT}/pkg"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user