From f76e1d0d1989482d180a0aaf72eb93f528d17dfb Mon Sep 17 00:00:00 2001 From: Florian Heinemann Date: Mon, 3 Nov 2014 23:36:08 -0500 Subject: [PATCH] Initial commit --- bin/compile | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++-- bin/detect | 2 +- 2 files changed, 70 insertions(+), 3 deletions(-) diff --git a/bin/compile b/bin/compile index e7078dd..5c88631 100755 --- a/bin/compile +++ b/bin/compile @@ -1,8 +1,75 @@ #!/usr/bin/env bash set -e -apt-get update -apt-get -y install nginx +NGINX_VERSION="1.6.2" +NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz" +PCRE_VERSION="8.34" +PCRE_TARBALL="pcre-${PCRE_VERSION}.tar.gz" +ZLIB_VERSION="1.2.8" +ZLIB_TARBALL="zlib-${ZLIB_VERSION}.tar.gz" + +if [[ ! -d "${NGINX_TARBALL%.tar.gz}" ]]; then + wget "http://nginx.org/download/${NGINX_TARBALL}" + tar xvzf "${NGINX_TARBALL}" && rm -f "${NGINX_TARBALL}" +fi + +if [[ ! -d "${PCRE_TARBALL%.tar.gz}" ]]; then + wget "http://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${PCRE_TARBALL}" + tar xvzf "${PCRE_TARBALL}" && rm -f "${PCRE_TARBALL}" +fi + +if [[ ! -d "${ZLIB_TARBALL%.tar.gz}" ]]; then + wget "http://zlib.net/${ZLIB_TARBALL}" + tar xvzf "${ZLIB_TARBALL}" && rm -rf "${ZLIB_TARBALL}" +fi + +cd "nginx-${NGINX_VERSION}" +mkdir ../nginx +./configure \ + --with-cpu-opt=generic \ + --prefix=../nginx \ + --with-pcre=../pcre-${PCRE_VERSION} \ + --sbin-path=. \ + --pid-path=./nginx.pid \ + --conf-path=./nginx.conf \ + --with-ld-opt="-static" \ + --with-http_spdy_module \ + --with-http_stub_status_module \ + --with-http_gzip_static_module \ + --with-file-aio \ + --with-zlib=../zlib-${ZLIB_VERSION} \ + --with-pcre \ + --with-cc-opt="-O2 -static -static-libgcc" \ + --without-http_charset_module \ + --without-http_ssi_module \ + --without-http_userid_module \ + --without-http_access_module \ + --without-http_auth_basic_module \ + --without-http_autoindex_module \ + --without-http_geo_module \ + --without-http_map_module \ + --without-http_split_clients_module \ + --without-http_referer_module \ + --without-http_proxy_module \ + --without-http_fastcgi_module \ + --without-http_uwsgi_module \ + --without-http_scgi_module \ + --without-http_memcached_module \ + --without-http_empty_gif_module \ + --without-http_browser_module \ + --without-http_upstream_ip_hash_module \ + --without-http_upstream_least_conn_module \ + --without-http_upstream_keepalive_module \ + --without-mail_pop3_module \ + --without-mail_imap_module \ + --without-mail_smtp_module + +sed -i "/CFLAGS/s/ \-O //g" objs/Makefile + +make +make install + +rm -rf "nginx-${NGINX_VERSION}" BINDIR=$(dirname "$0") diff --git a/bin/detect b/bin/detect index ce643f6..7c91c11 100755 --- a/bin/detect +++ b/bin/detect @@ -2,7 +2,7 @@ set -e if [[ -f $1/.nginx ]]; then - echo "nginx" + echo ".nginx" exit 0 else exit 1