summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32015-03-16 19:24:15 +0100
committerHorus32015-03-16 19:24:15 +0100
commit0fa068bac22d02a25c7c7177c64ce30a80f01689 (patch)
tree4e81fdac590c0d270fee40f27518a41dc09a8188
parent28adb69ff8d8489dfa5a2284e5ce72feba278ed4 (diff)
downloadnginx-build-0fa068bac22d02a25c7c7177c64ce30a80f01689.tar.gz
Adding help target, split 'libraries' into 'prepare' and 'pagespeed'. Updated building options.
-rw-r--r--Makefile42
1 files changed, 29 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 85ecd54..ee24043 100644
--- a/Makefile
+++ b/Makefile
@@ -4,15 +4,15 @@ BUILD_DIR=nginx-$(NGX_VERSION)
all: fetch build
-fetch: fetch_core fetch_dep
+fetch: fetch_core pagespeed fetch_dep
fetch_core:
# Downloading source
- wget http://nginx.org/download/nginx-$(NGX_VERSION).tar.gz
+ test -f nginx-$(NGX_VERSION).tar.gz || wget http://nginx.org/download/nginx-$(NGX_VERSION).tar.gz
# Downloading signature
- wget http://nginx.org/download/nginx-$(NGX_VERSION).tar.gz.asc
+ test -f nginx-$(NGX_VERSION).tar.gz.asc || wget http://nginx.org/download/nginx-$(NGX_VERSION).tar.gz.asc
# Getting public key
- gpg --recv-keys A1C052F8
+ gpg --keyserver keyserver.ubuntu.com --recv-keys A1C052F8
# Verifying archiv
gpg --verify nginx-$(NGX_VERSION).tar.gz.asc nginx-$(NGX_VERSION).tar.gz
mkdir -p $(BUILD_DIR)
@@ -38,6 +38,7 @@ fetch_dep:
cd $(BUILD_DIR) && git clone https://github.com/newobj/nginx-x-rid-header
cd $(BUILD_DIR) && git clone https://github.com/openresty/redis2-nginx-module
mkdir $(BUILD_DIR)/nginx-syslog && wget -O $(BUILD_DIR)/nginx-syslog/config https://raw.githubusercontent.com/gplessis/dotdeb-nginx/wheezy/debian/modules/nginx-syslog/config
+
build:
cd $(BUILD_DIR) && ./configure \
--prefix=/etc/nginx \
@@ -79,27 +80,42 @@ build:
--add-module=ngx_http_substitutions_filter_module \
--add-module=./ngx_pagespeed \
--add-module=./nginx-http-concat \
- --add-module=./nginx-x-rid-header \
+ --with-cc-opt=-I/usr/include/ossp \
--with-ld-opt=-lossp-uuid \
+ --add-module=./nginx-x-rid-header \
--add-module=./redis2-nginx-module \
--add-module=./nginx-statsd
- cd $(BUILD_DIR)/auto && make
+ cd $(BUILD_DIR)/ && make
install:
- cd $(BUILD_DIR)/auto && make install
+ cd $(BUILD_DIR)/ && make install
clean:
rm nginx-$(NGX_VERSION).tar.gz
rm nginx-$(NGX_VERSION).tar.gz.asc
-libraries:
+prepare:
+ @(lsb_release -a | grep Debian || ! test -z $(DEBIAN)) || (echo "You don't run Debian, do you? This section is optimized for the Debian GNU/Linux distro.\nOverwrite it with 'DEBIAN=1 make prepare'.\n" && exit 1)
dpkg -l | grep build-essential || apt-get install build-essential
dpkg -l | grep zlib1g-dev || apt-get install zlib1g-dev
- dpkg -l | grep -E '^libpcre3$' || apt-get install libpcre3
- dpkg -l | grep -E '^libpcre3-dev$' || apt-get install libpcre3-dev
- dpkg -l | grep liblua || apt-get install libluajit-5.1-dev
+ dpkg -l | grep -E '^libpcre3$$' || apt-get install libpcre3
+ dpkg -l | grep -E '^libpcre3-dev$$' || apt-get install libpcre3-dev
+ dpkg -l | grep liblua5.1-0-dev || apt-get install liblua5.1-0-dev
dpkg -l | grep libossp-uuid-dev || apt-get install libossp-uuid-dev
- (test -d $(BUILD_DIR)/ngx_pagespeed && cd $(BUILD_DIR)/ngx_pagespeed \
- wget https://dl.google.com/dl/page-speed/psol/$(NGX_PAGESPEED_VERSION).tar.gz &&
+ dpkg -l | grep uuid-dev || apt-get install uuid-dev
+ dpkg -l | grep libgoogle-perftools-dev || apt-get install libgoogle-perftools-dev
+ dpkg -l | grep libssl-dev || apt-get install libssl-dev
+
+pagespeed:
+ @(test -d $(BUILD_DIR)/ngx_pagespeed && cd $(BUILD_DIR)/ngx_pagespeed && \
+ echo "Downloading pagespeed library." && \
+ wget https://dl.google.com/dl/page-speed/psol/$(NGX_PAGESPEED_VERSION).tar.gz && \
tar -xzvf $(NGX_PAGESPEED_VERSION).tar.gz) || \
echo "You need to run 'make fetch_dep' first to download ngx_pagespeed."
+
+help:
+ @echo "This is a Makefile to automatize compiling nginx from source.\n"
+ @echo "Run 'make fetch' to fetch the core and addons."
+ @echo "Run 'make build' to configure and compile nginx."
+ @echo "'make install' will install it system wide (needs root previleges)."
+ @echo "If you are on GNU/Debian, you can run 'make prepare' to install some needed libraries."