Add test scripts that create trivial a runtime and app

tingping/wmclass
Alexander Larsson 2016-02-25 14:33:59 +01:00
parent f89e004fa3
commit 0e595519c1
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#!/bin/sh
set -e
DIR=`mktemp -d`
# Init dir
xdg-app build-init ${DIR} org.test.Hello org.test.Platform org.test.Platform
mkdir -p ${DIR}/files/bin
cat > ${DIR}/files/bin/hello.sh <<EOF
#!/bin/sh
echo "Hello world, from a sandbox"
EOF
chmod a+x ${DIR}/files/bin/hello.sh
xdg-app build-finish --command=hello.sh ${DIR}
xdg-app build-export repo ${DIR}
rm -rf ${DIR}

View File

@ -0,0 +1,22 @@
#!/bin/sh
set -e
DIR=`mktemp -d`
xdg-app build-init ${DIR} org.test.Platform org.test.Platform org.test.Platform
sed -i s/Application/Runtime/ ${DIR}/metadata
# Add bash and dependencies
mkdir -p ${DIR}/usr/bin
mkdir -p ${DIR}/usr/lib
ln -s ../lib ${DIR}/usr/lib64
BASH=`which bash`
cp ${BASH} ${DIR}/usr/bin
ln -s bash ${DIR}/usr/bin/sh
for i in `ldd ${BASH} | sed "s/.* => //" | awk '{ print $1}' | grep ^/`; do
cp "$i" ${DIR}/usr/lib/
done
xdg-app build-export --runtime repo ${DIR}
rm -rf ${DIR}