qira/bdistrib.sh

120 lines
3.3 KiB
Bash
Raw Normal View History

#!/bin/bash -e
2014-07-03 02:42:34 +04:00
rm -rf distrib/
mkdir -p distrib/qira
2014-07-02 22:31:15 +04:00
2014-07-31 03:02:23 +04:00
QEMU_SOURCE=1
2014-07-31 22:47:11 +04:00
QEMU_BINARIES=1
VERSION=$(cat VERSION)
echo "packaging version $VERSION"
# VERSION is required to build the python thing
echo "copying docs"
2014-07-31 02:26:59 +04:00
cp -av VERSION README distrib/qira/
2014-07-02 22:31:15 +04:00
# requires objdump
# writable /tmp
# aim for a 2mb distributable
# 100kb for the python, 100kb for the web, 200kb for the ida plugin(static), 1mb for qira-qemu
# +the meteor install size
# consider smaller packaging for the python
# hmm can we package as a .deb for ubuntu?
# perhaps instead of this bundle we just install meteor
# curl https://install.meteor.com | /bin/sh
# or preship this file in the tarball?
# the advantage of this over the bundle is it ships mongo
2014-07-03 02:42:34 +04:00
echo "copying webapp"
cp -R web distrib/qira/
2014-08-20 05:07:07 +04:00
#rm -rf distrib/qira/web/.meteor/local
#rm -f distrib/qira/web/qira.html # this doesn't work to change, so don't allow the user to
2014-07-02 22:31:15 +04:00
#mrt bundle ../bin/qira_web.tar.gz
2014-08-20 05:07:07 +04:00
#cp -R webstatic distrib/qira/
2014-07-03 02:42:34 +04:00
# sudo apt-get install python-pip
# sudo pip install pymongo
echo "copying middleware"
mkdir -p distrib/qira/middleware
2014-07-31 03:02:23 +04:00
cp -av middleware/*.py distrib/qira/middleware/
2014-07-02 22:31:15 +04:00
# static2
echo "copying static2"
mkdir -p distrib/qira/static2
2014-11-23 04:43:08 +03:00
pyclean static2/
cp -av static2/* distrib/qira/static2/
2014-07-02 22:31:15 +04:00
# built for ida 6.6
# perhaps build for older IDA as well, ie 6.1
# and mac + windows
# fairly standard deps + libcrypto, libssl, libz and libida
2014-07-19 03:02:51 +04:00
mkdir -p distrib/qira/ida/bin
2014-07-15 02:50:10 +04:00
echo "copying ida plugin"
2014-07-31 03:02:23 +04:00
cp -av ida/bin/* distrib/qira/ida/bin/
2014-08-10 18:38:58 +04:00
echo "copying qemu source"
2014-07-31 03:02:23 +04:00
if [ $QEMU_SOURCE ]; then
#echo "copying qemu_mods for building qemu from source"
cp -Rav qemu_mods distrib/qira/
cp -av qemu_build.sh distrib/qira/
2014-07-31 22:47:11 +04:00
fi
if [ $QEMU_BINARIES ]; then
2014-07-31 03:02:23 +04:00
# fairly standard deps + librt, libglib, libpcre
echo "copying qemu"
mkdir -p distrib/qira/qemu
for arch in "i386" "arm" "x86_64" "ppc" "aarch64"; do
2014-08-10 18:38:58 +04:00
cp -v "qemu/qira-$arch" "distrib/qira/qemu/qira-$arch"
2014-07-31 03:02:23 +04:00
strip "distrib/qira/qemu/qira-$arch"
#upx -9 "distrib/qira/qemu/qira-$arch"
done
fi
2014-07-02 22:31:15 +04:00
2014-07-23 20:37:58 +04:00
echo "copying qiradb"
mkdir -p distrib/qira/qiradb
2014-07-31 03:02:23 +04:00
cp -Rav qiradb/* distrib/qira/qiradb/
2014-07-23 20:37:58 +04:00
2014-08-10 18:38:58 +04:00
echo "copying pin"
mkdir -p distrib/qira/pin
cp -av pin_build.sh distrib/qira/
cp -av pin/makefile pin/qirapin.cpp distrib/qira/pin/
2014-08-21 22:21:39 +04:00
mkdir -p distrib/qira/pin/strace
cp -av pin/strace/*.h distrib/qira/pin/strace/
2014-08-10 18:38:58 +04:00
2014-11-23 00:00:33 +03:00
#echo "copying cda"
#mkdir -p distrib/qira/cda distrib/qira/cda/clang
#cp -av cda/*.py distrib/qira/cda/
#cp -av cda/clang/*.py distrib/qira/cda/clang/
#cp -Rav cda/static distrib/qira/cda/
#cp -av cda_build.sh distrib/qira/
2014-08-10 23:39:59 +04:00
2014-07-02 22:31:15 +04:00
# package up the python, hopefully this includes pymongo driver
# hmm, it doesn't, user will need to install
#cd bin
#rm -rf qira_middleware
#mkdir -p qira_middleware
#cd qira_middleware
#~/build/PyInstaller-2.1/pyinstaller.py ../../scripts/qira_middleware.py
#cd dist/qira_middleware
#tar zcvf ../../../qira_middleware.tar.gz *
#cd ../../
#cd ../../
# *** startup ***
# the meteor and the middleware should always be running(fix the hang bug)
# launch both in upscript with qira-server in one window. make the teardown nice
# then you run qira-i386 <binary>, we need to hack in the -singlestep arg
2014-07-03 02:42:34 +04:00
echo "copying binaries"
cp -av requirements.txt install.sh qira fetchlibs.sh distrib/qira/
2014-07-03 02:42:34 +04:00
2014-07-03 05:24:10 +04:00
echo "making archive"
cd distrib/
tar cvf qira-$VERSION.tar qira
xz qira-$VERSION.tar
2014-07-03 05:24:10 +04:00
cd ../
2014-11-23 11:15:31 +03:00
sha1sum distrib/qira-$VERSION.tar.xz