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.

155 lines
4.6 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 - 2012 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. # use a dedicated sysconfdir
  17. sysconfdir="$sysconfdir/$pkg"
  18. fi
  19. cleanconfopt=0
  20. [[ "$sysconfdir" = */$pkg ]] || sysconfdir=$sysconfdir/$pkg
  21. # prefix used by nginx when searching for files
  22. confopt="--prefix=$sysconfdir"
  23. var_append confopt ' ' "--sbin-path=$sbindir"
  24. var_append confopt ' ' "--conf-path=$sysconfdir/nginx.conf"
  25. # set path to nginx.pid file
  26. var_append confopt ' ' "--pid-path=$localstatedir/run/nginx.pid"
  27. # set path to nginx.lock file
  28. var_append confopt ' ' "--lock-path=$localstatedir/lock/nginx.lock"
  29. # IPv6 support by default
  30. var_append confopt ' ' "--with-ipv6"
  31. # set temporary paths and files
  32. for x in proxy fastcgi uwsgi client-body; do
  33. var_append confopt ' ' "--http-$x-temp-path=$localstatedir/temp/${x//-/_}_temp"
  34. done
  35. # log directories
  36. logdir="$localstatedir/log/$pkg"
  37. var_append confopt ' ' "--http-log-path=$logdir/access.log"
  38. var_append confopt ' ' "--error-log-path=$logdir/error.log"
  39. # --with- with dependency
  40. for x in openssl:ssl zlib:gzip_static; do
  41. if pkginstalled "${x%:*}"; then
  42. var_append confopt ' ' "--with-http_${x#*:}_module"
  43. fi
  44. done
  45. # --without- because of dependency
  46. for x in pcre:http_rewrite_module openssl:http-cache uwsgi:http_uwsgi_module; do
  47. if ! pkginstalled "${x%:*}"; then
  48. var_append confopt ' ' "--without-${x#*:}"
  49. fi
  50. done
  51. # --with- without dependency
  52. for x in stub_status flv realip; do
  53. var_append confopt ' ' "--with-http_${x}_module"
  54. done
  55. # image_filter
  56. has_all=yes
  57. for x in libgd libjpeg libpng; do
  58. if ! pkginstalled "$x"; then
  59. has_all=no
  60. break
  61. fi
  62. done
  63. if [ "$has_all" = "yes" ]; then
  64. var_append confopt ' ' "--with-http_image_filter_module"
  65. fi
  66. unset has_all
  67. if atstage cross; then
  68. var_append configprefix ' ' 'cross_compiling=yes'
  69. 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
  70. y=$(eval echo "\$arch_sizeof_${x%:*}")
  71. var_append configprefix ' ' "ngx_cache_sizeof_${x#*:}=$y"
  72. done
  73. fi
  74. var_append CC_WRAPPER_REMOVE " " "-Werror"
  75. #
  76. # 3rd party addon modules
  77. #
  78. # generic function to patch 3rd party addon modules
  79. # patches have to be named $modulename*.diff where
  80. # $modulename is the name used as parameter while
  81. # calling pkg_nginx_add_module()
  82. #
  83. pkg_nginx_patch_module() {
  84. pushd ../addon-module/$1
  85. for p in $( ls -1 $confdir/$1*.diff 2>/dev/null ); do
  86. patch -p1 < "$p"
  87. done
  88. popd
  89. }
  90. # generic function to add a 3rd party addon module
  91. # function parameters:
  92. # $1: pattern of the modules source file name
  93. #
  94. pkg_nginx_add_module() {
  95. mkdir -p $builddir/addon-module/$1
  96. tar -v $taropt $( match_source_file -p $1 nginx ) --strip-components=1 -C $builddir/addon-module/$1
  97. var_append confopt ' ' "--add-module=../addon-module/$1"
  98. hook_add postpatch 5 "pkg_nginx_patch_module $1"
  99. }
  100. # rrd graph module
  101. if [ "$SDECFG_PKG_NGINX_ADDON_MOD_RRDGRAPH" == 1 ] ; then
  102. pkgprefix -t rrdtool
  103. hook_add prepatch 5 "pkg_nginx_add_module mod_rrd_graph"
  104. fi
  105. if [ "$SDECFG_PKG_NGINX_ADDON_MOD_UPLOAD" == 1 ] ; then
  106. hook_add prepatch 5 "pkg_nginx_add_module nginx_upload_module"
  107. fi
  108. if [ "$SDECFG_PKG_NGINX_ADDON_MOD_HTTPECHO" == 1 ] ; then
  109. hook_add prepatch 5 "pkg_nginx_add_module echo-nginx-module"
  110. fi
  111. if [ "$SDECFG_PKG_NGINX_ADDON_MOD_NDK" == 1 ] ; then
  112. hook_add prepatch 5 "pkg_nginx_add_module ngx_devel_kit"
  113. fi
  114. if [ "$SDECFG_PKG_NGINX_ADDON_MOD_LUA" == 1 ] ; then
  115. # prefer to use luajit if available
  116. if pkginstalled -f luajit; then
  117. pkgprefix -t luajit
  118. var_append configprefix ' ' "LUAJIT_LIB=$( pkgprefix -r libdir luajit )"
  119. var_append configprefix ' ' "LUAJIT_INC=$( pkgprefix -r includedir luajit )"
  120. else
  121. pkgprefix -t lua
  122. var_append configprefix ' ' "LUA_LIB=$( pkgprefix -r libdir lua )"
  123. var_append configprefix ' ' "LUA_INC=$( pkgprefix -r includedir lua )"
  124. fi
  125. hook_add prepatch 5 "pkg_nginx_add_module lua-nginx-module"
  126. fi
  127. if [ "$SDECFG_PKG_NGINX_ADDON_SYSLOG_PATCH" == 1 ] ; then
  128. hook_add prepatch 5 "pkg_nginx_add_module nginx_syslog_patch"
  129. hook_add prepatch 9 "var_append patchfiles ' ' '../addon-module/nginx_syslog_patch/syslog_${ver/%.*}*.patch'"
  130. fi