nginx.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ##
  2. ## nginx.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: nginx
  25. Summary: Reverse Proxy Server
  26. URL: http://nginx.org/
  27. Vendor: Igor Sysoev
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Web
  32. License: MIT-style
  33. Version: 1.1.13
  34. Release: 20120117
  35. # list of sources
  36. Source0: http://nginx.org/download/nginx-%{version}.tar.gz
  37. Source1: nginx.conf
  38. Source2: rc.nginx
  39. Patch0: nginx.patch
  40. # build information
  41. BuildPreReq: OpenPKG, openpkg >= 20100101
  42. PreReq: OpenPKG, openpkg >= 20100101
  43. BuildPreReq: zlib, pcre, openssl, geoip
  44. PreReq: zlib, pcre, openssl, geoip
  45. %description
  46. Nginx (pronounced "engine X" is a lightweight, event-driven
  47. high-performance Web server/reverse proxy and e-mail (IMAP/POP3)
  48. proxy. It provides the following HTTP features: Handling of static
  49. files, index files, and auto-indexing; Reverse proxy with caching;
  50. Load balancing; Fault tolerance; SSL support; FastCGI support with
  51. caching; Name- and IP-based virtual servers; FLV streaming; MP4
  52. streaming; Web page access authentication; gzip compression; and
  53. ability to handle more than 10.000 simultaneous connections.
  54. %track
  55. prog nginx = {
  56. version = %{version}
  57. url = http://nginx.org/en/download.html
  58. regex = nginx-(__VER__)\.tar\.gz
  59. }
  60. %prep
  61. %setup -q
  62. %patch -p0
  63. %build
  64. # configure program
  65. %{l_shtool} subst \
  66. -e 's;/usr/local;%{l_prefix};g' \
  67. auto/lib/*/conf
  68. CC="%{l_cc}" \
  69. CFLAGS="%{l_cflags -O}" \
  70. CPPFLAGS="%{l_cppflags}" \
  71. LDFLAGS="%{l_ldflags}" \
  72. ./configure \
  73. --prefix=%{l_prefix} \
  74. --conf-path=%{l_prefix}/etc/nginx/nginx.conf \
  75. --error-log-path=%{l_prefix}/var/nginx/log/nginx.log \
  76. --pid-path=%{l_prefix}/var/nginx/var/nginx.pid \
  77. --lock-path=%{l_prefix}/var/nginx/var/nginx.lck \
  78. --http-log-path=%{l_prefix}/var/nginx/log/nginx.access.log \
  79. --http-client-body-temp-path=%{l_prefix}/var/nginx/tmp \
  80. --http-proxy-temp-path=%{l_prefix}/var/nginx/tmp \
  81. --http-fastcgi-temp-path=%{l_prefix}/var/nginx/tmp \
  82. --http-uwsgi-temp-path=%{l_prefix}/var/nginx/tmp \
  83. --http-scgi-temp-path=%{l_prefix}/var/nginx/tmp \
  84. --user=%{l_nusr} \
  85. --group=%{l_ngrp} \
  86. --with-http_addition_module \
  87. --with-http_dav_module \
  88. --with-http_degradation_module \
  89. --with-http_flv_module \
  90. --with-http_geoip_module \
  91. --with-http_gzip_static_module \
  92. --with-http_random_index_module \
  93. --with-http_realip_module \
  94. --with-http_secure_link_module \
  95. --with-http_ssl_module \
  96. --with-http_stub_status_module \
  97. --with-http_sub_module
  98. # build program
  99. %{l_make} %{l_mflags -O}
  100. %install
  101. # install program
  102. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  103. # strip down installation
  104. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  105. # install default configuration
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/nginx/*
  107. %{l_shtool} mkdir -f -p -m 755 \
  108. $RPM_BUILD_ROOT%{l_prefix}/etc/nginx
  109. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  110. %{SOURCE nginx.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/nginx/
  111. %{l_shtool} install -c -m 644 \
  112. conf/mime.types $RPM_BUILD_ROOT%{l_prefix}/etc/nginx/
  113. # install run-command script
  114. %{l_shtool} mkdir -f -p -m 755 \
  115. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  116. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  117. %{SOURCE rc.nginx} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  118. # create run-time directories
  119. %{l_shtool} mkdir -f -p -m 755 \
  120. $RPM_BUILD_ROOT%{l_prefix}/var/nginx/tmp \
  121. $RPM_BUILD_ROOT%{l_prefix}/var/nginx/log \
  122. $RPM_BUILD_ROOT%{l_prefix}/var/nginx/run
  123. # determine installation files
  124. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  125. %{l_files_std} \
  126. '%config %{l_prefix}/etc/nginx/*' \
  127. '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/nginx/*'
  128. %files -f files
  129. %clean