# This script gets executed inside the docker-bundler-apt image. # Produces a RiseupVPN bundle inside the volume exported as /dist # (no virtualenv, so all the dependencies must be already installed in the image). : ${REPO:="https://github.com/leapcode/bitmask-dev"} : ${BRANCH:="master"} # build bitmask-systray # (dependencies should already be in the base image) export SYSTRAY_SRC=/srv/go/src/0xacab.org/leap/bitmask-systray/ export GOPATH=/srv/go export CGO_CPPFLAGS="-I/usr/include" export CGO_LDFLAGS="-L/usr/lib -L/usr/lib/z86_64-linux-gnu -lzmq -lpthread -lsodium -lrt -lstdc++ -lm -lc -lgcc" export BITMASK_HOME=${HOME}/bitmaskbuild echo "[+] building systray" cd ${SYSTRAY_SRC} git pull # XXX FIXME ----- master is broken. git checkout 352b8df go build . cd $HOME echo "[+] CLONING REPO from $REPO [$BRANCH]" rm -rf bitmaskbuild git clone --depth 1 --single-branch --branch $BRANCH $REPO bitmaskbuild cd bitmaskbuild git fetch --tags RELEASE=anonvpn-`cat pkg/next-version` BRANDED=RiseupVPN-`cat pkg/next-version` echo "[+] RELEASE: $RELEASE" # uninstall bitmask-dev from base image and install bitmask-vpn pip uninstall --yes leap.bitmask pip install -e '.[vpn]' mkdir -p dist/ # nuke bitmask mail rm -rf src/leap/bitmask/mail # build anonvpn bundle VIRTUAL_ENV=/usr/local make bundle_anonvpn_linux # copy systray binary and libs echo "[+] Copy systray binary" cp ${SYSTRAY_SRC}/bitmask-systray dist/${RELEASE}/lib/ # really, get all the things, and the kitchen sink... time to trim later on. pkg/hunter/gatherer dist/${RELEASE}/lib/bitmask-systray dist/${RELEASE}/lib/ # copy assets cp ${SYSTRAY_SRC}/riseupvpn.svg dist/${RELEASE}/lib/riseupvpn.svg # trim some bytes rm dist/${RELEASE}/lib/pysqlcipher._sqlite.so rm dist/${RELEASE}/lib/libsqlite3.so.0 # rename entrypoint and put wrapper in place echo "[+] Build and copy wrapper binary" cd $HOME/bitmaskbuild/pkg/launcher && make cd $HOME/bitmaskbuild cp pkg/launcher/bitmask dist/${RELEASE}/RiseupVPN mv dist/${RELEASE}/lib/anonvpn dist/${RELEASE}/lib/bitmask mv dist/${RELEASE} dist/${BRANDED} cp -r dist/* /dist echo "[+] DONE"