nginx-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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.35
  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. Source1000: ngx-fancyindex-git.tar.bz2
  35. # removes -Werror in upstream build scripts. -Werror conflicts with
  36. # -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
  37. Patch0: nginx-auto-cc-gcc.patch
  38. # configuration patch to match all the Vine Linux paths for logs, pid files
  39. # etc.
  40. Patch1: nginx-conf.patch
  41. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  42. BuildRequires: pcre-devel
  43. BuildRequires: zlib-devel
  44. BuildRequires: openssl-devel
  45. BuildRequires: gd-devel
  46. BuildRequires: perl
  47. BuildRequires: perl(ExtUtils::Embed)
  48. Requires: pcre
  49. Requires: zlib
  50. Requires: openssl
  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 \
  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) %{_sysconfdir}/logrotate.d/%{name}
  204. %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
  205. %dir %{perl_vendorarch}/auto/%{name}
  206. %{perl_vendorarch}/%{name}.pm
  207. %{perl_vendorarch}/auto/%{name}/%{name}.so
  208. %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home}
  209. %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp}
  210. %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_cache}
  211. %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_logdir}
  212. %changelog
  213. * Sat Apr 17 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.35-1
  214. - update to 0.8.35 (development version)
  215. - add sites.d/ to store vitualhost settings
  216. - split out default server settings to sites.d/default
  217. - add fancyindex module
  218. * Wed Dec 04 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.63-1
  219. - new upstream release
  220. * Sun Sep 20 2009 Shu KONNO <owa@bg.wakwak.com> 0.7.62-1
  221. - update to 0.7.62 (included security fix: VU#180065)
  222. * Wed Aug 26 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.61-4
  223. - fix typo
  224. * Thu Aug 06 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.61-3
  225. - add translated descriptions
  226. * Sat Jul 25 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.61-2
  227. - update 404.html/50x.html to use powered by vine logo.
  228. * Wed Jul 15 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.61-1
  229. - initial build for Vine Linux
  230. - update to 0.7.61
  231. * Sun May 17 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.36-2
  232. - init script updates from Gena Makhomed
  233. - remove nginx-upstream-fair
  234. * Sat Apr 11 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.36-1
  235. - update to 0.6.36
  236. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.35-3
  237. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  238. * Thu Feb 19 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.35-2
  239. - rebuild
  240. * Thu Feb 19 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.35-1
  241. - update to 0.6.35
  242. * Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 0.6.34-2
  243. - rebuild with new openssl
  244. * Tue Dec 30 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.34-1
  245. - update to 0.6.34
  246. * Thu Dec 4 2008 Michael Schwendt <mschwendt@fedoraproject.org> - 0.6.33-2
  247. - Fix inclusion of /usr/share/nginx tree => no unowned directories.
  248. * Sun Nov 23 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.33-1
  249. - update to 0.6.33
  250. * Tue Jul 22 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.32-1
  251. - update to 0.6.32
  252. - nginx now supports DESTDIR so removed the patches that enabled it
  253. * Mon May 26 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.31-3
  254. - init script fixes
  255. - resolve 'listen 80 default' [#447873]
  256. * Mon May 12 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.31-2
  257. - update to 0.6.31
  258. * Sun May 11 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.30-2
  259. - upate to new upstream stable branch 0.6
  260. - added 3rd party module nginx-upstream-fair
  261. - added default webpages
  262. * Sun Apr 20 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.5.35-2
  263. - update init script to match recommended guidelines
  264. - add /etc/nginx/conf.d support [#443280]
  265. - use /etc/sysconfig/nginx to determine nginx.conf [#442708]
  266. * Tue Mar 18 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.5.35-3
  267. - add Requires for versioned perl (libperl.so)
  268. - drop silly file Requires
  269. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.5.35-2
  270. - Autorebuild for GCC 4.3
  271. * Sat Jan 19 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.5.35-1
  272. - update to 0.5.35
  273. * Sat Dec 15 2007 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.5.34-1
  274. - update to 0.5.34
  275. * Wed Dec 05 2007 Release Engineering <rel-eng at fedoraproject dot org> - 0.5.33-2
  276. - Rebuild for deps
  277. * Sun Nov 11 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.33-1
  278. - update to 0.5.33
  279. * Mon Sep 24 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.32-1
  280. - updated to 0.5.32
  281. - fixed rpmlint UTF-8 complaints.
  282. * Sat Aug 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.31-2
  283. - added --with-http_stub_status_module build option.
  284. - added --with-http_sub_module build option.
  285. - added use of pcre-config --cflags
  286. * Fri Aug 17 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.31-1
  287. - Update to 0.5.31
  288. - specify license is BSD
  289. * Sat Aug 11 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.30-2
  290. - Add BuildRequires: perl-devel - fixing rawhide build
  291. * Mon Jul 30 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.30-1
  292. - Update to 0.5.30
  293. * Tue Jul 24 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.29-1
  294. - Update to 0.5.29
  295. * Wed Jul 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.28-1
  296. - Update to 0.5.28
  297. * Mon Jul 09 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.27-1
  298. - Update to 0.5.27
  299. * Mon Jun 18 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.26-1
  300. - Update to 0.5.26
  301. * Sat Apr 28 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.19-1
  302. - Update to 0.5.19
  303. * Mon Apr 02 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.17-1
  304. - Update to 0.5.17
  305. * Mon Mar 26 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.16-1
  306. - Update to 0.5.16
  307. - add ownership of /usr/share/nginx/html (#233950)
  308. * Fri Mar 23 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-3
  309. - fixed package review bugs (#235222) given by ruben@rubenkerkhof.com
  310. * Thu Mar 22 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-2
  311. - fixed package review bugs (#233522) given by kevin@tummy.com
  312. * Thu Mar 22 2007 Jeremy Hinegardner <jeremy@hinegardner.org> - 0.5.15-1
  313. - create patches to assist with building for Fedora
  314. - initial packaging for Fedora