Permalink
Browse files

updated util/build.sh.

  • Loading branch information...
1 parent 1e9c386 commit 7c241bd3a28a4b9aeca9cd239fde882ac49fce08 @agentzh agentzh committed Mar 8, 2011
Showing with 27 additions and 10 deletions.
  1. +27 −10 util/build.sh
View
@@ -4,21 +4,38 @@
root=`pwd`
home=~
-cd ~/work || exit 1
version=$1
#opts=$2
+target=$root/work/nginx
rm -f ~/work/nginx-$version/objs/addon/src/ndk.o
rm -f ~/work/nginx-$version/objs/addon/ndk/ndk.o \
~/work/nginx-$version/objs/addon/ndk-nginx-module/ndk.o
+if [ ! -d ./buildroot ]; then
+ mkdir ./buildroot || exit 1
+fi
+
+cd buildroot || exit 1
+
if [ ! -s "nginx-$version.tar.gz" ]; then
- wget "http://sysoev.ru/nginx/nginx-$version.tar.gz" -O nginx-$version.tar.gz || exit 1
+ 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
- if [ "$version" = "0.8.41" ]; then
- cp $root/../no-pool-nginx/nginx-$version-no_pool.patch ./
- patch -p0 < nginx-$version-no_pool.patch || exit 1
+fi
+
+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
@@ -28,7 +45,7 @@ fi
cd nginx-$version/ || exit 1
if [[ "$BUILD_CLEAN" = 1 || ! -f Makefile || "$root/config" -nt Makefile || "$root/util/build.sh" -nt Makefile ]]; then
- ./configure --prefix=/opt/nginx \
+ ./configure --prefix=$target \
--with-http_ssl_module \
--without-mail_pop3_module \
--without-mail_imap_module \
@@ -50,11 +67,11 @@ if [[ "$BUILD_CLEAN" = 1 || ! -f Makefile || "$root/config" -nt Makefile || "$ro
#--add-module=$home/work/ndk \
#--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!)
fi
-if [ -f /opt/nginx/sbin/nginx ]; then
- rm -f /opt/nginx/sbin/nginx
+if [ -f $target/sbin/nginx ]; then
+ rm -f $target/sbin/nginx
fi
-if [ -f /opt/nginx/logs/nginx.pid ]; then
- kill `cat /opt/nginx/logs/nginx.pid`
+if [ -f $target/logs/nginx.pid ]; then
+ kill `cat $target/logs/nginx.pid`
fi
make -j3 && make install

0 comments on commit 7c241bd

Please sign in to comment.