]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
Provide the vhosts.d and webapps.d directories
[packages/nginx.git] / nginx.spec
CommitLineData
f9e65082 1# TODO
ee4f2132 2# - /etc/sysconfig/nginx file
1c438d78 3# - missing perl build/install requires
6de999a5 4# - nginx should have own group (and work with it) or use http group ?
ee4f2132 5#
362f5ab2 6# Conditional build for nginx:
056acc18 7%bcond_without light # don't build light version
8%bcond_without mail # don't build imap/mail proxy
9%bcond_without perl # don't build with perl module
d0c0492d 10%bcond_without addition # adds module
11%bcond_without dav # WebDAV
12%bcond_without flv # FLV stream
3d4bad81 13%bcond_without ipv6 # build without ipv6 support
d6fc4b09 14%bcond_without sub # ngx_http_sub_module
d0c0492d 15%bcond_without poll # poll
16%bcond_without realip # real ip (behind proxy)
17%bcond_without rtsig # rtsig
18%bcond_without select # select
19%bcond_without status # stats module
20%bcond_without ssl # ssl support
056acc18 21%bcond_with http_browser # header "User-agent" parser
fb649fe5
ER
22%bcond_without rtmp # rtmp support
23
24%define rtmp_version 1.0.2
8e1389c7 25Summary: High perfomance HTTP and reverse proxy server
185313bb 26Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
f9e65082 27Name: nginx
297cf41d 28Version: 1.4.1
d323480a 29Release: 4
51ef519b 30License: BSD-like
cbf76340 31Group: Networking/Daemons/HTTP
06e274b9 32Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
297cf41d 33# Source0-md5: fea7dfab995545ce27fe4c49dc21a972
06e274b9 34Source1: http://nginx.net/favicon.ico
9fc2d63c 35# Source1-md5: 14054e0d276e25545c9f801c91164f69
06e274b9 36Source2: proxy.conf
226bcc40 37Source3: %{name}.logrotate
38Source4: %{name}.mime
39Source5: %{name}-light.conf
40Source6: %{name}-light.monitrc
0da077af 41Source7: %{name}-light.init
42Source8: %{name}-mail.conf
43Source9: %{name}-mail.monitrc
44Source10: %{name}-mail.init
45Source11: %{name}-perl.conf
46Source12: %{name}-perl.monitrc
47Source13: %{name}-perl.init
48Source14: %{name}-standard.conf
49Source15: %{name}-standard.monitrc
7d80c773 50Source16: %{name}-standard.init
51Source17: %{name}-mime.types.sh
d323480a
JK
52Source18: %{name}-standard.service
53Source19: %{name}-light.service
54Source20: %{name}-perl.service
55Source21: %{name}-mail.service
fb649fe5
ER
56Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}.tar.gz
57# Source101-md5: 989659b13382e4ee3649fcaa6573c08e
572b4761 58Patch0: nginx-no-Werror.patch
51ef519b 59URL: http://nginx.net/
dfef7372 60BuildRequires: mailcap
f9e65082 61BuildRequires: openssl-devel
f1fc9780 62BuildRequires: pcre-devel
1c438d78 63%{?with_perl:BuildRequires: perl-CGI}
d0c0492d 64%{?with_perl:BuildRequires: perl-devel}
dd2388c2 65%{?with_perl:BuildRequires: python}
1c438d78 66%{?with_perl:BuildRequires: rpm-perlprov}
d323480a 67BuildRequires: rpmbuild(macros) >= 1.644
f9e65082 68BuildRequires: zlib-devel
7d9b86c7
ER
69Requires(post,preun): /sbin/chkconfig
70Requires(postun): /usr/sbin/groupdel
71Requires(postun): /usr/sbin/userdel
72Requires(pre): /bin/id
73Requires(pre): /usr/bin/getgid
74Requires(pre): /usr/sbin/groupadd
75Requires(pre): /usr/sbin/useradd
d323480a 76Requires(post,preun,postun): systemd-units >= 38
774b2694 77#Requires: nginx-daemon
d0c0492d 78Requires: openssl
79Requires: pcre
aba2d783 80Requires: rc-scripts >= 0.2.0
d323480a 81Requires: systemd-units >= 38
d0c0492d 82Requires: zlib
1cf92547 83Suggests: nginx-standard
ee547c00 84Provides: group(http)
85Provides: group(nginx)
86Provides: user(nginx)
7ffe7917 87Provides: webserver
99c7e901 88Conflicts: logrotate < 3.8.0
f9e65082
ER
89BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
90
362f5ab2 91%define _sysconfdir /etc/%{name}
92%define _nginxdir /home/services/%{name}
f9e65082
ER
93
94%description
57f21172 95nginx ("engine x") is a high-performance HTTP server and reverse
96proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
894ff1f7
ER
97Sysoev for Rambler.ru, Russia's second-most visited website, where it
98has been running in production for over two and a half years. Igor has
99released the source code under a BSD-like license. Although still in
57f21172 100beta, nginx is known for its stability, rich feature set, simple
894ff1f7 101configuration, and low resource consumption.
8e1389c7 102
57f21172 103Common files for nginx daemon.
85600569 104
390f5b88 105%description -l pl.UTF-8
57f21172 106nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
107a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
056acc18 108na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
109odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
110opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
98376457 111w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
1dc54c84 112prostej konfiguracji oraz małej "zasobożerności".
2ee780b1 113
57f21172 114Niezbędne pliki dla nginx.
85600569 115
2ee780b1 116%package light
117Summary: High perfomance HTTP and reverse proxy server
7ad53968 118Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
cbf76340 119Group: Networking/Daemons/HTTP
85600569 120Requires(post,preun): /sbin/chkconfig
121Requires(postun): /usr/sbin/groupdel
122Requires(postun): /usr/sbin/userdel
b0fa7cc6 123Requires: %{name} = %{version}-%{release}
85600569 124Requires: openssl
125Requires: pcre
126Requires: zlib
2ee780b1 127Provides: group(http)
128Provides: group(nginx)
119e2f19 129Provides: nginx-daemon
2ee780b1 130Provides: user(nginx)
131Provides: webserver
132
133%description light
57f21172 134The smallest, but also the fastest nginx edition. No additional
7ad53968 135modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
2ee780b1 136
137%description light -l pl.UTF-8
57f21172 138Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
1cf92547 139FLV oraz IMAP, POP3, SMTP proxy.
2ee780b1 140
141%package perl
142Summary: High perfomance HTTP and reverse proxy server
7ad53968 143Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
cbf76340 144Group: Networking/Daemons/HTTP
85600569 145Requires(post,preun): /sbin/chkconfig
146Requires(postun): /usr/sbin/groupdel
147Requires(postun): /usr/sbin/userdel
b0fa7cc6 148Requires: %{name} = %{version}-%{release}
85600569 149Requires: openssl
2ee780b1 150Provides: group(http)
151Provides: group(nginx)
1cf92547 152Provides: nginx-daemon
2ee780b1 153Provides: user(nginx)
154Provides: webserver
155
156%description perl
57f21172 157nginx with Perl support. Mail modules not included.
2ee780b1 158
159%description perl -l pl.UTF-8
57f21172 160nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
2ee780b1 161
162%package mail
57f21172 163Summary: High perfomance IMAP, POP3, SMTP proxy server
164Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
cbf76340 165Group: Networking/Daemons/HTTP
85600569 166Requires(post,preun): /sbin/chkconfig
167Requires(postun): /usr/sbin/groupdel
168Requires(postun): /usr/sbin/userdel
b0fa7cc6 169Requires: %{name} = %{version}-%{release}
85600569 170Requires: openssl
171Requires: pcre
172Requires: zlib
2ee780b1 173Provides: group(http)
174Provides: group(nginx)
1cf92547 175Provides: nginx-daemon
2ee780b1 176Provides: user(nginx)
177Provides: webserver
178
179%description mail
57f21172 180nginx with mail support. Only mail modules included.
2ee780b1 181
182%description mail -l pl.UTF-8
57f21172 183nginx ze wsparciem tylko dla modułów poczty.
2ee780b1 184
b0fa7cc6 185%package standard
57f21172 186Summary: High perfomance HTTP and reverse proxy server
4ca0234e 187Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
cbf76340 188Group: Networking/Daemons/HTTP
d6fc4b09 189Requires(post,preun): /sbin/chkconfig
190Requires(postun): /usr/sbin/groupdel
191Requires(postun): /usr/sbin/userdel
b0fa7cc6 192Requires: %{name} = %{version}-%{release}
6de999a5 193Requires: openssl
194Provides: group(http)
195Provides: group(nginx)
1cf92547 196Provides: nginx-daemon
d6fc4b09 197Conflicts: logrotate < 3.7-4
28a25161 198
b0fa7cc6 199%description standard
57f21172 200This is standard nginx version, without Perl support and IMAP, POP3,
1dc54c84 201SMTP proxy.
fccff804 202
b0fa7cc6 203%description standard -l pl.UTF-8
57f21172 204To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
1dc54c84 205IMAP, POP3, SMTP.
85600569 206
dd7459ac 207%package -n monit-rc-nginx
57f21172 208Summary: nginx support for monit
209Summary(pl.UTF-8): Wsparcie nginx dla monit
60b8f836 210Group: Applications/System
211URL: http://nginx.eu/
60b8f836 212Requires: %{name} = %{version}-%{release}
1cf92547 213Requires: monit
dd7459ac 214
215%description -n monit-rc-nginx
57f21172 216monitrc file for monitoring nginx webserver.
dd7459ac 217
218%description -n monit-rc-nginx -l pl.UTF-8
57f21172 219Plik monitrc do monitorowania serwera WWW nginx.
dd7459ac 220
f9e65082 221%prep
9fc2d63c 222%setup -q %{?with_rtmp:-a101}
717159c4 223%patch0 -p0
f9e65082 224
fb649fe5
ER
225%if %{with rtmp}
226mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
227%endif
228
a8eaad11 229# build mime.types.conf
7d80c773 230#sh %{SOURCE17} /etc/mime.types
a8eaad11 231
f9e65082
ER
232%build
233# NB: not autoconf generated configure
056acc18 234cp -f configure auto/
235#
236%if %{with perl}
237./configure \
238 --prefix=%{_prefix} \
4e61eac8 239 --sbin-path=%{_sbindir}/%{name}-perl \
240 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
241 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
242 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
243 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
244 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
056acc18 245 --user=nginx \
246 --group=nginx \
247 --with-http_perl_module \
2ee780b1 248 --without-mail_pop3_module \
249 --without-mail_imap_module \
250 --without-mail_smtp_module \
056acc18 251 %{?with_addition:--with-http_addition_module} \
252 %{?with_dav:--with-http_dav_module} \
253 %{?with_flv:--with-http_flv_module} \
3d4bad81 254 %{?with_ipv6:--with-ipv6} \
d6fc4b09 255 %{?with_sub:--with-http_sub_module} \
056acc18 256 %{?with_poll:--with-poll_module} \
257 %{?with_realip:--with-http_realip_module} \
258 %{?with_rtsig:--with-rtsig_module} \
259 %{?with_select:--with-select_module} \
260 %{?with_status:--with-http_stub_status_module} \
261 %{?with_ssl:--with-http_ssl_module} \
262 %{!?with_http_browser:--without-http_browser_module} \
fb649fe5 263 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
4e61eac8 264 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
265 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
266 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
056acc18 267 --with-cc="%{__cc}" \
268 --with-cc-opt="%{rpmcflags}" \
269 --with-ld-opt="%{rpmldflags}"
270%{__make}
4e61eac8 271mv -f objs/nginx contrib/nginx-perl
d6fc4b09 272mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs
273mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
274mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
056acc18 275%endif
276
277%if %{with mail}
056acc18 278./configure \
279 --prefix=%{_prefix} \
4e61eac8 280 --sbin-path=%{_sbindir}/%{name}-mail \
281 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
282 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
283 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
284 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
285 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
056acc18 286 --user=nginx \
287 --group=nginx \
288 --with-imap \
289 --with-mail \
290 --with-mail_ssl_module \
d6fc4b09 291 --without-http \
129a70a2 292 %{?with_ipv6:--with-ipv6} \
056acc18 293 %{?with_poll:--with-poll_module} \
056acc18 294 %{?with_rtsig:--with-rtsig_module} \
295 %{?with_select:--with-select_module} \
4e61eac8 296 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
297 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
298 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
056acc18 299 --with-cc="%{__cc}" \
300 --with-cc-opt="%{rpmcflags}" \
301 --with-ld-opt="%{rpmldflags}" \
302 %{?debug:--with-debug}
303%{__make}
4e61eac8 304mv -f objs/nginx contrib/nginx-mail
056acc18 305%endif
306
307%if %{with light}
056acc18 308./configure \
309 --prefix=%{_prefix} \
4e61eac8 310 --sbin-path=%{_sbindir}/%{name}-light \
311 --conf-path=%{_sysconfdir}/%{name}-light.conf \
312 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
313 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
314 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
315 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
056acc18 316 --user=nginx \
317 --group=nginx \
129a70a2 318 %{?with_ipv6:--with-ipv6} \
056acc18 319 %{?with_poll:--with-poll_module} \
320 %{?with_realip:--with-http_realip_module} \
321 %{?with_rtsig:--with-rtsig_module} \
322 %{?with_select:--with-select_module} \
323 %{?with_status:--with-http_stub_status_module} \
324 %{?with_ssl:--with-http_ssl_module} \
fb649fe5 325 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
056acc18 326 --without-http_browser_module \
1a62642d 327 --without-mail_pop3_module \
328 --without-mail_imap_module \
329 --without-mail_smtp_module \
4e61eac8 330 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
331 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
332 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
056acc18 333 --with-cc="%{__cc}" \
334 --with-cc-opt="%{rpmcflags}" \
335 --with-ld-opt="%{rpmldflags}" \
336 %{?debug:--with-debug}
337%{__make}
4e61eac8 338mv -f objs/nginx contrib/nginx-light
056acc18 339%endif
340
f9e65082
ER
341./configure \
342 --prefix=%{_prefix} \
226bcc40 343 --sbin-path=%{_sbindir}/%{name}-standard \
f1686a52 344 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
226bcc40 345 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
346 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
347 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
348 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
dfef7372
ER
349 --user=nginx \
350 --group=nginx \
d0c0492d 351 %{?with_addition:--with-http_addition_module} \
352 %{?with_dav:--with-http_dav_module} \
353 %{?with_flv:--with-http_flv_module} \
129a70a2 354 %{?with_ipv6:--with-ipv6} \
d6fc4b09 355 %{?with_sub:--with-http_sub_module} \
d0c0492d 356 %{?with_poll:--with-poll_module} \
357 %{?with_realip:--with-http_realip_module} \
362f5ab2 358 %{?with_rtsig:--with-rtsig_module} \
359 %{?with_select:--with-select_module} \
d0c0492d 360 %{?with_status:--with-http_stub_status_module} \
362f5ab2 361 %{?with_ssl:--with-http_ssl_module} \
ee4f2132 362 %{!?with_http_browser:--without-http_browser_module} \
fb649fe5 363 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
226bcc40 364 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
365 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
366 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
f9e65082
ER
367 --with-cc="%{__cc}" \
368 --with-cc-opt="%{rpmcflags}" \
369 --with-ld-opt="%{rpmldflags}" \
370 %{?debug:--with-debug}
f9e65082
ER
371%{__make}
372
056acc18 373
f9e65082
ER
374%install
375rm -rf $RPM_BUILD_ROOT
362f5ab2 376install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
377 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
4e61eac8 378 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
226bcc40 379 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
380 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
36b3be34 381 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
d323480a 382 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
599f35f0 383 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
f9e65082 384
7d80c773 385install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
0bc43776
JK
386install conf/scgi_params $RPM_BUILD_ROOT%{_sysconfdir}/scgi.params
387install conf/uwsgi_params $RPM_BUILD_ROOT%{_sysconfdir}/uwsgi.params
57f21172 388install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
389install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
390install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
cd728db7 391install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
392install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
226bcc40 393install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
394install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
395install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
396install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
0da077af 397install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
398install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
399install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
d323480a 400install %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
de0bfb9b 401install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
599f35f0 402ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
85600569 403
404%if %{with light}
226bcc40 405install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
406install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
0da077af 407install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
d323480a 408install %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
4e61eac8 409install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
85600569 410%endif
411
412%if %{with mail}
0da077af 413install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
414install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
415install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
d323480a 416install %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
4e61eac8 417install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
85600569 418%endif
419
420%if %{with perl}
421install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
0da077af 422install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
423install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
424install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
d323480a 425install %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
d6fc4b09 426install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
427install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
428install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
4e61eac8 429install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
85600569 430%endif
f9e65082
ER
431
432rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
433rm -rf $RPM_BUILD_ROOT%{_prefix}/html
434
435%clean
436rm -rf $RPM_BUILD_ROOT
437
b0fa7cc6 438%pre
a37373c3 439%groupadd -r -g 213 %{name}
362f5ab2 440%groupadd -g 51 http
a37373c3 441%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 442%addusertogroup %{name} http
f1fc9780 443
738166d2 444%post standard
445for a in access.log error.log; do
446 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
98376457 447 umask 022
738166d2 448 touch /var/log/%{name}/nginx-standard_$a
1cf92547 449 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
738166d2 450 chmod 644 /var/log/%{name}/nginx-standard_$a
451 fi
452done
3d760264 453/sbin/chkconfig --add %{name}-standard
d323480a 454%systemd_post %{name}-standard.service
3d760264 455%service %{name}-standard restart
a20d2702 456echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
599f35f0
JK
457if ! [ -L /etc/systemd/system/nginx.service ] ; then
458 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
459fi
738166d2 460
461%post light
462for a in access.log error.log; do
463 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
98376457 464 umask 022
738166d2 465 touch /var/log/%{name}/nginx-light_$a
466 chown nginx:nginx /var/log/%{name}/nginx-light_$a
467 chmod 644 /var/log/%{name}/nginx-light_$a
468 fi
469done
3d760264 470/sbin/chkconfig --add %{name}-light
d323480a 471%systemd_post %{name}-light.service
3d760264 472%service %{name}-light restart
a20d2702 473echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
738166d2 474
475%post perl
476for a in access.log error.log; do
477 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
98376457 478 umask 022
738166d2 479 touch /var/log/%{name}/nginx-perl_$a
480 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
481 chmod 644 /var/log/%{name}/nginx-perl_$a
482 fi
483done
3d760264 484/sbin/chkconfig --add %{name}-perl
d323480a 485%systemd_post %{name}-perl.service
3d760264 486%service %{name}-perl restart
a20d2702 487echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
738166d2 488
489%post mail
362f5ab2 490for a in access.log error.log; do
738166d2 491 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
98376457 492 umask 022
738166d2 493 touch /var/log/%{name}/nginx-mail_$a
494 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
495 chmod 644 /var/log/%{name}/nginx-mail_$a
362f5ab2 496 fi
497done
3d760264 498/sbin/chkconfig --add %{name}-mail
d323480a 499%systemd_post %{name}-mail.service
3d760264 500%service %{name}-mail restart
a20d2702 501echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
f9e65082 502
b0fa7cc6 503%preun standard
7d80c773 504if [ "$1" = "0" ];then
6eef4074 505 %service %{name}-standard stop
226bcc40 506 /sbin/chkconfig --del %{name}-standard
f9e65082 507fi
d323480a 508%systemd_preun %{name}-standard.service
f9e65082 509
0663f9da 510%preun light
511if [ "$1" = "0" ]; then
6eef4074 512 %service %{name}-light stop
226bcc40 513 /sbin/chkconfig --del %{name}-light
0663f9da 514fi
d323480a 515%systemd_preun %{name}-light.service
0663f9da 516
517%preun perl
518if [ "$1" = "0" ]; then
6eef4074 519 %service %{name}-perl stop
226bcc40 520 /sbin/chkconfig --del %{name}-perl
0663f9da 521fi
d323480a 522%systemd_preun %{name}-perl.service
0663f9da 523
524%preun mail
525if [ "$1" = "0" ]; then
6eef4074 526 %service %{name}-mail stop
226bcc40 527 /sbin/chkconfig --del %{name}-mail
0663f9da 528fi
d323480a 529%systemd_preun %{name}-mail.service
0663f9da 530
b0fa7cc6 531%postun
f1fc9780 532if [ "$1" = "0" ]; then
7d9b86c7
ER
533 %userremove %{name}
534 %groupremove %{name}
f1fc9780 535fi
536
d323480a
JK
537%postun standard
538%systemd_reload
539
540%postun light
541%systemd_reload
542
543%postun perl
544%systemd_reload
545
546%postun mail
547%systemd_reload
548
549%triggerpostun -- %{name}-standard < 1.4.1-4
550%systemd_trigger %{name}-standard.service
551
552%triggerpostun -- %{name}-light < 1.4.1-4
553%systemd_trigger %{name}-light.service
554
555%triggerpostun -- %{name}-perl < 1.4.1-4
556%systemd_trigger %{name}-perl.service
557
558%triggerpostun -- %{name}-mail < 1.4.1-4
559%systemd_trigger %{name}-mail.service
560
f9e65082
ER
561%files
562%defattr(644,root,root,755)
6f8318ed 563%doc CHANGES LICENSE README html/index.html conf/nginx.conf
f9e65082 564%doc %lang(ru) CHANGES.ru
f1fc9780 565%dir %attr(754,root,root) %{_sysconfdir}
164ab75d 566%dir %{_nginxdir}
567%dir %{_nginxdir}/cgi-bin
568%dir %{_nginxdir}/html
569%dir %{_nginxdir}/errors
28a25161 570%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
98376457 571# XXX: duplicates, don't use such glob here
57f21172 572#%attr(640,root,root) %{_sysconfdir}/*[_-]*
98376457 573%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
394dc7b0 574%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
0bc43776
JK
575%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi.params
576%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi.params
f1fc9780 577%attr(640,root,root) %{_sysconfdir}/mime.types
57f21172 578%attr(640,root,root) %{_sysconfdir}/koi-utf
579%attr(640,root,root) %{_sysconfdir}/koi-win
580%attr(640,root,root) %{_sysconfdir}/win-utf
36b3be34
JK
581%dir %{_sysconfdir}/webapps.d
582%dir %{_sysconfdir}/vhosts.d
debe6eba
JR
583%attr(750,nginx,logs) %dir /var/log/archive/%{name}
584%attr(750,nginx,logs) /var/log/%{name}
475fecd1 585%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
cd728db7 586%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
599f35f0 587%ghost /etc/systemd/system/nginx.service
28a25161 588
b0fa7cc6 589%files standard
590%defattr(644,root,root,755)
de0bfb9b 591%attr(755,root,root) %{_sbindir}/%{name}-standard
1846cd14 592%attr(770,root,%{name}) /var/cache/%{name}-standard
0da077af 593%attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
4ddbebd7 594%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
d323480a 595%{systemdunitdir}/%{name}-standard.service
b0fa7cc6 596
85600569 597%if %{with mail}
598%files mail
599%defattr(644,root,root,755)
4e61eac8 600%attr(755,root,root) %{_sbindir}/%{name}-mail
1846cd14 601%attr(770,root,%{name}) /var/cache/%{name}-mail
0da077af 602%attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
4ddbebd7 603%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
d323480a 604%{systemdunitdir}/%{name}-mail.service
85600569 605%endif
606
607%if %{with light}
608%files light
609%defattr(644,root,root,755)
4e61eac8 610%attr(755,root,root) %{_sbindir}/%{name}-light
1846cd14 611%attr(770,root,%{name}) /var/cache/%{name}-light
0da077af 612%attr(754,root,root) /etc/rc.d/init.d/%{name}-light
4ddbebd7 613%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
d323480a 614%{systemdunitdir}/%{name}-light.service
85600569 615%endif
616
617%if %{with perl}
618%files perl
619%defattr(644,root,root,755)
4e61eac8 620%attr(755,root,root) %{_sbindir}/%{name}-perl
0da077af 621%attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
f7b57295 622%attr(770,root,%{name}) /var/cache/%{name}-perl
1846cd14 623%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
85600569 624%dir %{perl_vendorarch}/auto/%{name}
625%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
98376457
JB
626%{perl_vendorarch}/auto/%{name}/%{name}.bs
627%{perl_vendorarch}/%{name}.pm
d323480a 628%{systemdunitdir}/%{name}-perl.service
dd7459ac 629%endif
630
631%files -n monit-rc-nginx
632%defattr(644,root,root,755)
633%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
634%if %{with perl}
1846cd14 635%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
85600569 636%endif
dd7459ac 637%if %{with light}
638%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
639%endif
640%if %{with mail}
641%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
642%endif
This page took 1.204625 seconds and 4 git commands to generate.