#!/bin/bash set -o errexit cd ~/usr/src/nginx || { echo "where you do you build packages?" ; exit 1; } VERSION="1.0.6" [[ "$1" != "" ]] && VERSION="$1" NAME="nginx-${VERSION}" meta() { local url=$1 local fix="$2" local dir=$3 tmp="tmp.tar.gz" [[ -f $tmp ]] && rm $tmp [[ -d $dir ]] && return #rm -rf $dir echo "Getting ${dir}" wget -q -O tmp.tar.gz $url tar zxf tmp.tar.gz mv $fix $dir rm $tmp } meta http://launchpad.net/drizzle/fremont/2011-08-29/+download/drizzle7-2011.08.25.tar.gz 'drizzle7-*' libdrizzel [[ -d libdrizzel && ! -f /opt/libdrizzle-7/lib/libdrizzle.so ]] && ( cd libdrizzel sudo mv /usr/bin/python /usr/bin/python.sucks sudo ln -s /usr/bin/python2 /usr/bin/python ./configure --without-server --prefix=/opt/libdrizzle-7 make libdrizzle-1.0 sudo make install-libdrizzle-1.0 [[ -L /usr/bin/python ]] && { sudo rm /usr/bin/python sudo ln -s /usr/bin/python3 /usr/bin/python } ) meta https://github.com/calio/form-input-nginx-module/tarball/master 'calio-*' ngx-form-input meta 'https://github.com/agentzh/echo-nginx-module/tarball/master' 'agentzh-*' 'ngx-echo' meta 'https://github.com/agentzh/headers-more-nginx-module/tarball/master' 'agentzh-*' 'ngx-more-headers' #meta 'https://github.com/agentzh/nginx-eval-module/tarball/master' 'agentzh-*' 'ngx-eval' # deprecated for lua meta https://github.com/yaoweibin/nginx_syslog_patch/tarball/master 'yaoweibin*' syslog-patch meta https://github.com/chaoslawful/drizzle-nginx-module/tarball/v0.1.1rc4 'chaoslawful-drizzle-nginx-module-*' drizzel meta https://github.com/simpl/ngx_devel_kit/tarball/master 'simpl-*' ngx-devel-kit meta https://github.com/agentzh/encrypted-session-nginx-module/tarball/v0.01 'agentzh-encrypted-session-*' enc-session meta https://github.com/FRiCKLE/ngx_postgres/tarball/master 'FRiCKLE-ngx_postgres-*' ngx-postgres meta https://github.com/agentzh/rds-json-nginx-module/tarball/v0.12rc5 'agentzh-rds-json-*' ngx-rds-json meta https://github.com/mikewest/nginx-static-etags/tarball/master 'mikewest-nginx-static-etags-*' ngx-static-etags meta http://www.grid.net.ru/nginx/download/nginx_upload_module-2.2.0.tar.gz nginx_upload_* ngx-upload meta http://hg.mperillo.ath.cx/nginx/mod_wsgi/archive/8994b058d2db.tar.gz 'mod_wsgi-*' ngx-mod-wsgi meta 'https://github.com/agentzh/set-misc-nginx-module/tarball/v0.22rc2' 'agentzh-*' 'ngx-set-misc' meta 'https://github.com/chaoslawful/lua-nginx-module/tarball/master' 'chaoslawful-*' 'ngx-lua' opts=" --prefix=/opt/${NAME} --with-file-aio --with-ipv6 --with-pcre --add-module=../ngx-devel-kit/ --add-module=../ngx-echo/ --add-module=../ngx-lua/ --add-module=../drizzel/ --add-module=../syslog-patch/ --add-module=../ngx-form-input/ --add-module=../enc-session/ --add-module=../ngx-postgres/ --add-module=../ngx-rds-json/ --add-module=../ngx-set-misc/ --add-module=../ngx-more-headers/ --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-http_dav_module --with-http_flv_module --http-fastcgi-temp-path=/tmp/ " unused_opts=" --add-module=../ngx-mod-wsgi/ --add-module=../ngx-static-etags/ --add-module=../ngx-upload/ " [[ ! -d $NAME ]] && meta "http://nginx.org/download/${NAME}.tar.gz" $NAME $NAME has_syslog_patch="${NAME}/.has_syslog_patch" [[ ! -f $has_syslog_patch ]] && { (cd $NAME; patch -p1 < ../syslog-patch/syslog_1.0.6.patch) touch ${has_syslog_patch} } [[ -d $NAME ]] && ( cd $NAME export LIBDRIZZLE_INC=/opt/libdrizzle-7/include/libdrizzle-1.0 export LIBDRIZZLE_LIB=/opt/libdrizzle-7/lib ./configure $opts make -j 2 sudo make install )