summaryrefslogtreecommitdiffstats
path: root/chroot-scripts/pkg-builder.sh
diff options
context:
space:
mode:
Diffstat (limited to 'chroot-scripts/pkg-builder.sh')
-rwxr-xr-xchroot-scripts/pkg-builder.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/chroot-scripts/pkg-builder.sh b/chroot-scripts/pkg-builder.sh
index d172860..ec97343 100755
--- a/chroot-scripts/pkg-builder.sh
+++ b/chroot-scripts/pkg-builder.sh
@@ -6,7 +6,7 @@ if [ "$(readlink -f $0| xargs basename)" == "pkg-builder.sh" ]; then
fi
### Variables #####
-CHROOT_DIR=/tmp/chroot
+CHROOT_DIR=/chroot
PKG_DIR=/root/packages
[ ! -d "$PKG_DIR/indices" ] && mkdir -p "$PKG_DIR/indices"
@@ -15,28 +15,30 @@ copyfileswithdependencies () {
# Create $CHROOT_DIR
[ ! -d $CHROOT_DIR ] && mkdir $CHROOT_DIR
cd $CHROOT_DIR
-
# Copy $REQUIRED_CHROOT_FILES and shared library dependencies
# to chroot environment
[ -f "$PKG_DIR/indices/$PKG_NAME.files" ] && rm -f "$PKG_DIR/indices/$PKG_NAME.files"
- for FILE in $REQUIRED_CHROOT_FILES
+ for FILE in $REQUIRED_BINARIES
do
DIR=`dirname $FILE | cut -c2-`
- [ ! -d $DIR ] && mkdir -p $DIR
+ echo $DIR
+ [ ! -d "$DIR" ] && mkdir -p "$DIR"
cp $FILE `echo $FILE | cut -c2-`
echo $FILE | cut -c1- >> "$PKG_DIR/indices/$PKG_NAME.files"
for SHARED_LIBRARY in `ldd $FILE | awk '{print $3}' |grep ^/`
do
+ echo "$SHARED_LIBRARY"
DIR=`dirname $SHARED_LIBRARY | cut -c2-`
[ ! -d $DIR ] && mkdir -p $DIR
[ ! -s "`echo $SHARED_LIBRARY | cut -c2-`" ] && \
- [ ! "$(grep -l $SHARED_LIBRARY $PKG_DIR/indices/*| wc -l)" == "0" ] && \
+ [ "$(grep -l $SHARED_LIBRARY $PKG_DIR/indices/*| wc -l)" == "0" ] && \
cp $SHARED_LIBRARY `echo $SHARED_LIBRARY | cut -c2-` && \
echo $SHARED_LIBRARY | cut -c1- >> "$PKG_DIR/indices/$PKG_NAME.files"
done
done
+ REQUIRED_BINARIES=""
#cp /lib/ld-* lib
}