Annotation of embedaddon/nginx/auto/install, revision 1.1
1.1 ! misho 1:
! 2: # Copyright (C) Igor Sysoev
! 3: # Copyright (C) Nginx, Inc.
! 4:
! 5:
! 6: if [ $USE_PERL = YES ]; then
! 7:
! 8: cat << END >> $NGX_MAKEFILE
! 9:
! 10: install_perl_modules:
! 11: cd $NGX_OBJS/src/http/modules/perl && \$(MAKE) install
! 12: END
! 13:
! 14: NGX_INSTALL_PERL_MODULES=install_perl_modules
! 15:
! 16: fi
! 17:
! 18:
! 19: case ".$NGX_SBIN_PATH" in
! 20: ./*)
! 21: ;;
! 22:
! 23: .)
! 24: NGX_SBIN_PATH=$NGX_PREFIX/sbin/nginx
! 25: ;;
! 26:
! 27: *)
! 28: NGX_SBIN_PATH=$NGX_PREFIX/$NGX_SBIN_PATH
! 29: ;;
! 30: esac
! 31:
! 32:
! 33: case ".$NGX_CONF_PATH" in
! 34: ./*)
! 35: ;;
! 36:
! 37: *)
! 38: NGX_CONF_PATH=$NGX_PREFIX/$NGX_CONF_PATH
! 39: ;;
! 40: esac
! 41:
! 42:
! 43: NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
! 44:
! 45:
! 46: case ".$NGX_PID_PATH" in
! 47: ./*)
! 48: ;;
! 49:
! 50: *)
! 51: NGX_PID_PATH=$NGX_PREFIX/$NGX_PID_PATH
! 52: ;;
! 53: esac
! 54:
! 55:
! 56: case ".$NGX_ERROR_LOG_PATH" in
! 57: ./* | .)
! 58: ;;
! 59:
! 60: *)
! 61: NGX_ERROR_LOG_PATH=$NGX_PREFIX/$NGX_ERROR_LOG_PATH
! 62: ;;
! 63: esac
! 64:
! 65:
! 66: case ".$NGX_HTTP_LOG_PATH" in
! 67: ./*)
! 68: ;;
! 69:
! 70: *)
! 71: NGX_HTTP_LOG_PATH=$NGX_PREFIX/$NGX_HTTP_LOG_PATH
! 72: ;;
! 73: esac
! 74:
! 75:
! 76: if test -f man/nginx.8 ; then
! 77: NGX_MAN=man/nginx.8
! 78: else
! 79: NGX_MAN=docs/man/nginx.8
! 80: fi
! 81:
! 82: if test -d html ; then
! 83: NGX_HTML=html
! 84: else
! 85: NGX_HTML=docs/html
! 86: fi
! 87:
! 88: cat << END >> $NGX_MAKEFILE
! 89:
! 90: manpage: $NGX_OBJS/nginx.8
! 91:
! 92: $NGX_OBJS/nginx.8: $NGX_MAN $NGX_AUTO_CONFIG_H
! 93: sed -e "s|%%PREFIX%%|$NGX_PREFIX|" \\
! 94: -e "s|%%PID_PATH%%|$NGX_PID_PATH|" \\
! 95: -e "s|%%CONF_PATH%%|$NGX_CONF_PATH|" \\
! 96: -e "s|%%ERROR_LOG_PATH%%|${NGX_ERROR_LOG_PATH:-stderr}|" \\
! 97: < $NGX_MAN > \$@
! 98:
! 99: install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \
! 100: $NGX_INSTALL_PERL_MODULES
! 101: test -d '\$(DESTDIR)$NGX_PREFIX' || mkdir -p '\$(DESTDIR)$NGX_PREFIX'
! 102:
! 103: test -d '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`' \
! 104: || mkdir -p '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`'
! 105: test ! -f '\$(DESTDIR)$NGX_SBIN_PATH' \
! 106: || mv '\$(DESTDIR)$NGX_SBIN_PATH' \
! 107: '\$(DESTDIR)$NGX_SBIN_PATH.old'
! 108: cp $NGX_OBJS/nginx '\$(DESTDIR)$NGX_SBIN_PATH'
! 109:
! 110: test -d '\$(DESTDIR)$NGX_CONF_PREFIX' \
! 111: || mkdir -p '\$(DESTDIR)$NGX_CONF_PREFIX'
! 112:
! 113: cp conf/koi-win '\$(DESTDIR)$NGX_CONF_PREFIX'
! 114: cp conf/koi-utf '\$(DESTDIR)$NGX_CONF_PREFIX'
! 115: cp conf/win-utf '\$(DESTDIR)$NGX_CONF_PREFIX'
! 116:
! 117: test -f '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types' \
! 118: || cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX'
! 119: cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types.default'
! 120:
! 121: test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params' \
! 122: || cp conf/fastcgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
! 123: cp conf/fastcgi_params \
! 124: '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params.default'
! 125:
! 126: test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf' \
! 127: || cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX'
! 128: cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf.default'
! 129:
! 130: test -f '\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params' \
! 131: || cp conf/uwsgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
! 132: cp conf/uwsgi_params \
! 133: '\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params.default'
! 134:
! 135: test -f '\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params' \
! 136: || cp conf/scgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
! 137: cp conf/scgi_params \
! 138: '\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params.default'
! 139:
! 140: test -f '\$(DESTDIR)$NGX_CONF_PATH' \
! 141: || cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PATH'
! 142: cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX/nginx.conf.default'
! 143:
! 144: test -d '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' \
! 145: || mkdir -p '\$(DESTDIR)`dirname "$NGX_PID_PATH"`'
! 146:
! 147: test -d '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`' || \
! 148: mkdir -p '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`'
! 149:
! 150: test -d '\$(DESTDIR)$NGX_PREFIX/html' \
! 151: || cp -R $NGX_HTML '\$(DESTDIR)$NGX_PREFIX'
! 152: END
! 153:
! 154:
! 155: if test -n "$NGX_ERROR_LOG_PATH"; then
! 156: cat << END >> $NGX_MAKEFILE
! 157:
! 158: test -d '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`' || \
! 159: mkdir -p '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`'
! 160: END
! 161:
! 162: fi
! 163:
! 164:
! 165: # create Makefile
! 166:
! 167: cat << END >> Makefile
! 168:
! 169: build:
! 170: \$(MAKE) -f $NGX_MAKEFILE
! 171: \$(MAKE) -f $NGX_MAKEFILE manpage
! 172:
! 173: install:
! 174: \$(MAKE) -f $NGX_MAKEFILE install
! 175:
! 176: upgrade:
! 177: $NGX_SBIN_PATH -t
! 178:
! 179: kill -USR2 \`cat $NGX_PID_PATH\`
! 180: sleep 1
! 181: test -f $NGX_PID_PATH.oldbin
! 182:
! 183: kill -QUIT \`cat $NGX_PID_PATH.oldbin\`
! 184: END
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>