nginx-vl.spec 14 KB

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