nginx_build_script: move nginx repository/add freenginx
This commit is contained in:
parent
278510c841
commit
9abfd35bf4
@ -7,6 +7,7 @@ while [ ${#} -gt 0 ]; do
|
||||
--install | -i ) INSTALL=true ;; # Install Nginx
|
||||
--ssl=* )
|
||||
SSL_LIB="${1#*=}"
|
||||
SSL_LIB="${SSL_LIB,,}"
|
||||
case $SSL_LIB in # Re-define SSL_LIB
|
||||
"quictls") SSL_LIB="quictls" ;;
|
||||
"boringssl") SSL_LIB="boringssl" ;;
|
||||
@ -21,8 +22,23 @@ while [ ${#} -gt 0 ]; do
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
--type=* )
|
||||
BUILD_TYPE="${1#*=}"
|
||||
BUILD_TYPE="${BUILD_TYPE,,}"
|
||||
case $BUILD_TYPE in
|
||||
"nginx") BUILD_TYPE="nginx" ;;
|
||||
"freenginx") BUILD_TYPE="freenginx" ;;
|
||||
"")
|
||||
echo "ERROR : --type= is empty!"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "ERROR : Vaild values for --type are -> nginx, freenginx"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
--nginx-tag=* )
|
||||
NGINX_TAG="${1#*=}" # Specify Nginx Mercurial Tag
|
||||
NGINX_TAG="${1#*=}" # Specify Nginx/freenginx Tag
|
||||
case $NGINX_TAG in
|
||||
"")
|
||||
echo "ERROR: --nginx-tag= is empty!"
|
||||
@ -40,6 +56,7 @@ done
|
||||
|
||||
# if $SSL_LIB is null/empty
|
||||
SSL_LIB=${SSL_LIB:-"boringssl"}
|
||||
BUILD_TYPE=${BUILD_TYPE:-"nginx"}
|
||||
|
||||
#################################
|
||||
## ##
|
||||
@ -58,9 +75,29 @@ rm -rf $HOMEDIRECTORY
|
||||
|
||||
mkdir $HOMEDIRECTORY && cd $HOMEDIRECTORY
|
||||
|
||||
# Nginx
|
||||
#Setup Nginx/freenginx repository
|
||||
case $BUILD_TYPE in
|
||||
"nginx")
|
||||
cd $HOMEDIRECTORY
|
||||
hg clone https://hg.nginx.org/nginx $HOMEDIRECTORY/nginx
|
||||
git clone https://github.com/nginx/nginx $HOMEDIRECTORY/nginx
|
||||
cd $HOMEDIRECTORY/nginx
|
||||
|
||||
# Check if the tag exists
|
||||
if [[ -n $NGINX_TAG ]]
|
||||
then
|
||||
if git show-ref $NGINX_TAG --quiet; then
|
||||
echo "INFO: Switching Nginx Branch to ${NGINX_TAG}"
|
||||
git checkout $NGINX_TAG
|
||||
else
|
||||
echo "ERROR: NGINX_TAG specified is not existed. aborting..." && exit 1
|
||||
fi
|
||||
else
|
||||
git checkout master
|
||||
fi
|
||||
;;
|
||||
"freenginx")
|
||||
cd $HOMEDIRECTORY
|
||||
hg clone https://freenginx.org/hg/nginx $HOMEDIRECTORY/nginx
|
||||
|
||||
cd $HOMEDIRECTORY/nginx
|
||||
# Check if the tag exists
|
||||
@ -75,6 +112,8 @@ then
|
||||
else
|
||||
hg checkout default
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Build SSL Library
|
||||
case $SSL_LIB in
|
||||
|
Loading…
Reference in New Issue
Block a user