]> git.pld-linux.org Git - packages/nginx.git/blame_incremental - nginx.spec
- fix DoS in autoindex module
[packages/nginx.git] / nginx.spec
... / ...
CommitLineData
1# TODO
2# - more bconds (??)
3# - /etc/sysconfig/nginx file
4# - prepare style like nginx.conf
5#
6# Conditional build for nginx:
7%bcond_without stub_status # stats module
8%bcond_without rtsig
9%bcond_without select
10%bcond_without poll
11%bcond_without ssl # ssl support
12%bcond_without imap # imap proxy
13%bcond_without addition
14#%bcond_without perl # perl module
15%bcond_with http_browser # header "User-agent" parser
16#
17Summary: High perfomance HTTP and reverse proxy server
18Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
19Name: nginx
20Version: 0.5.31
21Release: 4
22License: BSD-like
23Group: Networking/Daemons
24Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
25# Source0-md5: d84ef8e624b8953faf9cee2b5da535c1
26Source1: %{name}.init
27Source2: %{name}-mime.types.sh
28Source3: http://www.nginx.eu/favicon.ico
29# Source3-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
30Source4: http://www.nginx.eu/download/proxy.conf
31# Source4-md5: f5263ae01c2edb18f46d5d1df2d3a5cd
32Source5: http://www.nginx.eu/download/%{name}.monitrc
33# Source5-md5: 1d3f5eedfd34fe95213f9e0fc19daa88
34Source6: http://www.nginx.eu/download/%{name}.conf
35# Source6-md5: 1c112d6f03d0f365e4acc98c1d96261a
36Source7: %{name}.logrotate
37Patch0: %{name}-config.patch
38Patch1: %{name}-autoindexDoS.patch
39URL: http://nginx.net/
40BuildRequires: mailcap
41BuildRequires: openssl-devel
42BuildRequires: pcre-devel
43BuildRequires: rpmbuild(macros) >= 1.268
44BuildRequires: zlib-devel
45Requires(post,preun): /sbin/chkconfig
46Requires(postun): /usr/sbin/groupdel
47Requires(postun): /usr/sbin/userdel
48Requires(pre): /bin/id
49Requires(pre): /usr/bin/getgid
50Requires(pre): /usr/sbin/groupadd
51Requires(pre): /usr/sbin/useradd
52Requires: rc-scripts >= 0.2.0
53Provides: group(http)
54Provides: group(nginx)
55Provides: user(nginx)
56Provides: webserver
57Conflicts: logrotate < 3.7-4
58BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60%define _sysconfdir /etc/%{name}
61%define _nginxdir /home/services/%{name}
62
63%description
64Nginx ("engine x") is a high-performance HTTP server and reverse
65proxy, as well as an IMAP/POP3 proxy server. Nginx was written by Igor
66Sysoev for Rambler.ru, Russia's second-most visited website, where it
67has been running in production for over two and a half years. Igor has
68released the source code under a BSD-like license. Although still in
69beta, Nginx is known for its stability, rich feature set, simple
70configuration, and low resource consumption.
71
72%description -l pl.UTF-8
73Serwer HTTP i odwrotne proxy o wysokiej wydajności.
74
75
76%package -n monit-rc-nginx
77Summary: Nginx support for monit
78Summary(pl.UTF-8): Wsparcie nginx dla monit
79Group: Applications/System
80Requires: %{name} = %{version}-%{release}
81Requires: monit
82
83%description -n monit-rc-nginx
84monitrc file for monitoring nginx webserver server.
85
86%description -n monit-rc-nginx -l pl.UTF-8
87Plik monitrc do monitorowania serwera www nginx.
88
89
90%prep
91%setup -q
92%patch0 -p0
93%patch1 -p0
94
95# build mime.types.conf
96sh %{SOURCE2} /etc/mime.types
97
98%build
99# NB: not autoconf generated configure
100./configure \
101 --prefix=%{_prefix} \
102 --sbin-path=%{_sbindir}/%{name} \
103 --conf-path=%{_sysconfdir}/%{name}.conf \
104 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
105 --pid-path=%{_localstatedir}/run/%{name}.pid \
106 --user=nginx \
107 --group=nginx \
108 %{?with_stub_status:--with-http_stub_status_module} \
109 %{?with_rtsig:--with-rtsig_module} \
110 %{?with_select:--with-select_module} \
111 %{?with_poll:--with-poll_module} \
112 %{?with_ssl:--with-http_ssl_module} \
113 %{?with_addition:--with-http_addition_module} \
114 %{?with_imap:--with-imap} \
115 %{!?with_http_browser:--without-http_browser_module} \
116 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
117 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
118 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
119 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
120 --with-cc="%{__cc}" \
121 --with-cc-opt="%{rpmcflags}" \
122 --with-ld-opt="%{rpmldflags}" \
123 %{?debug:--with-debug}
124
125%{__make}
126
127%install
128rm -rf $RPM_BUILD_ROOT
129install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
130 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
131 $RPM_BUILD_ROOT{%{_localstatedir}/log/{%{name},archive/%{name}},%{_localstatedir}/cache/%{name}} \
132 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
133 $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
134
135install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
136install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
137install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
138install %{SOURCE3} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
139install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
140install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
141install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
142install %{SOURCE5} $RPM_BUILD_ROOT/etc/monit/%{name}.monitrc
143install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf
144install %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
145
146install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
147
148rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
149rm -rf $RPM_BUILD_ROOT%{_prefix}/html
150
151%clean
152rm -rf $RPM_BUILD_ROOT
153
154%pre
155%groupadd -r -g 213 %{name}
156%groupadd -g 51 http
157%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
158%addusertogroup %{name} http
159
160%post
161for a in access.log error.log; do
162 if [ ! -f /var/log/%{name}/$a ]; then
163 touch /var/log/%{name}/$a
164 chown nginx:nginx /var/log/%{name}/$a
165 chmod 644 /var/log/%{name}/$a
166 fi
167done
168/sbin/chkconfig --add %{name}
169%service %{name} restart
170
171%preun
172if [ "$1" = "0" ]; then
173 %service -q %{name} stop
174 /sbin/chkconfig --del %{name}
175fi
176
177%postun
178if [ "$1" = "0" ]; then
179 %userremove %{name}
180 %groupremove %{name}
181fi
182
183%files
184%defattr(644,root,root,755)
185%doc CHANGES LICENSE README html/index.html conf/nginx.conf
186%doc %lang(ru) CHANGES.ru
187%attr(754,root,root) /etc/rc.d/init.d/%{name}
188%dir %attr(754,root,root) %{_sysconfdir}
189%dir %{_nginxdir}
190%dir %{_nginxdir}/cgi-bin
191%dir %{_nginxdir}/html
192%dir %{_nginxdir}/errors
193%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
194%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
195%attr(640,root,root) %{_sysconfdir}/*[_-]*
196%attr(640,root,root) %{_sysconfdir}/proxy.conf
197%attr(640,root,root) %{_sysconfdir}/mime.types
198%attr(755,root,root) %{_sbindir}/%{name}
199%attr(770,root,%{name}) /var/cache/%{name}
200%attr(750,root,root) %dir /var/log/archive/%{name}
201%attr(750,%{name},logs) /var/log/%{name}
202%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
203%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
204
205%files -n monit-rc-nginx
206%defattr(644,root,root,755)
207%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc
This page took 0.024839 seconds and 4 git commands to generate.