]> git.pld-linux.org Git - packages/nginx.git/blame_incremental - nginx.spec
drop unneeded triggers
[packages/nginx.git] / nginx.spec
... / ...
CommitLineData
1# TODO
2# - /etc/sysconfig/nginx file
3# - missing perl build/install requires
4#
5# Conditional build for nginx:
6%bcond_with light # don't build light version
7%bcond_without mail # don't build imap/mail proxy
8%bcond_without perl # don't build with perl module
9%bcond_without addition # adds module
10%bcond_without dav # WebDAV
11%bcond_without flv # FLV stream
12%bcond_without ipv6 # build without ipv6 support
13%bcond_without sub # ngx_http_sub_module
14%bcond_without poll # poll
15%bcond_without realip # real ip (behind proxy)
16%bcond_without select # select
17%bcond_without http2 # HTTP/2 module
18%bcond_without status # status module
19%bcond_without ssl # ssl support
20%bcond_without threads # thread pool support
21%bcond_with http_browser # header "User-agent" parser
22%bcond_with rtmp # rtmp support
23%bcond_with debug # enable debug logging: http://nginx.org/en/docs/debugging_log.html
24%bcond_without auth_request # auth_request module
25%bcond_with modsecurity # modsecurity module
26
27%ifarch x32
28%undefine with_rtsig
29%endif
30
31%define ssl_version 1.0.2
32%define rtmp_version 1.1.7
33%define modsecurity_version 2.9.1
34Summary: High perfomance HTTP and reverse proxy server
35Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
36# nginx lines:
37# - stable: production quality with stable API
38# - mainline: production quality but API can change
39Name: nginx
40Version: 1.11.5
41Release: 0.1
42License: BSD-like
43Group: Networking/Daemons/HTTP
44Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
45# Source0-md5: db43f2b19746f6f47401c3afc3924dc6
46Source1: http://nginx.net/favicon.ico
47# Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
48Source2: proxy.conf
49Source3: %{name}.logrotate
50Source4: %{name}.mime
51Source6: %{name}.monitrc
52Source7: %{name}.init
53Source14: %{name}.conf
54Source17: %{name}-mime.types.sh
55Source18: %{name}.service
56Source22: http://www.modsecurity.org/tarball/%{modsecurity_version}/modsecurity-%{modsecurity_version}.tar.gz
57# Source22-md5: 0fa92b852abc857a20b9e24f83f814cf
58Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
59# Source101-md5: 8006de2560db3e55bb15d110220076ac
60Patch0: %{name}-no-Werror.patch
61Patch1: %{name}-modsecurity-xheaders.patch
62URL: http://nginx.net/
63%{?with_modsecurity:BuildRequires: lua-devel}
64BuildRequires: mailcap
65%{?with_ssl:BuildRequires: openssl-devel >= %{ssl_version}}
66BuildRequires: pcre-devel
67%{?with_perl:BuildRequires: perl-CGI}
68%{?with_perl:BuildRequires: perl-devel}
69%{?with_perl:BuildRequires: python}
70%{?with_perl:BuildRequires: rpm-perlprov}
71BuildRequires: rpmbuild(macros) >= 1.644
72BuildRequires: zlib-devel
73%{?with_ssl:Requires: openssl >= %{ssl_version}}
74Provides: group(http)
75Provides: group(nginx)
76Provides: user(nginx)
77Provides: webserver
78Provides: webserver(access)
79Provides: webserver(alias)
80Provides: webserver(auth)
81Provides: webserver(expires)
82Provides: webserver(headers)
83Provides: webserver(indexfile)
84Provides: webserver(log)
85Provides: webserver(mime)
86Provides: webserver(reqtimeout)
87Provides: webserver(rewrite)
88Provides: webserver(setenv)
89Conflicts: logrotate < 3.8.0
90Requires(post,preun): /sbin/chkconfig
91Requires(post,preun,postun): systemd-units >= 38
92Requires(postun): /usr/sbin/groupdel
93Requires(postun): /usr/sbin/userdel
94Requires(pre): /bin/id
95Requires(pre): /usr/bin/getgid
96Requires(pre): /usr/sbin/groupadd
97Requires(pre): /usr/sbin/useradd
98Requires: rc-scripts >= 0.2.0
99Requires: systemd-units >= 38
100Suggests: vim-syntax-nginx
101BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
102
103%define _sysconfdir /etc/%{name}
104%define _nginxdir /home/services/%{name}
105
106%description
107nginx ("engine x") is a high-performance HTTP server and reverse
108proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
109Sysoev for Rambler.ru, Russia's second-most visited website, where it
110has been running in production for over two and a half years. Igor has
111released the source code under a BSD-like license. Although still in
112beta, nginx is known for its stability, rich feature set, simple
113configuration, and low resource consumption.
114
115%description -l pl.UTF-8
116nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
117a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
118potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
119odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
120opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
121fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
122prostej konfiguracji oraz małej "zasobożerności".
123
124%package perl
125Summary: High perfomance HTTP and reverse proxy server
126Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
127Group: Networking/Daemons/HTTP
128Requires: %{name} = %{version}-%{release}
129
130%description perl
131nginx ("engine x") is a high-performance HTTP server and reverse
132proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
133Sysoev for Rambler.ru, Russia's second-most visited website, where it
134has been running in production for over two and a half years. Igor has
135released the source code under a BSD-like license. Although still in
136beta, nginx is known for its stability, rich feature set, simple
137configuration, and low resource consumption.
138
139nginx with Perl support. Mail modules not included.
140
141%description perl -l pl.UTF-8
142nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
143a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
144potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
145odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
146opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
147fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
148prostej konfiguracji oraz małej "zasobożerności".
149
150nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
151
152%package mail
153Summary: High perfomance IMAP, POP3, SMTP proxy server
154Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
155Group: Networking/Daemons/HTTP
156Requires: %{name} = %{version}-%{release}
157
158%description mail
159nginx ("engine x") is a high-performance HTTP server and reverse
160proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
161Sysoev for Rambler.ru, Russia's second-most visited website, where it
162has been running in production for over two and a half years. Igor has
163released the source code under a BSD-like license. Although still in
164beta, nginx is known for its stability, rich feature set, simple
165configuration, and low resource consumption.
166
167nginx with mail support. Only mail modules included.
168
169%description mail -l pl.UTF-8
170nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
171a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
172potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
173odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
174opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
175fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
176prostej konfiguracji oraz małej "zasobożerności".
177
178nginx ze wsparciem tylko dla modułów poczty.
179
180%package -n monit-rc-nginx
181Summary: nginx support for monit
182Summary(pl.UTF-8): Wsparcie nginx dla monit
183Group: Applications/System
184Requires: %{name} = %{version}-%{release}
185Requires: monit
186
187%description -n monit-rc-nginx
188monitrc file for monitoring nginx webserver.
189
190%description -n monit-rc-nginx -l pl.UTF-8
191Plik monitrc do monitorowania serwera WWW nginx.
192
193%prep
194%setup -q %{?with_rtmp:-a101} %{?with_modsecurity:-a22}
195%patch0 -p0
196%{?with_modsecurity:%patch1 -p0}
197
198%if %{with rtmp}
199mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
200%endif
201
202# build mime.types.conf
203#sh %{SOURCE17} /etc/mime.types
204
205%build
206# NB: not autoconf generated configure
207cp -f configure auto/
208
209install -d bin
210
211# build with default options
212build() {
213 local type=$1; shift
214./configure \
215 --prefix=%{_prefix} \
216 --modules-path=%{_libdir}/%{name}/modules \
217 --sbin-path=%{_sbindir}/%{name} \
218 --conf-path=%{_sysconfdir}/%{name}.conf \
219 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
220 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
221 --pid-path=%{_localstatedir}/run/%{name}.pid \
222 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
223 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
224 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
225 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
226 --user=nginx \
227 --group=nginx \
228 %{?with_ipv6:--with-ipv6} \
229 %{?with_select:--with-select_module} \
230 %{?with_poll:--with-poll_module} \
231 %{?with_rtsig:--with-rtsig_module} \
232%if %{with perl}
233 --with-http_perl_module=dynamic \
234%endif
235%if %{with mail}
236 --with-mail=dynamic \
237 --with-mail_ssl_module \
238%endif
239 --with-cc="%{__cc}" \
240 --with-cc-opt="%{rpmcflags}" \
241 --with-ld-opt="%{rpmldflags}" \
242 %{?with_debug:--with-debug} \
243 "$@"
244%{__make}
245}
246
247%if %{with modsecurity}
248cd modsecurity-%{modsecurity_version}
249./autogen.sh
250%configure \
251 --enable-standalone-module \
252 --disable-mlogc \
253 --enable-alp2 \
254 --with-lua=/usr
255%{__make}
256cd ..
257%endif
258
259%if %{with perl} && 0
260build perl \
261 --with-http_perl_module \
262 %{?with_addition:--with-http_addition_module} \
263 %{?with_dav:--with-http_dav_module} \
264 %{?with_flv:--with-http_flv_module} \
265 %{?with_sub:--with-http_sub_module} \
266 %{?with_realip:--with-http_realip_module} \
267 %{?with_status:--with-http_stub_status_module} \
268 %{?with_ssl:--with-http_ssl_module} \
269 %{!?with_http_browser:--without-http_browser_module} \
270 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
271 %{?with_auth_request:--with-http_auth_request_module} \
272 %{?with_threads:--with-threads} \
273 %{?with_http2:--with-http_v2_module} \
274 --with-http_secure_link_module \
275 %{nil}
276
277mv -f objs/nginx bin/nginx-perl
278mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so
279mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm
280%endif
281
282%if %{with mail} && 0
283build mail \
284 --without-http \
285 --with-imap \
286 --with-mail \
287 --with-mail_ssl_module \
288 %{nil}
289
290mv -f objs/nginx bin/nginx-mail
291%endif
292
293%if %{with light}
294build light \
295 %{?with_realip:--with-http_realip_module} \
296 %{?with_status:--with-http_stub_status_module} \
297 %{?with_ssl:--with-http_ssl_module} \
298 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
299 %{?with_auth_request:--with-http_auth_request_module} \
300 %{?with_threads:--with-threads} \
301 %{?with_http2:--with-http_v2_module} \
302 %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
303 --without-http_browser_module \
304 --with-http_secure_link_module \
305 %{nil}
306
307mv -f objs/nginx bin/nginx-light
308%endif
309
310build standard \
311 %{?with_addition:--with-http_addition_module} \
312 %{?with_dav:--with-http_dav_module} \
313 %{?with_flv:--with-http_flv_module} \
314 %{?with_sub:--with-http_sub_module} \
315 %{?with_realip:--with-http_realip_module} \
316 %{?with_status:--with-http_stub_status_module} \
317 %{?with_ssl:--with-http_ssl_module} \
318 %{!?with_http_browser:--without-http_browser_module} \
319 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
320 %{?with_auth_request:--with-http_auth_request_module} \
321 %{?with_threads:--with-threads} \
322 %{?with_http2:--with-http_v2_module} \
323 %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
324 --with-http_secure_link_module \
325 %{nil}
326
327%install
328rm -rf $RPM_BUILD_ROOT
329install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
330 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
331 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
332 $RPM_BUILD_ROOT%{_localstatedir}/cache/%{name} \
333 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/%{name} \
334 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
335 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
336 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
337
338%{__make} install \
339 INSTALLDIRS=vendor \
340 DESTDIR=$RPM_BUILD_ROOT
341
342%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/*.default
343
344cp -p %{_sourcedir}/%{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
345cp -p %{_sourcedir}/%{name}.service $RPM_BUILD_ROOT%{systemdunitdir}
346cp -p %{_sourcedir}/%{name}.monitrc $RPM_BUILD_ROOT/etc/monit
347install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
348
349cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
350cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
351cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
352rm -r $RPM_BUILD_ROOT%{_prefix}/html
353cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
354cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
355cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
356
357%if %{with perl}
358%{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
359%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/nginx/.packlist
360%endif
361
362# only touch these for ghost packaging
363touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params
364
365%clean
366rm -rf $RPM_BUILD_ROOT
367
368%pre
369%groupadd -r -g 213 %{name}
370%groupadd -g 51 http
371%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
372%addusertogroup %{name} http
373
374%post
375for a in access.log error.log; do
376 if [ ! -f /var/log/%{name}/$a ]; then
377 umask 022
378 touch /var/log/%{name}/$a
379 chown nginx:nginx /var/log/%{name}/$a
380 chmod 644 /var/log/%{name}/$a
381 fi
382done
383/sbin/chkconfig --add %{name}
384%systemd_post %{name}.service
385%service %{name} force-reload
386
387%preun
388if [ "$1" = "0" ];then
389 %service %{name} stop
390 /sbin/chkconfig --del %{name}
391fi
392%systemd_preun %{name}.service
393
394%postun
395if [ "$1" = "0" ]; then
396 %userremove %{name}
397 %groupremove %{name}
398fi
399%systemd_reload
400
401%triggerpostun -- %{name} < 1.8.0-2
402# skip *this* trigger on downgrade
403[ $1 -le 1 ] && exit 0
404ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params
405ln -sf scgi_params %{_sysconfdir}/scgi.params
406ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params
407exit 0
408
409%files
410%defattr(644,root,root,755)
411%doc CHANGES LICENSE README html/index.html conf/nginx.conf
412%doc %lang(ru) CHANGES.ru
413%dir %attr(750,root,nginx) %{_sysconfdir}
414%dir %{_nginxdir}
415%dir %{_nginxdir}/cgi-bin
416%dir %{_nginxdir}/html
417%dir %{_nginxdir}/errors
418%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
419%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
420%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params
421%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params
422%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params
423%ghost %{_sysconfdir}/fastcgi.params
424%ghost %{_sysconfdir}/scgi.params
425%ghost %{_sysconfdir}/uwsgi.params
426%attr(640,root,root) %{_sysconfdir}/mime.types
427%attr(640,root,root) %{_sysconfdir}/koi-utf
428%attr(640,root,root) %{_sysconfdir}/koi-win
429%attr(640,root,root) %{_sysconfdir}/win-utf
430%dir %{_sysconfdir}/webapps.d
431%dir %{_sysconfdir}/vhosts.d
432%attr(750,nginx,logs) %dir /var/log/archive/%{name}
433%attr(750,nginx,logs) /var/log/%{name}
434%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
435%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
436
437%defattr(644,root,root,755)
438%attr(755,root,root) %{_sbindir}/%{name}
439%attr(770,root,%{name}) /var/cache/%{name}
440%attr(754,root,root) /etc/rc.d/init.d/%{name}
441%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
442%{systemdunitdir}/%{name}.service
443
444%if %{with mail}
445%files mail
446%defattr(644,root,root,755)
447%attr(755,root,root) %{_libdir}/%{name}/modules/ngx_mail_module.so
448%endif
449
450%if %{with perl}
451%files perl
452%defattr(644,root,root,755)
453%attr(755,root,root) %{_libdir}/%{name}/modules/ngx_http_perl_module.so
454%dir %{perl_vendorarch}/auto/%{name}
455%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
456%{perl_vendorarch}/%{name}.pm
457%{_mandir}/man3/nginx.3pm*
458%endif
459
460%files -n monit-rc-nginx
461%defattr(644,root,root,755)
462%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc
This page took 0.06539 seconds and 4 git commands to generate.