Lakka/scripts/install

61 lines
1.3 KiB
Plaintext
Raw Normal View History

2009-03-18 13:02:53 +01:00
#!/bin/sh
. config/options $1
2009-03-18 13:02:53 +01:00
STAMP=$STAMPS_INSTALL/$1/install
2009-03-18 13:02:53 +01:00
if [ -z "$1" ]; then
echo "usage: $0 package_name"
exit 1
fi
mkdir -p $STAMPS_INSTALL/$1
2009-03-18 13:02:53 +01:00
if [ -f $STAMP -a $PKG_DIR/install -nt $STAMP ]; then
rm -f $STAMP
fi
2009-03-18 13:02:53 +01:00
[ -f $STAMP -a $FORCE_INSTALL = "no" ] && exit 0
2009-03-18 13:02:53 +01:00
if [ -f $PKG_DIR/arch ]; then
grep -q "$TARGET_ARCH" "$PKG_DIR/arch" || exit 0
grep -q "\-$TARGET_ARCH" "$PKG_DIR/arch" && exit 0
fi
if [ -f $PKG_DIR/platform ]; then
grep -q "$TARGET_PLATFORM" "$PKG_DIR/platform" || exit 0
grep -q "\-$TARGET_PLATFORM" "$PKG_DIR/platform" && exit 0
fi
if [ -d $PKG_DIR/init.d ]; then
mkdir -p $INSTALL/etc/init.d
cp $PKG_DIR/init.d/* $INSTALL/etc/init.d/
fi
if [ -d $PKG_DIR/profile.d ]; then
mkdir -p $INSTALL/etc/profile.d
cp $PKG_DIR/profile.d/*.conf $INSTALL/etc/profile.d/
fi
if [ -d $PKG_DIR/init.network ]; then
mkdir -p $INSTALL/etc/init.d/network
cp $PKG_DIR/init.network/* $INSTALL/etc/init.d/network/
fi
$SCRIPTS/build $@
printf "%${INDENT}c INSTALL $1\n" >&$SILENT_OUT
export INDENT=$((${INDENT:-1}+$INDENT_SIZE))
for p in $PKG_DEPENDS; do
$SCRIPTS/install $p
done
if [ -f $PKG_DIR/install ]; then
$PKG_DIR/install $@ >&$VERBOSE_OUT
fi
2009-03-18 13:02:53 +01:00
for i in `sed -n "s/^\([^#].*\)=\".*$/\1/p" $PROJECT_DIR/$PROJECT/options | grep -v "#"`; do
eval val=\$$i
echo "STAMP_$i=\"$val"\" >> $STAMP
done