Skip to content

Instantly share code, notes, and snippets.

@bhyde
Last active April 2, 2017 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhyde/dd4dee652d5ebe373e7e0214c8b099d4 to your computer and use it in GitHub Desktop.
Save bhyde/dd4dee652d5ebe373e7e0214c8b099d4 to your computer and use it in GitHub Desktop.
Install script for the s6 supervision suite.
#!/bin/bash
# Based on https://raw.githubusercontent.com/cburki/docker-s6builder/master/scripts/build.sh
# hence GNU GENERAL PUBLIC LICENSE Version 3
set -o errexit
trap 'echo ERROR: exiting on error' ERR
SRC_DIR=/tmp/$(basename $0)-$$
trap 'rm -rf $SRCDIR' EXIT
mkdir -p ${SRC_DIR}
DIST_DIR=/
mkdir -p ${DIST_DIR}
SKALIBS_VERSION=2.5.0.0
EXECLINE_VERSION=2.3.0.0
S6_VERSION=2.5.0.0
function download_archives {
cd ${SRC_DIR}
curl -O http://skarnet.org/software/skalibs/skalibs-${SKALIBS_VERSION}.tar.gz
curl -O http://skarnet.org/software/execline/execline-${EXECLINE_VERSION}.tar.gz
curl -O http://skarnet.org/software/s6/s6-${S6_VERSION}.tar.gz
}
function build_skalibs {
cd ${SRC_DIR}
tar zxvf skalibs-${SKALIBS_VERSION}.tar.gz
cd skalibs-${SKALIBS_VERSION}
./configure --prefix=${DIST_DIR} --enable-static --disable-shared
make
sudo make install
}
function build_execline {
cd ${SRC_DIR}
tar zxvf execline-${EXECLINE_VERSION}.tar.gz
cd execline-${EXECLINE_VERSION}
./configure --prefix=${DIST_DIR} --with-include=${DIST_DIR}/include/ --with-lib=${DIST_DIR}/lib/skalibs/ --enable-static --disable-shared
make
sudo make install
}
function build_s6 {
cd ${SRC_DIR}
tar zxvf s6-${S6_VERSION}.tar.gz
cd s6-${S6_VERSION}
./configure --prefix=${DIST_DIR} --with-include=${DIST_DIR}/include/ --with-lib=${DIST_DIR}/lib/skalibs --with-lib=${DIST_DIR}/lib/execline --enable-static --disable-shared
make
sudo make install
}
# Build
download_archives
build_skalibs
build_execline
build_s6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment