runit-artifacts.sh 1.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#!/bin/sh

#
# Builds the artifacts required for runit on Ubuntu.  Our version is
# customized.
#

set -x

export DEBIAN_FRONTEND=noninteractive

if [ -n "$DESTDIR" ]; then
    export DESTDIR="$DESTDIR/runit"
    mkdir -p $DESTDIR
fi

DIRNAME=`pwd`

$DIRNAME/ubuntu/prepare.sh

apt-get install -y --no-install-suggests --no-install-recommends \
    build-essential dpkg-dev wget
cd /tmp
if [ -z "$RUNITSRC" ]; then
    apt-get install -y --no-install-suggests --no-install-recommends \
	git ca-certificates
    git clone https://gitlab.flux.utah.edu/emulab/runit runit
else
    mkdir -p runit
    cp -pR $RUNITSRC/* runit
fi
cd runit/

if [ ! -f runit-2.1.2.tar.gz ]; then
    wget http://www.emulab.net/downloads/docker/runit-2.1.2.tar.gz
    if [ ! $? -eq 0 ]; then
	wget http://smarden.org/runit/runit-2.1.2.tar.gz
    fi
fi
if [ -d runit-2.1.2 ]; then
    rm -rf runit-2.1.2
fi
tar -xzf runit-2.1.2.tar.gz --strip-components=1
dpkg-buildpackage -uc -us
cd ..
46 47 48 49
mkdir -p $DESTDIR/tmp
chmod root:root $DESTDIR/tmp
chmod 1777 $DESTDIR/tmp
cp -p *.deb $DESTDIR/tmp
50 51 52 53 54
rm -rf runit *.deb *.dsc

$DIRNAME/ubuntu/cleanup.sh

exit 0