]> git.pld-linux.org Git - packages/nginx.git/blob - nginx.spec
even more P: webserver(*)
[packages/nginx.git] / nginx.spec
1 # TODO
2 # - /etc/sysconfig/nginx file
3 # - missing perl build/install requires
4 #
5 # Conditional build for nginx:
6 %bcond_without  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
34 Summary:        High perfomance HTTP and reverse proxy server
35 Summary(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
39 Name:           nginx
40 Version:        1.11.3
41 Release:        1
42 License:        BSD-like
43 Group:          Networking/Daemons/HTTP
44 Source0:        http://nginx.org/download/%{name}-%{version}.tar.gz
45 # Source0-md5:  18275c1daa39c5fac12e56c34907d45b
46 Source1:        http://nginx.net/favicon.ico
47 # Source1-md5:  2aaf2115c752cbdbfb8a2f0b3c3189ab
48 Source2:        proxy.conf
49 Source3:        %{name}.logrotate
50 Source4:        %{name}.mime
51 Source6:        %{name}-light.monitrc
52 Source7:        %{name}.init
53 Source8:        %{name}-mail.conf
54 Source9:        %{name}-mail.monitrc
55 Source12:       %{name}-perl.monitrc
56 Source14:       %{name}.conf
57 Source15:       %{name}-standard.monitrc
58 Source17:       %{name}-mime.types.sh
59 Source18:       %{name}-standard.service
60 Source19:       %{name}-light.service
61 Source20:       %{name}-perl.service
62 Source21:       %{name}-mail.service
63 Source22:       http://www.modsecurity.org/tarball/%{modsecurity_version}/modsecurity-%{modsecurity_version}.tar.gz
64 # Source22-md5: 0fa92b852abc857a20b9e24f83f814cf
65 Source101:      https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
66 # Source101-md5:        8006de2560db3e55bb15d110220076ac
67 Patch0:         %{name}-no-Werror.patch
68 Patch1:         %{name}-modsecurity-xheaders.patch
69 URL:            http://nginx.net/
70 %{?with_modsecurity:BuildRequires: lua-devel}
71 BuildRequires:  mailcap
72 %{?with_ssl:BuildRequires: openssl-devel >= %{ssl_version}}
73 BuildRequires:  pcre-devel
74 %{?with_perl:BuildRequires: perl-CGI}
75 %{?with_perl:BuildRequires: perl-devel}
76 %{?with_perl:BuildRequires: python}
77 %{?with_perl:BuildRequires: rpm-perlprov}
78 BuildRequires:  rpmbuild(macros) >= 1.644
79 BuildRequires:  zlib-devel
80 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81
82 %define         _sysconfdir     /etc/%{name}
83 %define         _nginxdir       /home/services/%{name}
84
85 %description
86 nginx ("engine x") is a high-performance HTTP server and reverse
87 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
88 Sysoev for Rambler.ru, Russia's second-most visited website, where it
89 has been running in production for over two and a half years. Igor has
90 released the source code under a BSD-like license. Although still in
91 beta, nginx is known for its stability, rich feature set, simple
92 configuration, and low resource consumption.
93
94 %description -l pl.UTF-8
95 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
96 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
97 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
98 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
99 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
100 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
101 prostej konfiguracji oraz małej "zasobożerności".
102
103 %package common
104 Summary:        nginx - common files
105 Summary(pl.UTF-8):      nginx - pliki wspólne
106 Group:          Networking/Daemons/HTTP
107 Requires(postun):       /usr/sbin/groupdel
108 Requires(postun):       /usr/sbin/userdel
109 Requires(pre):  /bin/id
110 Requires(pre):  /usr/bin/getgid
111 Requires(pre):  /usr/sbin/groupadd
112 Requires(pre):  /usr/sbin/useradd
113 Requires:       rc-scripts >= 0.2.0
114 Requires:       systemd-units >= 38
115 Suggests:       vim-syntax-nginx
116 Provides:       group(http)
117 Provides:       group(nginx)
118 Provides:       user(nginx)
119 Provides:       webserver
120 Provides:       webserver(access)
121 Provides:       webserver(alias)
122 Provides:       webserver(auth)
123 Provides:       webserver(expires)
124 Provides:       webserver(headers)
125 Provides:       webserver(indexfile)
126 Provides:       webserver(log)
127 Provides:       webserver(mime)
128 Provides:       webserver(reqtimeout)
129 Provides:       webserver(rewrite)
130 Provides:       webserver(setenv)
131 Obsoletes:      nginx < 1.4.1-4.1
132 Conflicts:      logrotate < 3.8.0
133
134 %description common
135 Common files for the nginx daemon.
136
137 %description common -l pl.UTF-8
138 Niezbędne pliki dla nginx.
139
140 %package light
141 Summary:        High perfomance HTTP and reverse proxy server
142 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
143 Group:          Networking/Daemons/HTTP
144 Requires(post,preun):   /sbin/chkconfig
145 Requires(post,preun,postun):    systemd-units >= 38
146 Requires:       %{name}-common = %{version}-%{release}
147 %{?with_ssl:Requires: openssl >= %{ssl_version}}
148 Provides:       nginx-daemon
149 Provides:       webserver
150 Provides:       webserver(access)
151 Provides:       webserver(alias)
152 Provides:       webserver(auth)
153 Provides:       webserver(expires)
154 Provides:       webserver(headers)
155 Provides:       webserver(indexfile)
156 Provides:       webserver(log)
157 Provides:       webserver(mime)
158 Provides:       webserver(reqtimeout)
159 Provides:       webserver(rewrite)
160 Provides:       webserver(setenv)
161
162 %description light
163 nginx ("engine x") is a high-performance HTTP server and reverse
164 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
165 Sysoev for Rambler.ru, Russia's second-most visited website, where it
166 has been running in production for over two and a half years. Igor has
167 released the source code under a BSD-like license. Although still in
168 beta, nginx is known for its stability, rich feature set, simple
169 configuration, and low resource consumption.
170
171 The smallest, but also the fastest nginx edition. No additional
172 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
173
174 %description light -l pl.UTF-8
175 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
176 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
177 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
178 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
179 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
180 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
181 prostej konfiguracji oraz małej "zasobożerności".
182
183 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
184 FLV oraz IMAP, POP3, SMTP proxy.
185
186 %package perl
187 Summary:        High perfomance HTTP and reverse proxy server
188 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
189 Group:          Networking/Daemons/HTTP
190 Requires(post,preun):   /sbin/chkconfig
191 Requires(post,preun,postun):    systemd-units >= 38
192 Requires:       %{name}-common = %{version}-%{release}
193 %{?with_ssl:Requires: openssl >= %{ssl_version}}
194 Provides:       nginx-daemon
195 Provides:       webserver
196 Provides:       webserver(access)
197 Provides:       webserver(alias)
198 Provides:       webserver(auth)
199 Provides:       webserver(expires)
200 Provides:       webserver(headers)
201 Provides:       webserver(indexfile)
202 Provides:       webserver(log)
203 Provides:       webserver(mime)
204 Provides:       webserver(reqtimeout)
205 Provides:       webserver(rewrite)
206 Provides:       webserver(setenv)
207
208 %description perl
209 nginx ("engine x") is a high-performance HTTP server and reverse
210 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
211 Sysoev for Rambler.ru, Russia's second-most visited website, where it
212 has been running in production for over two and a half years. Igor has
213 released the source code under a BSD-like license. Although still in
214 beta, nginx is known for its stability, rich feature set, simple
215 configuration, and low resource consumption.
216
217 nginx with Perl support. Mail modules not included.
218
219 %description perl -l pl.UTF-8
220 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
221 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
222 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
223 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
224 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
225 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
226 prostej konfiguracji oraz małej "zasobożerności".
227
228 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
229
230 %package mail
231 Summary:        High perfomance IMAP, POP3, SMTP proxy server
232 Summary(pl.UTF-8):      IMAP, POP3, SMTP proxy o wysokiej wydajności
233 Group:          Networking/Daemons/HTTP
234 Requires(post,preun):   /sbin/chkconfig
235 Requires(post,preun,postun):    systemd-units >= 38
236 Requires:       %{name}-common = %{version}-%{release}
237 Provides:       nginx-daemon
238
239 %description mail
240 nginx ("engine x") is a high-performance HTTP server and reverse
241 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
242 Sysoev for Rambler.ru, Russia's second-most visited website, where it
243 has been running in production for over two and a half years. Igor has
244 released the source code under a BSD-like license. Although still in
245 beta, nginx is known for its stability, rich feature set, simple
246 configuration, and low resource consumption.
247
248 nginx with mail support. Only mail modules included.
249
250 %description mail -l pl.UTF-8
251 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
252 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
253 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
254 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
255 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
256 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
257 prostej konfiguracji oraz małej "zasobożerności".
258
259 nginx ze wsparciem tylko dla modułów poczty.
260
261 %package standard
262 Summary:        High perfomance HTTP and reverse proxy server
263 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
264 Group:          Networking/Daemons/HTTP
265 Requires(post,preun):   /sbin/chkconfig
266 Requires(post,preun,postun):    systemd-units >= 38
267 Requires:       %{name}-common = %{version}-%{release}
268 %{?with_ssl:Requires: openssl >= %{ssl_version}}
269 Provides:       nginx
270 Provides:       nginx-daemon
271 Conflicts:      logrotate < 3.7-4
272
273 %description standard
274 nginx ("engine x") is a high-performance HTTP server and reverse
275 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
276 Sysoev for Rambler.ru, Russia's second-most visited website, where it
277 has been running in production for over two and a half years. Igor has
278 released the source code under a BSD-like license. Although still in
279 beta, nginx is known for its stability, rich feature set, simple
280 configuration, and low resource consumption.
281
282 This is standard nginx version, without Perl support and IMAP, POP3,
283 SMTP proxy.
284
285 %description standard -l pl.UTF-8
286 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
287 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
288 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
289 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
290 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
291 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
292 prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x")
293 jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3
294 proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu
295 Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji
296 i działa od ponad dwóch i pół roku. Igor opublikował źródła na
297 licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął
298 dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej
299 "zasobożerności".
300
301 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
302 IMAP, POP3, SMTP.
303
304 %package -n monit-rc-nginx
305 Summary:        nginx support for monit
306 Summary(pl.UTF-8):      Wsparcie nginx dla monit
307 Group:          Applications/System
308 URL:            http://nginx.eu/
309 Requires:       %{name}-common = %{version}-%{release}
310 Requires:       monit
311
312 %description -n monit-rc-nginx
313 monitrc file for monitoring nginx webserver.
314
315 %description -n monit-rc-nginx -l pl.UTF-8
316 Plik monitrc do monitorowania serwera WWW nginx.
317
318 %prep
319 %setup -q %{?with_rtmp:-a101} %{?with_modsecurity:-a22}
320 %patch0 -p0
321 %{?with_modsecurity:%patch1 -p0}
322
323 %if %{with rtmp}
324 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
325 %endif
326
327 # build mime.types.conf
328 #sh %{SOURCE17} /etc/mime.types
329
330 %build
331 # NB: not autoconf generated configure
332 cp -f configure auto/
333
334 install -d bin
335
336 # build with default options
337 build() {
338         local type=$1; shift
339 ./configure \
340         --prefix=%{_prefix} \
341         --sbin-path=%{_sbindir}/%{name}-$type \
342         --conf-path=%{_sysconfdir}/%{name}-$type.conf \
343         --error-log-path=%{_localstatedir}/log/%{name}/%{name}-${type}_error.log \
344         --http-log-path=%{_localstatedir}/log/%{name}/%{name}-${type}_access.log \
345         --pid-path=%{_localstatedir}/run/%{name}-$type.pid \
346         --lock-path=%{_localstatedir}/lock/subsys/%{name}-$type \
347         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-$type/client_body_temp \
348         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-$type/fastcgi_temp \
349         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-$type/proxy_temp \
350         --user=nginx \
351         --group=nginx \
352         %{?with_ipv6:--with-ipv6} \
353         %{?with_select:--with-select_module} \
354         %{?with_poll:--with-poll_module} \
355         %{?with_rtsig:--with-rtsig_module} \
356         --with-cc="%{__cc}" \
357         --with-cc-opt="%{rpmcflags}" \
358         --with-ld-opt="%{rpmldflags}" \
359         %{?with_debug:--with-debug} \
360         "$@"
361 %{__make}
362 }
363
364 %if %{with modsecurity}
365 cd modsecurity-%{modsecurity_version}
366 ./autogen.sh
367 %configure \
368         --enable-standalone-module \
369         --disable-mlogc \
370         --enable-alp2 \
371         --with-lua=/usr
372 %{__make}
373 cd ..
374 %endif
375
376 %if %{with perl}
377 build perl \
378         --with-http_perl_module \
379         %{?with_addition:--with-http_addition_module} \
380         %{?with_dav:--with-http_dav_module} \
381         %{?with_flv:--with-http_flv_module} \
382         %{?with_sub:--with-http_sub_module} \
383         %{?with_realip:--with-http_realip_module} \
384         %{?with_status:--with-http_stub_status_module} \
385         %{?with_ssl:--with-http_ssl_module} \
386         %{!?with_http_browser:--without-http_browser_module} \
387         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
388         %{?with_auth_request:--with-http_auth_request_module} \
389         %{?with_threads:--with-threads} \
390         %{?with_http2:--with-http_v2_module} \
391         --with-http_secure_link_module \
392         %{nil}
393
394 mv -f objs/nginx bin/nginx-perl
395 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so
396 mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm
397 %endif
398
399 %if %{with mail}
400 build mail \
401         --without-http \
402         --with-imap \
403         --with-mail \
404         --with-mail_ssl_module \
405         %{nil}
406
407 mv -f objs/nginx bin/nginx-mail
408 %endif
409
410 %if %{with light}
411 build light \
412         %{?with_realip:--with-http_realip_module} \
413         %{?with_status:--with-http_stub_status_module} \
414         %{?with_ssl:--with-http_ssl_module} \
415         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
416         %{?with_auth_request:--with-http_auth_request_module} \
417         %{?with_threads:--with-threads} \
418         %{?with_http2:--with-http_v2_module} \
419         %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
420         --without-http_browser_module \
421         --with-http_secure_link_module \
422         %{nil}
423
424 mv -f objs/nginx bin/nginx-light
425 %endif
426
427 build standard \
428         %{?with_addition:--with-http_addition_module} \
429         %{?with_dav:--with-http_dav_module} \
430         %{?with_flv:--with-http_flv_module} \
431         %{?with_sub:--with-http_sub_module} \
432         %{?with_realip:--with-http_realip_module} \
433         %{?with_status:--with-http_stub_status_module} \
434         %{?with_ssl:--with-http_ssl_module} \
435         %{!?with_http_browser:--without-http_browser_module} \
436         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
437         %{?with_auth_request:--with-http_auth_request_module} \
438         %{?with_threads:--with-threads} \
439         %{?with_http2:--with-http_v2_module} \
440         %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
441         --with-http_secure_link_module \
442         %{nil}
443
444 mv -f objs/nginx bin/nginx-standard
445
446 %install
447 rm -rf $RPM_BUILD_ROOT
448 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
449         $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
450         $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
451         $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
452         $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
453         $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
454         $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
455         $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
456
457 cp -p conf/*_params $RPM_BUILD_ROOT%{_sysconfdir}
458 cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
459 cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
460 cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
461 cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
462 cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
463 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
464 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
465 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
466 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
467
468 install_build() {
469         local type=$1
470         %{__sed} -e "s/@type@/${type}/g" %{_sourcedir}/%{name}.conf \
471                 > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-$type.conf
472
473         install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-$type
474         %{__sed} -i -e "s/@type@/${type}/g" $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-$type
475
476         cp -p %{_sourcedir}/%{name}-$type.service $RPM_BUILD_ROOT%{systemdunitdir}
477         cp -p %{_sourcedir}/%{name}-$type.monitrc $RPM_BUILD_ROOT/etc/monit
478         install -p bin/%{name}-$type $RPM_BUILD_ROOT%{_sbindir}
479 }
480
481 install_build standard
482 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
483
484 %if %{with light}
485 install_build light
486 %endif
487
488 %if %{with perl}
489 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
490 install_build perl
491 cp -p bin/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
492 install -p bin/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
493 install -p bin/nginx-perl $RPM_BUILD_ROOT%{_sbindir}
494 %endif
495
496 %if %{with mail}
497 install_build mail
498 %endif
499
500 # only touch these for ghost packaging
501 touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params
502
503 %clean
504 rm -rf $RPM_BUILD_ROOT
505
506 %pre common
507 %groupadd -r -g 213 %{name}
508 %groupadd -g 51 http
509 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
510 %addusertogroup %{name} http
511
512 %post standard
513 for a in access.log error.log; do
514         if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
515                 umask 022
516                 touch /var/log/%{name}/nginx-standard_$a
517                 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
518                 chmod 644 /var/log/%{name}/nginx-standard_$a
519         fi
520 done
521 /sbin/chkconfig --add %{name}-standard
522 %systemd_post %{name}-standard.service
523 %service %{name}-standard force-reload
524 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
525 if ! [ -L /etc/systemd/system/nginx.service ] ; then
526         ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
527 fi
528
529 %post light
530 for a in access.log error.log; do
531         if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
532                 umask 022
533                 touch /var/log/%{name}/nginx-light_$a
534                 chown nginx:nginx /var/log/%{name}/nginx-light_$a
535                 chmod 644 /var/log/%{name}/nginx-light_$a
536         fi
537 done
538 /sbin/chkconfig --add %{name}-light
539 %systemd_post %{name}-light.service
540 %service %{name}-light force-reload
541 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
542
543 %post perl
544 for a in access.log error.log; do
545         if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
546                 umask 022
547                 touch /var/log/%{name}/nginx-perl_$a
548                 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
549                 chmod 644 /var/log/%{name}/nginx-perl_$a
550         fi
551 done
552 /sbin/chkconfig --add %{name}-perl
553 %systemd_post %{name}-perl.service
554 %service %{name}-perl force-reload
555 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
556
557 %post mail
558 for a in access.log error.log; do
559         if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
560                 umask 022
561                 touch /var/log/%{name}/nginx-mail_$a
562                 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
563                 chmod 644 /var/log/%{name}/nginx-mail_$a
564         fi
565 done
566 /sbin/chkconfig --add %{name}-mail
567 %systemd_post %{name}-mail.service
568 %service %{name}-mail force-reload
569 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
570
571 %preun standard
572 if [ "$1" = "0" ];then
573         %service %{name}-standard stop
574         /sbin/chkconfig --del %{name}-standard
575 fi
576 %systemd_preun %{name}-standard.service
577
578 %preun light
579 if [ "$1" = "0" ]; then
580         %service %{name}-light stop
581         /sbin/chkconfig --del %{name}-light
582 fi
583 %systemd_preun %{name}-light.service
584
585 %preun perl
586 if [ "$1" = "0" ]; then
587         %service %{name}-perl stop
588         /sbin/chkconfig --del %{name}-perl
589 fi
590 %systemd_preun %{name}-perl.service
591
592 %preun mail
593 if [ "$1" = "0" ]; then
594         %service %{name}-mail stop
595         /sbin/chkconfig --del %{name}-mail
596 fi
597 %systemd_preun %{name}-mail.service
598
599 %postun common
600 if [ "$1" = "0" ]; then
601         %userremove %{name}
602         %groupremove %{name}
603 fi
604
605 %postun standard
606 %systemd_reload
607
608 %postun light
609 %systemd_reload
610
611 %postun perl
612 %systemd_reload
613
614 %postun mail
615 %systemd_reload
616
617 %triggerpostun -- %{name}-standard < 1.4.1-4
618 %systemd_trigger %{name}-standard.service
619
620 %triggerpostun -- %{name}-light < 1.4.1-4
621 %systemd_trigger %{name}-light.service
622
623 %triggerpostun -- %{name}-perl < 1.4.1-4
624 %systemd_trigger %{name}-perl.service
625
626 %triggerpostun -- %{name}-mail < 1.4.1-4
627 %systemd_trigger %{name}-mail.service
628
629 %triggerpostun common -- %{name}-common < 1.8.0-2
630 # skip *this* trigger on downgrade
631 [ $1 -le 1 ] && exit 0
632 ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params
633 ln -sf scgi_params %{_sysconfdir}/scgi.params
634 ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params
635 exit 0
636
637 %files common
638 %defattr(644,root,root,755)
639 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
640 %doc %lang(ru) CHANGES.ru
641 %dir %attr(750,root,nginx) %{_sysconfdir}
642 %dir %{_nginxdir}
643 %dir %{_nginxdir}/cgi-bin
644 %dir %{_nginxdir}/html
645 %dir %{_nginxdir}/errors
646 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
647 # XXX: duplicates, don't use such glob here
648 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
649 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
650 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params
651 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params
652 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params
653 %ghost %{_sysconfdir}/fastcgi.params
654 %ghost %{_sysconfdir}/scgi.params
655 %ghost %{_sysconfdir}/uwsgi.params
656 %attr(640,root,root) %{_sysconfdir}/mime.types
657 %attr(640,root,root) %{_sysconfdir}/koi-utf
658 %attr(640,root,root) %{_sysconfdir}/koi-win
659 %attr(640,root,root) %{_sysconfdir}/win-utf
660 %dir %{_sysconfdir}/webapps.d
661 %dir %{_sysconfdir}/vhosts.d
662 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
663 %attr(750,nginx,logs) /var/log/%{name}
664 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
665 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
666 %ghost /etc/systemd/system/nginx.service
667
668 %files standard
669 %defattr(644,root,root,755)
670 %attr(755,root,root) %{_sbindir}/%{name}-standard
671 %attr(770,root,%{name}) /var/cache/%{name}-standard
672 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
673 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
674 %{systemdunitdir}/%{name}-standard.service
675
676 %if %{with mail}
677 %files mail
678 %defattr(644,root,root,755)
679 %attr(755,root,root) %{_sbindir}/%{name}-mail
680 %attr(770,root,%{name}) /var/cache/%{name}-mail
681 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
682 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
683 %{systemdunitdir}/%{name}-mail.service
684 %endif
685
686 %if %{with light}
687 %files light
688 %defattr(644,root,root,755)
689 %attr(755,root,root) %{_sbindir}/%{name}-light
690 %attr(770,root,%{name}) /var/cache/%{name}-light
691 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
692 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
693 %{systemdunitdir}/%{name}-light.service
694 %endif
695
696 %if %{with perl}
697 %files perl
698 %defattr(644,root,root,755)
699 %attr(755,root,root) %{_sbindir}/%{name}-perl
700 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
701 %attr(770,root,%{name}) /var/cache/%{name}-perl
702 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
703 %dir %{perl_vendorarch}/auto/%{name}
704 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
705 %{perl_vendorarch}/%{name}.pm
706 %{systemdunitdir}/%{name}-perl.service
707 %endif
708
709 %files -n monit-rc-nginx
710 %defattr(644,root,root,755)
711 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
712 %if %{with perl}
713 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
714 %endif
715 %if %{with light}
716 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
717 %endif
718 %if %{with mail}
719 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
720 %endif
This page took 0.089191 seconds and 3 git commands to generate.