talimat 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Description: NGINX, ücretsiz, açık kaynaklı, yüksek performanslı bir HTTP sunucusu ve ters proxy yanı sıra bir IMAP / POP3 proxy sunucusudur.
  2. # URL: http://nginx.net/
  3. # Packager: milisarge
  4. # Depends on: libxml2 libxslt pcre
  5. name=nginx
  6. version=1.11.13
  7. release=1
  8. source=(http://nginx.org//download/$name-$version.tar.gz
  9. nginx.servis
  10. nginx.logrotate)
  11. # change those if you prefer another setup
  12. NGINXUSER=www
  13. NGINXGROUP=www
  14. HTMLDIR=/srv/http/nginx
  15. # change those if you need those experimental modules
  16. # (idea from slackbuilds.org)
  17. if [ "${USE_SPDY:-no}" == "yes" ]; then
  18. SPDY_MOD="--with-http_spdy_module"
  19. else
  20. SPDY_MOD=""
  21. fi
  22. if [ "${USE_GEOIP:-no}" == "yes" ]; then
  23. GEOIP_MOD="--with-http_geoip_module"
  24. else
  25. GEOIP_MOD=""
  26. fi
  27. #
  28. #
  29. build() {
  30. cd $name-$version
  31. ./configure --prefix=/usr \
  32. --sbin-path=/usr/sbin/nginx \
  33. --conf-path=/etc/nginx/nginx.conf \
  34. --pid-path=/var/run/nginx.pid \
  35. --lock-path=/var/lock/subsys \
  36. --user=${NGINXUSER} \
  37. --group=${NGINXGROUP} \
  38. --error-log-path=/var/log/nginx/error.log \
  39. --http-log-path=/var/log/nginx/access.log \
  40. --http-client-body-temp-path=/var/lib/nginx/client_body \
  41. --http-proxy-temp-path=/var/lib/nginx/proxy \
  42. --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
  43. --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
  44. --http-scgi-temp-path=/var/lib/nginx/scgi \
  45. --with-file-aio \
  46. --with-ipv6 \
  47. --with-select_module \
  48. --with-poll_module \
  49. --with-http_ssl_module \
  50. --with-http_realip_module \
  51. --with-http_addition_module \
  52. --with-http_xslt_module \
  53. --with-http_sub_module \
  54. --with-http_dav_module \
  55. --with-http_flv_module \
  56. --with-http_mp4_module \
  57. --with-http_gunzip_module \
  58. --with-http_gzip_static_module \
  59. --with-http_random_index_module \
  60. --with-http_secure_link_module \
  61. --with-http_degradation_module \
  62. --with-http_stub_status_module \
  63. --with-http_perl_module \
  64. --with-http_auth_request_module \
  65. --with-mail \
  66. --with-mail_ssl_module \
  67. $SPDY_MOD \
  68. $GEOIP_MOD
  69. make
  70. make DESTDIR=$PKG install
  71. # Make the temp path.
  72. install -dm700 $PKG/var/lib/$name
  73. # Move html directory and do not use /srv/www as it is used by apache
  74. mkdir -p $PKG/$HTMLDIR
  75. mv $PKG/usr/html $PKG/$HTMLDIR
  76. chown -v -R $NGINXUSER:$NGINXGROUP $PKG/$HTMLDIR
  77. # Fix the nginx.conf file for html and virtual server directory.
  78. sed -i \
  79. -e '/root[ ]*html/s|html;|/srv/http/&|' \
  80. -e '$s|.*| include /etc/nginx/conf.d/\*.conf;\n&|' \
  81. $PKG/etc/nginx/$name.conf
  82. # install the nginx init script
  83. install -Dm755 $SRC/nginx.servis $PKG/etc/rc.d/init.d/nginx
  84. # install the logrotate file
  85. install -Dm644 $SRC/nginx.logrotate $PKG/etc/logrotate.d/nginx
  86. # fill the right user & group in the logrotate file
  87. sed -e "s,@USER@,$NGINXUSER," -e "s,@GROUP@,$NGINXGROUP," \
  88. $PKG/etc/logrotate.d/nginx
  89. # Set the permissions for the log directory.
  90. chown $NGINXUSER $PKG/var/log/$name
  91. chmod 750 $PKG/var/log/$name
  92. # Create sub-directory for virtual servers.
  93. mkdir -p $PKG/etc/$name/conf.d
  94. # Remove perllocal.pod and .packlist if present in the package
  95. for i in perllocal.pod .packlist; do
  96. find $PKG -name "$i" -exec rm -rf {} \;
  97. done
  98. }