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
|
--install | -i ) INSTALL=true ;; # Install Nginx
|
||||||
--ssl=* )
|
--ssl=* )
|
||||||
SSL_LIB="${1#*=}"
|
SSL_LIB="${1#*=}"
|
||||||
|
SSL_LIB="${SSL_LIB,,}"
|
||||||
case $SSL_LIB in # Re-define SSL_LIB
|
case $SSL_LIB in # Re-define SSL_LIB
|
||||||
"quictls") SSL_LIB="quictls" ;;
|
"quictls") SSL_LIB="quictls" ;;
|
||||||
"boringssl") SSL_LIB="boringssl" ;;
|
"boringssl") SSL_LIB="boringssl" ;;
|
||||||
@ -21,8 +22,23 @@ while [ ${#} -gt 0 ]; do
|
|||||||
;;
|
;;
|
||||||
esac
|
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=* )
|
||||||
NGINX_TAG="${1#*=}" # Specify Nginx Mercurial Tag
|
NGINX_TAG="${1#*=}" # Specify Nginx/freenginx Tag
|
||||||
case $NGINX_TAG in
|
case $NGINX_TAG in
|
||||||
"")
|
"")
|
||||||
echo "ERROR: --nginx-tag= is empty!"
|
echo "ERROR: --nginx-tag= is empty!"
|
||||||
@ -40,6 +56,7 @@ done
|
|||||||
|
|
||||||
# if $SSL_LIB is null/empty
|
# if $SSL_LIB is null/empty
|
||||||
SSL_LIB=${SSL_LIB:-"boringssl"}
|
SSL_LIB=${SSL_LIB:-"boringssl"}
|
||||||
|
BUILD_TYPE=${BUILD_TYPE:-"nginx"}
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
## ##
|
## ##
|
||||||
@ -58,23 +75,45 @@ rm -rf $HOMEDIRECTORY
|
|||||||
|
|
||||||
mkdir $HOMEDIRECTORY && cd $HOMEDIRECTORY
|
mkdir $HOMEDIRECTORY && cd $HOMEDIRECTORY
|
||||||
|
|
||||||
# Nginx
|
#Setup Nginx/freenginx repository
|
||||||
cd $HOMEDIRECTORY
|
case $BUILD_TYPE in
|
||||||
hg clone https://hg.nginx.org/nginx $HOMEDIRECTORY/nginx
|
"nginx")
|
||||||
|
cd $HOMEDIRECTORY
|
||||||
|
git clone https://github.com/nginx/nginx $HOMEDIRECTORY/nginx
|
||||||
|
cd $HOMEDIRECTORY/nginx
|
||||||
|
|
||||||
cd $HOMEDIRECTORY/nginx
|
# Check if the tag exists
|
||||||
# Check if the tag exists
|
if [[ -n $NGINX_TAG ]]
|
||||||
if [[ -n $NGINX_TAG ]]
|
then
|
||||||
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
|
||||||
|
if [[ -n $NGINX_TAG ]]
|
||||||
|
then
|
||||||
if hg tags | grep -q "^${NGINX_TAG}\>"; then
|
if hg tags | grep -q "^${NGINX_TAG}\>"; then
|
||||||
echo "INFO: Switching Nginx Branch to ${NGINX_TAG}"
|
echo "INFO: Switching Nginx Branch to ${NGINX_TAG}"
|
||||||
hg checkout $NGINX_TAG
|
hg checkout $NGINX_TAG
|
||||||
else
|
else
|
||||||
echo "ERROR: NGINX_TAG specified is not existed. aborting..." && exit 1
|
echo "ERROR: NGINX_TAG specified is not existed. aborting..." && exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
hg checkout default
|
hg checkout default
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Build SSL Library
|
# Build SSL Library
|
||||||
case $SSL_LIB in
|
case $SSL_LIB in
|
||||||
|
Loading…
Reference in New Issue
Block a user