2 # - bconds for modules as these are statically linked in
5 %bcond_with initscript # initscript
7 Summary: High perfomance HTTP and reverse proxy server
8 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
14 Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
15 # Source0-md5: 3415c2b49b66fae5b11ca348ec0c2605
17 Patch0: %{name}-config.patch
18 URL: http://nginx.net/
19 Requires(post,preun): /sbin/chkconfig
20 Requires(postun): /usr/sbin/groupdel
21 Requires(postun): /usr/sbin/userdel
22 Requires(pre): /bin/id
23 Requires(pre): /usr/bin/getgid
24 Requires(pre): /usr/sbin/groupadd
25 Requires(pre): /usr/sbin/useradd
26 %if %{with initscript}
27 BuildRequires: rpmbuild(macros) >= 1.228
28 Requires(post,preun): /sbin/chkconfig
29 Requires(post,preun): rc-scripts
31 BuildRequires: openssl-devel
32 BuildRequires: pcre-devel
33 BuildRequires: zlib-devel
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 %define _sysconfdir /etc/%{name}
39 High perfomance HTTP and reverse proxy server.
41 %description -l pl.UTF-8
42 Serwer HTTP i odwrotne proxy o wysokiej wydajności.
49 # NB: not autoconf generated configure
52 --sbin-path=%{_sbindir}/%{name} \
53 --conf-path=%{_sysconfdir}/%{name}.conf \
54 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
55 --pid-path=%{_localstatedir}/run/%{name}.pid \
59 --with-select_module \
61 --with-http_ssl_module \
62 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
63 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
64 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
65 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
68 --with-cc-opt="%{rpmcflags}" \
69 --with-ld-opt="%{rpmldflags}" \
70 %{?debug:--with-debug}
75 rm -rf $RPM_BUILD_ROOT
76 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sbindir},%{_sysconfdir},/var/{log/%{name},cache/%{name}}}
78 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
79 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
81 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
83 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
84 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
87 rm -rf $RPM_BUILD_ROOT
90 %groupadd -r -g 212 %{name}
91 %useradd -r -u 212 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
93 %if %{with initscript}
95 /sbin/chkconfig --add %{name}
96 %service %{name} restart
99 if [ "$1" = "0" ]; then
100 %service -q %{name} stop
101 /sbin/chkconfig --del %{name}
106 if [ "$1" = "0" ]; then
113 %defattr(644,root,root,755)
114 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
115 %doc %lang(ru) CHANGES.ru
116 %attr(754,root,root) /etc/rc.d/init.d/%{name}
117 %dir %attr(754,root,root) %{_sysconfdir}
118 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
119 %attr(640,root,root) %{_sysconfdir}/*[_-]*
120 %attr(640,root,root) %{_sysconfdir}/mime.types
121 %attr(755,root,root) %{_sbindir}/%{name}
122 %attr(770,root,%{name}) /var/cache/%{name}
123 %attr(750,%{name},logs) /var/log/%{name}