infrastruktur:custom_builds

Action disabled: source

FREIFUNK - MÜNCHEN Bild: Freifunk-München-Logo

Custom Builds

Wir nutzen folgendes Skript zum Bau unserer benutzten nginx-Module:

#!/bin/bash
set -e

version=$1
echo "####################################"
echo "# Build modules for nginx $version"
echo "####################################"
[ -f nginx-$version.tar.gz ] || wget https://nginx.org/download/nginx-$version.tar.gz
[ -d nginx-$version ] || tar -xvf nginx-$version.tar.gz

[ -d modules ] || mkdir modules

if ! [ -d modules/ngx-fancyindex ] ; then
        echo "# Fetch module fancyindex #"
        pushd modules
        git clone https://github.com/aperezdc/ngx-fancyindex.git
        popd
fi

if ! [ -d modules/ngx_brotli ] ; then
        echo "# fetch module brotli#"
        pushd modules
        git clone --recursive https://github.com/eustas/ngx_brotli.git
        popd
fi

pushd "nginx-$version"

        if [ -d out ] ; then
                echo "Build already done; abort"
                exit 0
        fi

        ./configure \
                --add-dynamic-module=../modules/ngx_brotli \
                --add-dynamic-module=../modules/ngx-fancyindex \
                --with-compat

        make modules -j 8

        mkdir ../modules-out 2>/dev/null || true
        mv objs/*.so ../modules-out/
popd

exit 0

Die gebauten Module liegen anschließend im Ordner „modules-out“. Die Ordner „modules“ und „nginx-$version“ können anschließend gelöscht werden.

  • infrastruktur/custom_builds.txt
  • Zuletzt geändert: 2020/10/02 10:54
  • von krombel