2 # - bconds for modules as these are statically linked in
4 Summary: High perfomance HTTP and reverse proxy server
5 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
10 Group: Networking/Daemons
11 Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
12 # Source0-md5: c82a9479e6fc027575377a38405b5df0
14 Source2: %{name}-mime.types.sh
15 Patch0: %{name}-config.patch
16 URL: http://nginx.net/
17 BuildRequires: mailcap
18 BuildRequires: openssl-devel
19 BuildRequires: pcre-devel
20 BuildRequires: rpmbuild(macros) >= 1.268
21 BuildRequires: zlib-devel
22 Requires(post,preun): /sbin/chkconfig
23 Requires(postun): /usr/sbin/groupdel
24 Requires(postun): /usr/sbin/userdel
25 Requires(pre): /bin/id
26 Requires(pre): /usr/bin/getgid
27 Requires(pre): /usr/sbin/groupadd
28 Requires(pre): /usr/sbin/useradd
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 %define _sysconfdir /etc/%{name}
35 High perfomance HTTP and reverse proxy server.
37 %description -l pl.UTF-8
38 Serwer HTTP i odwrotne proxy o wysokiej wydajności.
44 # build mime.types.conf
45 sh %{SOURCE2} /etc/mime.types
48 # NB: not autoconf generated configure
51 --sbin-path=%{_sbindir}/%{name} \
52 --conf-path=%{_sysconfdir}/%{name}.conf \
53 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
54 --pid-path=%{_localstatedir}/run/%{name}.pid \
58 --with-select_module \
60 --with-http_ssl_module \
61 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
62 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
63 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
64 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
67 --with-cc-opt="%{rpmcflags}" \
68 --with-ld-opt="%{rpmldflags}" \
69 %{?debug:--with-debug}
74 rm -rf $RPM_BUILD_ROOT
75 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sbindir},%{_sysconfdir},/var/{log/%{name},cache/%{name}}}
77 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
78 install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
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 213 %{name}
91 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
94 /sbin/chkconfig --add %{name}
95 %service %{name} restart
98 if [ "$1" = "0" ]; then
99 %service -q %{name} stop
100 /sbin/chkconfig --del %{name}
104 if [ "$1" = "0" ]; then
110 %defattr(644,root,root,755)
111 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
112 %doc %lang(ru) CHANGES.ru
113 %attr(754,root,root) /etc/rc.d/init.d/%{name}
114 %dir %attr(754,root,root) %{_sysconfdir}
115 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
116 %attr(640,root,root) %{_sysconfdir}/*[_-]*
117 %attr(640,root,root) %{_sysconfdir}/mime.types
118 %attr(755,root,root) %{_sbindir}/%{name}
119 %attr(770,root,%{name}) /var/cache/%{name}
120 %attr(750,%{name},logs) /var/log/%{name}