/
build.sh
executable file
·61 lines (50 loc) · 1.81 KB
/
build.sh
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
#!/bin/bash
# this file is mostly meant to be used by the author himself.
root=`pwd`
#cd ~/work
version=$1
opts=$2
target=$root/work/nginx
if [ ! -d ./buildroot ]; then
mkdir ./buildroot || exit 1
fi
cd buildroot || exit 1
if [ ! -s "nginx-$version.tar.gz" ]; then
if [ -f ~/work/nginx-$version.tar.gz ]; then
cp ~/work/nginx-$version.tar.gz ./ || exit 1
else
wget "http://sysoev.ru/nginx/nginx-$version.tar.gz" -O nginx-$version.tar.gz || exit 1
fi
tar -xzvf nginx-$version.tar.gz || exit 1
fi
#tar -xzvf nginx-$version.tar.gz || exit 1
#cp $root/../no-pool-nginx/nginx-$version-no_pool.patch ./ || exit 1
#patch -p0 < nginx-$version-no_pool.patch || exit 1
cd nginx-$version/
if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$root/util/build.sh" -nt Makefile ]]; then
./configure --prefix=$target \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--without-http_upstream_ip_hash_module \
--without-http_empty_gif_module \
--without-http_memcached_module \
--without-http_referer_module \
--without-http_autoindex_module \
--without-http_auth_basic_module \
--without-http_userid_module \
--add-module=$root/../eval-nginx-module \
--add-module=$root/../echo-nginx-module \
--add-module=$root $opts \
--with-debug \
|| exit 1
#--add-module=$root/../ndk-nginx-module \
#--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!)
fi
if [ -f $target/sbin/nginx ]; then
rm -f $target/sbin/nginx
fi
if [ -f $target/logs/nginx.pid ]; then
kill `cat $target/logs/nginx.pid`
fi
make -j3 && make install