nginx-vl.spec 16 KB

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