talimat 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. # Tanım: 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. # Paketçi: milisarge
  4. # Gerekler: libxml2 libxslt pcre
  5. # Grup: ağ
  6. isim=nginx
  7. surum=1.13.7
  8. devir=1
  9. kaynak=(http://nginx.org//download/$isim-$surum.tar.gz
  10. nginx.servis
  11. nginx.logrotate)
  12. # change those if you prefer another setup
  13. NGINXUSER=www
  14. NGINXGROUP=www
  15. HTMLDIR=/srv/http
  16. # change those if you need those experimental modules
  17. # (idea from slackbuilds.org)
  18. if [ "${USE_SPDY:-no}" == "yes" ]; then
  19. SPDY_MOD="--with-http_spdy_module"
  20. else
  21. SPDY_MOD=""
  22. fi
  23. if [ "${USE_GEOIP:-no}" == "yes" ]; then
  24. GEOIP_MOD="--with-http_geoip_module"
  25. else
  26. GEOIP_MOD=""
  27. fi
  28. #
  29. #
  30. derle() {
  31. cd $isim-$surum
  32. ./configure \
  33. --prefix=/etc/nginx \
  34. --conf-path=/etc/nginx/nginx.conf \
  35. --sbin-path=/usr/bin/nginx \
  36. --pid-path=/run/nginx.pid \
  37. --lock-path=/run/lock/nginx.lock \
  38. --user=http \
  39. --group=http \
  40. --http-log-path=/var/log/nginx/access.log \
  41. --error-log-path=stderr \
  42. --http-client-body-temp-path=/var/lib/nginx/client-body \
  43. --http-proxy-temp-path=/var/lib/nginx/proxy \
  44. --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
  45. --http-scgi-temp-path=/var/lib/nginx/scgi \
  46. --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
  47. --with-cc-opt="$CFLAGS $CPPFLAGS" \
  48. --with-ld-opt="$LDFLAGS" \
  49. ./configure --prefix=/usr \
  50. --sbin-path=/usr/sbin/nginx \
  51. --conf-path=/etc/nginx/nginx.conf \
  52. --pid-path=/var/run/nginx.pid \
  53. --lock-path=/var/lock/subsys \
  54. --user=${NGINXUSER} \
  55. --group=${NGINXGROUP} \
  56. --error-log-path=/var/log/nginx/error.log \
  57. --http-log-path=/var/log/nginx/access.log \
  58. --http-client-body-temp-path=/var/lib/nginx/client_body \
  59. --http-proxy-temp-path=/var/lib/nginx/proxy \
  60. --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
  61. --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
  62. --http-scgi-temp-path=/var/lib/nginx/scgi \
  63. --with-compat \
  64. --with-debug \
  65. --with-file-aio \
  66. --with-ipv6 \
  67. --with-pcre-jit \
  68. --with-stream \
  69. --with-stream_ssl_module \
  70. --with-stream_ssl_preread_module \
  71. --with-threads \
  72. --with-select_module \
  73. --with-poll_module \
  74. --with-http_ssl_module \
  75. --with-http_realip_module \
  76. --with-http_addition_module \
  77. --with-http_xslt_module \
  78. --with-http_sub_module \
  79. --with-http_dav_module \
  80. --with-http_flv_module \
  81. --with-http_mp4_module \
  82. --with-http_gunzip_module \
  83. --with-http_gzip_static_module \
  84. --with-http_random_index_module \
  85. --with-http_secure_link_module \
  86. --with-http_degradation_module \
  87. --with-http_stub_status_module \
  88. --with-http_sub_module \
  89. --with-http_v2_module \
  90. --with-http_perl_module \
  91. --with-http_auth_request_module \
  92. --with-mail \
  93. --with-mail_ssl_module \
  94. --with-cc-opt="$CFLAGS $CPPFLAGS" \
  95. --with-ld-opt="$LDFLAGS" \
  96. $SPDY_MOD \
  97. $GEOIP_MOD
  98. make
  99. make DESTDIR=$PKG install
  100. # Make the temp path.
  101. install -dm700 $PKG/var/lib/$isim
  102. # Move html directory and do not use /srv/www as it is used by apache
  103. mkdir -p $PKG/$HTMLDIR
  104. mv $PKG/usr/html $PKG/$HTMLDIR
  105. chown -v -R $NGINXUSER:$NGINXGROUP $PKG/$HTMLDIR
  106. # Fix the nginx.conf file for html and virtual server directory.
  107. sed -i \
  108. -e '/root[ ]*html/s|html;|/srv/http/&|' \
  109. -e '$s|.*| include /etc/nginx/conf.d/\*.conf;\n&|' \
  110. $PKG/etc/nginx/$isim.conf
  111. # install the nginx init script
  112. install -Dm755 $SRC/nginx.servis $PKG/etc/rc.d/init.d/nginx
  113. # install the logrotate file
  114. install -Dm644 $SRC/nginx.logrotate $PKG/etc/logrotate.d/nginx
  115. # fill the right user & group in the logrotate file
  116. sed -e "s,@USER@,$NGINXUSER," -e "s,@GROUP@,$NGINXGROUP," \
  117. $PKG/etc/logrotate.d/nginx
  118. # Set the permissions for the log directory.
  119. chown $NGINXUSER $PKG/var/log/$isim
  120. chmod 750 $PKG/var/log/$isim
  121. # Create sub-directory for virtual servers.
  122. mkdir -p $PKG/etc/$isim/conf.d
  123. # Remove perllocal.pod and .packlist if present in the package
  124. for i in perllocal.pod .packlist; do
  125. find $PKG -name "$i" -exec rm -rf {} \;
  126. done
  127. }