nginx-vl.spec 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. %define nginx_user nginx
  2. %define nginx_group %{nginx_user}
  3. %define nginx_home %{_localstatedir}/lib/nginx
  4. %define nginx_home_tmp %{nginx_home}/tmp
  5. %define nginx_home_cache %{nginx_home}/cache
  6. %define nginx_logdir %{_localstatedir}/log/nginx
  7. %define nginx_confdir %{_sysconfdir}/nginx
  8. %define nginx_datadir %{_datadir}/nginx
  9. %define nginx_webroot %{nginx_datadir}/html
  10. Summary: Robust, small and high performance http and reverse proxy server
  11. Summary(ja): 堅牢・軽量・高性能な HTTP およびリバースプロキシサーバ
  12. Name: nginx
  13. Version: 0.8.54
  14. Release: 2%{?_dist_release}
  15. Group: System Environment/Daemons
  16. # BSD License (two clause)
  17. # http://www.freebsd.org/copyright/freebsd-license.html
  18. License: BSD
  19. URL: http://nginx.net/
  20. Source0: http://sysoev.ru/nginx/nginx-%{version}.tar.gz
  21. Source1: %{name}.init
  22. Source2: %{name}.logrotate
  23. Source3: nginx-virtual.conf.template
  24. Source4: nginx-ssl.conf
  25. Source5: %{name}.sysconfig
  26. Source10: nginx-vine.conf
  27. Source11: nginx-default-vine
  28. Source20: proxy_cache.conf
  29. Source100: nginx-index.html
  30. Source101: poweredby-vine.png
  31. Source102: nginx-logo.png
  32. Source103: nginx-50x.html
  33. Source104: nginx-404.html
  34. %define ngx_fancyindex_version 0.3
  35. Source1000: ngx-fancyindex-%{ngx_fancyindex_version}.tar.gz
  36. %define nginx_accept_language_module_version 02262ce
  37. Source1010: giom-nginx_accept_language_module-%{nginx_accept_language_module_version}.tar.gz
  38. # removes -Werror in upstream build scripts. -Werror conflicts with
  39. # -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
  40. Patch0: nginx-auto-cc-gcc.patch
  41. # configuration patch to match all the Vine Linux paths for logs, pid files
  42. # etc.
  43. Patch1: nginx-conf.patch
  44. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  45. BuildRequires: pcre-devel
  46. BuildRequires: zlib-devel
  47. BuildRequires: openssl-devel
  48. BuildRequires: gd-devel
  49. BuildRequires: perl
  50. BuildRequires: perl(ExtUtils::Embed)
  51. BuildRequires: libxml2-devel
  52. BuildRequires: libxslt-devel
  53. %if "%{?_dist_release}" == "vl4"
  54. Requires: perl >= 5.8.6
  55. %else
  56. Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
  57. %endif
  58. # for /usr/sbin/useradd
  59. Requires(pre): shadow-utils
  60. Requires(post): chkconfig
  61. # for /sbin/service
  62. Requires(preun): chkconfig, initscripts
  63. Requires(postun): initscripts
  64. Vendor: Project Vine
  65. Distribution: Vine Linux
  66. Packager: daisuke
  67. %description
  68. Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
  69. proxy server written by Igor Sysoev.
  70. %description -l ja
  71. Nginx [engine x/エンジンX] は Igor Sysoev により開発された以下の機能をもつ
  72. 堅牢・軽量・高性能なHTTPサーバかつリバースプロキシサーバです。
  73. - HTTP(S) サーバ
  74. - HTTP(S) リバースプロキシサーバ
  75. - IMAP/POP3 プロキシサーバ
  76. %prep
  77. %setup -q -a 1000 -a 1010
  78. %patch0 -p0
  79. %patch1 -p1
  80. %build
  81. # nginx does not utilize a standard configure script. It has its own
  82. # and the standard configure options cause the nginx configure script
  83. # to error out. This is is also the reason for the DESTDIR environment
  84. # variable. The configure script(s) have been patched (Patch1 and
  85. # Patch2) in order to support installing into a build environment.
  86. export DESTDIR=%{buildroot}
  87. ./configure \
  88. --user=%{nginx_user} \
  89. --group=%{nginx_group} \
  90. --prefix=%{nginx_datadir} \
  91. --sbin-path=%{_sbindir}/%{name} \
  92. --conf-path=%{nginx_confdir}/%{name}.conf \
  93. --error-log-path=%{nginx_logdir}/error.log \
  94. --http-log-path=%{nginx_logdir}/access.log \
  95. --http-client-body-temp-path=%{nginx_home_tmp}/client_body \
  96. --http-proxy-temp-path=%{nginx_home_tmp}/proxy \
  97. --http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
  98. --pid-path=%{_localstatedir}/run/%{name}.pid \
  99. --lock-path=%{_localstatedir}/lock/subsys/%{name} \
  100. --with-file-aio \
  101. --with-ipv6 \
  102. --with-http_ssl_module \
  103. --with-http_realip_module \
  104. --with-http_addition_module \
  105. --with-http_xslt_module \
  106. --with-http_image_filter_module \
  107. --with-http_sub_module \
  108. --with-http_dav_module \
  109. --with-http_flv_module \
  110. --with-http_gzip_static_module \
  111. --with-http_random_index_module \
  112. --with-http_secure_link_module \
  113. --with-http_stub_status_module \
  114. --with-http_perl_module \
  115. --with-mail \
  116. --with-mail_ssl_module \
  117. --add-module=ngx-fancyindex-%{ngx_fancyindex_version} \
  118. --add-module=giom-nginx_accept_language_module-%{nginx_accept_language_module_version} \
  119. %ifarch i686
  120. --with-cpu-opt=pentiumpro \
  121. --with-zlib-asm=pentiumpro \
  122. --with-md5-asm \
  123. --with-sha1-asm \
  124. %endif
  125. --with-cc-opt="-O6 %{optflags} $(pcre-config --cflags)"
  126. make %{?_smp_mflags}
  127. %install
  128. rm -rf %{buildroot}
  129. make install DESTDIR=%{buildroot} INSTALLDIRS=vendor
  130. find %{buildroot} -type f -name .packlist -exec rm -f {} \;
  131. find %{buildroot} -type f -name perllocal.pod -exec rm -f {} \;
  132. find %{buildroot} -type f -empty -exec rm -f {} \;
  133. find %{buildroot} -type f -exec chmod 0644 {} \;
  134. find %{buildroot} -type f -name '*.so' -exec chmod 0755 {} \;
  135. chmod 0755 %{buildroot}%{_sbindir}/nginx
  136. %{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
  137. %{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
  138. %{__install} -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
  139. %{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d
  140. %{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/sites.d
  141. %{__install} -p -m 0644 %{SOURCE3} %{buildroot}%{nginx_confdir}/sites.d/virtual.conf.template
  142. %{__install} -p -m 0644 %{SOURCE4} %{buildroot}%{nginx_confdir}/conf.d/ssl.conf
  143. %{__install} -p -m 0644 %{SOURCE10} %{buildroot}%{nginx_confdir}/nginx.conf
  144. %{__install} -p -m 0644 %{SOURCE10} %{buildroot}%{nginx_confdir}/nginx.conf.default
  145. %{__install} -p -m 0644 %{SOURCE11} %{buildroot}%{nginx_confdir}/sites.d/default
  146. %{__install} -p -m 0644 %{SOURCE20} %{buildroot}%{nginx_confdir}/conf.d/proxy_cache.conf
  147. %{__install} -p -d -m 0755 %{buildroot}%{nginx_home_cache}
  148. %{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp}
  149. %{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir}
  150. %{__install} -p -d -m 0755 %{buildroot}%{nginx_webroot}
  151. %{__install} -p -m 0644 %{SOURCE100} %{buildroot}%{nginx_webroot}/index.html
  152. %{__install} -p -m 0644 %{SOURCE101} %{buildroot}%{nginx_webroot}/poweredby.png
  153. %{__install} -p -m 0644 %{SOURCE102} %{buildroot}%{nginx_webroot}/nginx-logo.png
  154. %{__install} -p -m 0644 %{SOURCE103} %{buildroot}%{nginx_webroot}/50x.html
  155. %{__install} -p -m 0644 %{SOURCE104} %{buildroot}%{nginx_webroot}/404.html
  156. touch %{buildroot}%{nginx_confdir}/conf.d/virtual.conf
  157. # convert to UTF-8 all files that give warnings.
  158. for textfile in CHANGES
  159. do
  160. mv $textfile $textfile.old
  161. iconv --from-code ISO8859-1 --to-code UTF-8 --output $textfile $textfile.old
  162. rm -f $textfile.old
  163. done
  164. %clean
  165. rm -rf %{buildroot}
  166. %pre
  167. if [ $1 == 1 ]; then
  168. %{_sbindir}/useradd -c "Nginx user" -s /bin/false -r -d %{nginx_home} %{nginx_user} 2>/dev/null || :
  169. fi
  170. %post
  171. if [ $1 == 1 ]; then
  172. /sbin/chkconfig --add %{name}
  173. fi
  174. %preun
  175. if [ $1 = 0 ]; then
  176. /sbin/service %{name} stop >/dev/null 2>&1
  177. /sbin/chkconfig --del %{name}
  178. fi
  179. %postun
  180. if [ $1 == 2 ]; then
  181. /sbin/service %{name} upgrade || :
  182. fi
  183. %files
  184. %defattr(-,root,root,-)
  185. %doc LICENSE CHANGES README
  186. %{nginx_datadir}/
  187. %{_sbindir}/%{name}
  188. %{_mandir}/man3/%{name}.3pm.gz
  189. %{_initrddir}/%{name}
  190. %dir %{nginx_confdir}
  191. %dir %{nginx_confdir}/conf.d
  192. %config(noreplace) %{nginx_confdir}/conf.d/*.conf
  193. %ghost %config(noreplace) %{nginx_confdir}/conf.d/virtual.conf
  194. %config(noreplace) %{nginx_confdir}/sites.d/*
  195. %config(noreplace) %{nginx_confdir}/win-utf
  196. %config(noreplace) %{nginx_confdir}/%{name}.conf.default
  197. %config(noreplace) %{nginx_confdir}/mime.types.default
  198. %config(noreplace) %{nginx_confdir}/fastcgi_params
  199. %config(noreplace) %{nginx_confdir}/fastcgi_params.default
  200. %config(noreplace) %{nginx_confdir}/koi-win
  201. %config(noreplace) %{nginx_confdir}/koi-utf
  202. %config(noreplace) %{nginx_confdir}/%{name}.conf
  203. %config(noreplace) %{nginx_confdir}/mime.types
  204. %config(noreplace) %{nginx_confdir}/fastcgi.conf
  205. %config(noreplace) %{nginx_confdir}/fastcgi.conf.default
  206. %config(noreplace) %{nginx_confdir}/scgi_params
  207. %config(noreplace) %{nginx_confdir}/scgi_params.default
  208. %config(noreplace) %{nginx_confdir}/uwsgi_params
  209. %config(noreplace) %{nginx_confdir}/uwsgi_params.default
  210. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  211. %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
  212. %dir %{perl_vendorarch}/auto/%{name}
  213. %{perl_vendorarch}/%{name}.pm
  214. %{perl_vendorarch}/auto/%{name}/%{name}.so
  215. %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home}
  216. %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp}
  217. %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_cache}
  218. %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_logdir}
  219. %changelog
  220. * Sun Mar 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.54-2
  221. - rebuild with perl-5.12.3
  222. * Mon Jan 17 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.54-1
  223. - update to 0.8.54
  224. * Sun Nov 28 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.53-1
  225. - update to 0.8.53
  226. - add nginx_accept_language_module
  227. * Sat Sep 24 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.50-1
  228. - update to 0.8.50
  229. - update ngx-fancyindex to 0.3
  230. - add BR: libxml2-devel, libxslt-devel
  231. - add scgi_params* and uwsgi_params* to %%files
  232. * Sat Apr 17 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.35-1
  233. - update to 0.8.35 (development version)
  234. - add sites.d/ to store vitualhost settings
  235. - split out default server settings to sites.d/default
  236. - add fancyindex module
  237. * Wed Dec 04 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.63-1
  238. - new upstream release
  239. * Sun Sep 20 2009 Shu KONNO <owa@bg.wakwak.com> 0.7.62-1
  240. - update to 0.7.62 (included security fix: VU#180065)
  241. * Wed Aug 26 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.61-4
  242. - fix typo
  243. * Thu Aug 06 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.61-3
  244. - add translated descriptions
  245. * Sat Jul 25 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.61-2
  246. - update 404.html/50x.html to use powered by vine logo.
  247. * Wed Jul 15 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.61-1
  248. - initial build for Vine Linux
  249. - update to 0.7.61
  250. * Sun May 17 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.36-2
  251. - init script updates from Gena Makhomed
  252. - remove nginx-upstream-fair
  253. * Sat Apr 11 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.36-1
  254. - update to 0.6.36
  255. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.35-3
  256. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  257. * Thu Feb 19 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.35-2
  258. - rebuild
  259. * Thu Feb 19 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.35-1
  260. - update to 0.6.35
  261. * Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 0.6.34-2
  262. - rebuild with new openssl
  263. * Tue Dec 30 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.34-1
  264. - update to 0.6.34
  265. * Thu Dec 4 2008 Michael Schwendt <mschwendt@fedoraproject.org> - 0.6.33-2
  266. - Fix inclusion of /usr/share/nginx tree => no unowned directories.
  267. * Sun Nov 23 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.33-1
  268. - update to 0.6.33
  269. * Tue Jul 22 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.32-1
  270. - update to 0.6.32
  271. - nginx now supports DESTDIR so removed the patches that enabled it
  272. * Mon May 26 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.31-3
  273. - init script fixes
  274. - resolve 'listen 80 default' [#447873]
  275. * Mon May 12 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.31-2
  276. - update to 0.6.31
  277. * Sun May 11 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.30-2
  278. - upate to new upstream stable branch 0.6
  279. - added 3rd party module nginx-upstream-fair
  280. - added default webpages
  281. * Sun Apr 20 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.5.35-2
  282. - update init script to match recommended guidelines
  283. - add /etc/nginx/conf.d support [#443280]
  284. - use /etc/sysconfig/nginx to determine nginx.conf [#442708]
  285. * Tue Mar 18 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.5.35-3
  286. - add Requires for versioned perl (libperl.so)
  287. - drop silly file Requires
  288. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.5.35-2
  289. - Autorebuild for GCC 4.3
  290. * Sat Jan 19 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.5.35-1
  291. - update to 0.5.35
  292. * Sat Dec 15 2007 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.5.34-1
  293. - update to 0.5.34
  294. * Wed Dec 05 2007 Release Engineering <rel-eng at fedoraproject dot org> - 0.5.33-2
  295. - Rebuild for deps
  296. * Sun Nov 11 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.33-1
  297. - update to 0.5.33
  298. * Mon Sep 24 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.32-1
  299. - updated to 0.5.32
  300. - fixed rpmlint UTF-8 complaints.
  301. * Sat Aug 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.31-2
  302. - added --with-http_stub_status_module build option.
  303. - added --with-http_sub_module build option.
  304. - added use of pcre-config --cflags
  305. * Fri Aug 17 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.31-1
  306. - Update to 0.5.31
  307. - specify license is BSD
  308. * Sat Aug 11 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.30-2
  309. - Add BuildRequires: perl-devel - fixing rawhide build
  310. * Mon Jul 30 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.30-1
  311. - Update to 0.5.30
  312. * Tue Jul 24 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.29-1
  313. - Update to 0.5.29
  314. * Wed Jul 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.28-1
  315. - Update to 0.5.28
  316. * Mon Jul 09 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.27-1
  317. - Update to 0.5.27
  318. * Mon Jun 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.26-1
  319. - Update to 0.5.26
  320. * Sat Apr 28 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.19-1
  321. - Update to 0.5.19
  322. * Mon Apr 02 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.17-1
  323. - Update to 0.5.17
  324. * Mon Mar 26 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.16-1
  325. - Update to 0.5.16
  326. - add ownership of /usr/share/nginx/html (#233950)
  327. * Fri Mar 23 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-3
  328. - fixed package review bugs (#235222) given by ruben@rubenkerkhof.com
  329. * Thu Mar 22 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-2
  330. - fixed package review bugs (#233522) given by kevin@tummy.com
  331. * Thu Mar 22 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-1
  332. - create patches to assist with building for Fedora
  333. - initial packaging for Fedora