OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.9 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../nginx/nginx.conf
  5. # Copyright (C) 2009 - 2011 The OpenSDE Project
  6. # Copyright (C) 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. if [ $prefix_auto = 1 ]; then
  16. prefix="opt/nginx"
  17. set_confopt
  18. fi
  19. cleanconfopt=0
  20. confopt="--prefix=/$prefix"
  21. [[ "$sysconfdir" = */$pkg ]] || sysconfdir=$sysconfdir/$pkg
  22. var_append confopt ' ' "--conf-path=$sysconfdir/nginx.conf"
  23. # set path to nginx.pid file
  24. var_append confopt ' ' "--pid-path=$localstatedir/run/nginx.pid"
  25. # set path to nginx.lock file
  26. var_append confopt ' ' "--lock-path=$localstatedir/lock/nginx.lock"
  27. # set temporary paths and files
  28. for x in proxy fastcgi uwsgi client-body; do
  29. var_append confopt ' ' "--http-$x-temp-path=$localstatedir/temp/${x//-/_}_temp"
  30. done
  31. # log directories
  32. logdir="$localstatedir/log/$pkg"
  33. var_append confopt ' ' "--http-log-path=$logdir/access.log"
  34. var_append confopt ' ' "--error-log-path=$logdir/error.log"
  35. # --with- with dependency
  36. for x in openssl:ssl zlib:gzip_static; do
  37. if pkginstalled "${x%:*}"; then
  38. var_append confopt ' ' "--with-http_${x#*:}_module"
  39. fi
  40. done
  41. # --without- because of dependency
  42. for x in pcre:http_rewrite_module openssl:http-cache uwsgi:http_uwsgi_module; do
  43. if ! pkginstalled "${x%:*}"; then
  44. var_append confopt ' ' "--without-${x#*:}"
  45. fi
  46. done
  47. # --with- without dependency
  48. for x in stub_status flv realip; do
  49. var_append confopt ' ' "--with-http_${x}_module"
  50. done
  51. # image_filter
  52. has_all=yes
  53. for x in libgd libjpeg libpng; do
  54. if ! pkginstalled "$x"; then
  55. has_all=no
  56. break
  57. fi
  58. done
  59. if [ "$has_all" = "yes" ]; then
  60. var_append confopt ' ' "--with-http_image_filter_module"
  61. fi
  62. unset has_all
  63. if atstage cross; then
  64. var_append configprefix ' ' 'cross_compiling=yes'
  65. for x in int long long_long char_p:void_p int:sig_atomic_t int:size_t int:off_t int:time_t; do
  66. y=$(eval echo "\$arch_sizeof_${x%:*}")
  67. var_append configprefix ' ' "ngx_cache_sizeof_${x#*:}=$y"
  68. done
  69. fi
  70. var_append CC_WRAPPER_REMOVE " " "-Werror"
  71. #
  72. # 3rd party addon modules
  73. #
  74. # generic function to add a 3rd party addon module
  75. # function parameters:
  76. # $1: pattern of the modules source file name
  77. #
  78. pkg_nginx_add_module() {
  79. mkdir -p $builddir/addon-module/$1
  80. tar -v $taropt $( match_source_file -p $1 nginx ) --strip-components=1 -C $builddir/addon-module/$1
  81. var_append confopt ' ' "--add-module=../addon-module/$1"
  82. }
  83. # rrd graph module
  84. if [ "$SDECFG_PKG_NGINX_ADDON_MOD_RRDGRAPH" == 1 ] ; then
  85. pkgprefix -t rrdtool
  86. hook_add preconf 5 "pkg_nginx_add_module mod_rrd_graph"
  87. fi