summaryrefslogtreecommitdiff
path: root/Makefile
blob: 622656854f824822f5c7e5211fbb8be886de24f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
NGX_VERSION=1.6.2
BUILD_DIR=nginx-$(NGX_VERSION)

all: fetch build

fetch: fetch_core fetch_dep

fetch_core:
	# Downloading source
	wget http://nginx.org/download/nginx-$(NGX_VERSION).tar.gz
	# Downloading signature
	wget http://nginx.org/download/nginx-$(NGX_VERSION).tar.gz.asc
	# Getting public key
	gpg --recv-keys A1C052F8
	# Verifying archiv
	gpg --verify nginx-$(NGX_VERSION).tar.gz.asc nginx-$(NGX_VERSION).tar.gz
	mkdir -p $(BUILD_DIR)
	tar xzf nginx-$(NGX_VERSION).tar.gz

fetch_dep:
	cd $(BUILD_DIR) && git clone https://github.com/agentzh/headers-more-nginx-module.git
	cd $(BUILD_DIR) && git clone https://github.com/nbs-system/naxsi.git
	cd $(BUILD_DIR) && git clone https://github.com/FRiCKLE/ngx_cache_purge.git
	cd $(BUILD_DIR) && git clone https://github.com/simpl/ngx_devel_kit.git
	cd $(BUILD_DIR) && git clone https://github.com/agentzh/echo-nginx-module.git
	cd $(BUILD_DIR) && git clone https://github.com/chaoslawful/lua-nginx-module.git
	cd $(BUILD_DIR) && git clone https://github.com/wandenberg/nginx-push-stream-module.git
	cd $(BUILD_DIR) && git clone https://github.com/arut/nginx-rtmp-module.git
	cd $(BUILD_DIR) && git clone https://github.com/masterzen/nginx-upload-progress-module.git
	cd $(BUILD_DIR) && git clone https://github.com/gnosek/nginx-upstream-fair.git
	cd $(BUILD_DIR) && git clone https://github.com/aperezdc/ngx-fancyindex.git
	cd $(BUILD_DIR) && git clone https://github.com/tony2001/ngx_http_pinba_module.git
	cd $(BUILD_DIR) && git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
	cd $(BUILD_DIR) && git clone https://github.com/pagespeed/ngx_pagespeed.git
	cd $(BUILD_DIR) && git clone https://github.com/alibaba/nginx-http-concat/ 
	cd $(BUILD_DIR) && git clone https://github.com/zebrafishlabs/nginx-statsd
	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 \
	--sbin-path=/usr/sbin \
	--conf-path=/etc/nginx/nginx.conf \
	--pid-path=/var/run/nginx.pid \
	--error-log-path=/var/log/nginx/error.log \
	--http-log-path=/var/log/nginx/access.log \
	--user=www-data \
	--group=www-data \
	--with-ipv6 \
	--with-pcre-jit \
	--with-http_ssl_module \
	--with-http_stub_status_module \
	--with-http_realip_module \
	--with-http_auth_request_module \
	--with-http_gzip_static_module \
	--with-http_mp4_module \
	--with-http_flv_module \
	--with-http_secure_link_module \
	--with-http_spdy_module \
	--with-http_sub_module \
	--with-http_addition_module \
	--with-google_perftools_module \
	--with-http_gunzip_module  \
	--add-module=headers-more-nginx-module \
	--add-module=naxsi/naxsi_src \
	--add-module=ngx_cache_purge \
	--add-module=ngx_devel_kit \
	--add-module=echo-nginx-module \
	--add-module=lua-nginx-module \
	--add-module=nginx-push-stream-module \
	--add-module=nginx-rtmp-module \
	--add-module=nginx-syslog \
	--add-module=nginx-upload-progress-module \
	--add-module=nginx-upstream-fair \
	--add-module=ngx-fancyindex \
	--add-module=ngx_http_pinba_module \
	--add-module=ngx_http_substitutions_filter_module \
	--add-module=./ngx_pagespeed \
	--add-module=./nginx-http-concat \
	--add-module=./nginx-x-rid-header \
	--with-ld-opt=-lossp-uuid \
	--add-module=./redis2-nginx-module \
	--add-module=./nginx-statsd
	cd $(BUILD_DIR)/auto && make

install:
	cd $(BUILD_DIR)/auto && make install

clean:
	rm nginx-$(NGX_VERSION).tar.gz
	rm nginx-$(NGX_VERSION).tar.gz.asc