Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
paperless-baremetal/nginx.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
79 lines (56 sloc)
1.85 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
{ | |
set -x | |
set -e | |
set -u | |
. build.profile | |
. ${PREFIX}/${BUILD_sqlite}/profile | |
. ${PREFIX}/${BUILD_python}/profile | |
function B_NGINX { | |
# SRCURL[0]="https://nginx.org/download/nginx-1.26.1.tar.gz" | |
SRCURL="https://beehive.molgen.mpg.de/56b83c172c7f2fd09d59123bc28ff2b1/nginx-1.26.1.tar.gz" | |
BUILD_PKG=${BUILD_nginx} | |
BUILD_EXT=${SRCURL/${SRCURL%.*.*}/} | |
PREFIX=${PREFIX}/${BUILD_PKG} | |
mkdir -p ${PREFIX} | |
cat >${PREFIX}/profile <<-EOF | |
PATH=${PREFIX}/sbin:\${PATH} | |
EOF | |
if [ -v NGINX_SSL_DHPARAM ]; then | |
mkdir -p "${NGINX_SSL_DHPARAM%/*}" | |
test -e "${NGINX_SSL_DHPARAM}" || openssl dhparam -dsaparam -out "${NGINX_SSL_DHPARAM}" 2048 | |
fi | |
test -e ${BUILD_PKG}${BUILD_EXT} || wget -nv "${SRCURL}" -O ${BUILD_PKG}${BUILD_EXT} | |
test -d ${BUILD_PKG} || mkdir -pv ${BUILD_PKG} && tar -xf ${BUILD_PKG}${BUILD_EXT} --strip-components=1 -C ${BUILD_PKG} | |
pushd ${BUILD_PKG} | |
# static const u_char nginx[5] = "\x84\xaa\x63\x55\xe7"; | |
# What you see here is the representation of the string "nginx" compressed with HPACK's Huffman encoding. | |
# ~/go/src/github.com/wwwutz/hpack | |
patch -p1 --silent --backup --forward --input=${BUILD_SRC}/nginx.chicken.patch || true | |
local _conf=( | |
--prefix="${PREFIX}" | |
--with-http_ssl_module | |
--with-http_v2_module | |
--without-http_uwsgi_module | |
--without-http_scgi_module | |
--without-http_grpc_module | |
--without-http_memcached_module | |
--error-log-path="${LOGDIR}"/nginx-error.log | |
--http-log-path="${LOGDIR}"/nginx-access.log | |
--http-client-body-temp-path="${DEVSHM}"/client-body-temp | |
--http-proxy-temp-path="${DEVSHM}"/proxy-temp | |
--http-fastcgi-temp-path="${DEVSHM}"/fastcgi-temp | |
--pid-path="${DEVSHM}"/nginx.pid | |
--lock-path="${DEVSHM}"/nginx.lock | |
--with-debug | |
--build=bwakbwakbwak | |
) | |
CFLAGS='-O2 -fPIC' \ | |
./configure "${_conf[@]}" | |
make -j "${NPROC}" install | |
popd | |
} | |
pushd "${BUILD_DIR}" | |
B_NGINX | |
popd | |
} |