4 # - subpackage with error pages
5 # Conditional build for nginx:
6 %bcond_with stub_status # stats module
10 %bcond_with ssl # ssl support
11 %bcond_with imap # imap proxy
12 %bcond_without http_browser # parse header "User-agent"
14 Summary: High perfomance HTTP and reverse proxy server
15 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
20 Group: Networking/Daemons
21 Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
22 # Source0-md5: d84ef8e624b8953faf9cee2b5da535c1
24 Source2: %{name}-mime.types.sh
25 Source3: http://www.nginx.eu/favicon.ico
26 # Source3-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
27 Source4: http://www.nginx.eu/download/proxy.conf
28 # Source4-md5: f5263ae01c2edb18f46d5d1df2d3a5cd
29 Source5: http://www.nginx.eu/download/nginx.monitrc
30 # Source5-md5: 1d3f5eedfd34fe95213f9e0fc19daa88
31 Source6: http://www.nginx.eu/download/nginx.conf
32 # Source6-md5: 1c112d6f03d0f365e4acc98c1d96261a
33 Patch0: %{name}-config.patch
34 URL: http://nginx.net/
35 BuildRequires: mailcap
36 BuildRequires: openssl-devel
37 BuildRequires: pcre-devel
38 BuildRequires: rpmbuild(macros) >= 1.268
39 BuildRequires: zlib-devel
40 Requires(post,preun): /sbin/chkconfig
41 Requires(postun): /usr/sbin/groupdel
42 Requires(postun): /usr/sbin/userdel
43 Requires(pre): /bin/id
44 Requires(pre): /usr/bin/getgid
45 Requires(pre): /usr/sbin/groupadd
46 Requires(pre): /usr/sbin/useradd
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 %define _sysconfdir /etc/%{name}
51 %define _nginxdir /home/services/%{name}
54 High perfomance HTTP and reverse proxy server.
56 %description -l pl.UTF-8
57 Serwer HTTP i odwrotne proxy o wysokiej wydajności.
63 # build mime.types.conf
64 sh %{SOURCE2} /etc/mime.types
67 # NB: not autoconf generated configure
70 --sbin-path=%{_sbindir}/%{name} \
71 --conf-path=%{_sysconfdir}/%{name}.conf \
72 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
73 --pid-path=%{_localstatedir}/run/%{name}.pid \
76 %{?with_stub_status:--with-http_stub_status_module} \
77 %{?with_rtsig:--with-rtsig_module} \
78 %{?with_select:--with-select_module} \
79 %{?with_poll:--with-poll_module} \
80 %{?with_ssl:--with-http_ssl_module} \
81 %{?with_imap:--with-imap} \
82 %{?with_http_browser:--without-http_browser_module} \
83 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
84 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
85 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
86 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
88 --with-cc-opt="%{rpmcflags}" \
89 --with-ld-opt="%{rpmldflags}" \
90 %{?debug:--with-debug}
95 rm -rf $RPM_BUILD_ROOT
96 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
97 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
98 $RPM_BUILD_ROOT{%{_localstatedir}/log/{%{name},archive/%{name}},%{_localstatedir}/cache/%{name}} \
99 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}}
101 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
102 install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
103 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
104 install %{SOURCE3} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
105 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
106 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.monitrc
107 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf
109 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
111 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
112 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
115 rm -rf $RPM_BUILD_ROOT
118 %groupadd -r -g 213 %{name}
120 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
121 %addusertogroup %{name} http
124 for a in access.log error.log; do
125 if [ ! -f /var/log/%{name}/$a ]; then
126 touch /var/log/%{name}/$a
127 chown nginx:nginx /var/log/%{name}/$a
128 chmod 644 /var/log/%{name}/$a
131 /sbin/chkconfig --add %{name}
132 %service %{name} restart
135 if [ "$1" = "0" ]; then
136 %service -q %{name} stop
137 /sbin/chkconfig --del %{name}
141 if [ "$1" = "0" ]; then
147 %defattr(644,root,root,755)
148 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
149 %doc %lang(ru) CHANGES.ru
150 %attr(754,root,root) /etc/rc.d/init.d/%{name}
151 %dir %attr(754,root,root) %{_sysconfdir}
153 %dir %{_nginxdir}/cgi-bin
154 %dir %{_nginxdir}/html
155 %dir %{_nginxdir}/errors
156 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
157 %attr(640,root,root) %{_sysconfdir}/*[_-]*
158 %attr(640,root,root) %{_sysconfdir}/proxy.conf
159 %attr(640,root,root) %{_sysconfdir}/nginx.monitrc
160 %attr(640,root,root) %{_sysconfdir}/mime.types
161 %attr(755,root,root) %{_sbindir}/%{name}
162 %attr(770,root,%{name}) /var/cache/%{name}
163 %attr(750,%{name},logs) /var/log/%{name}
164 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
165 #%attr(755,%{name},%{name}) %{_nginxdir}/html/favicon.ico