]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
The post NOT message improved
[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} \
28a25161 381 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
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
57f21172 386install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
387install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
388install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
cd728db7 389install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
390install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
226bcc40 391install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
392install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
393install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
394install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
0da077af 395install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
396install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
397install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
d323480a 398install %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
de0bfb9b 399install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
599f35f0 400ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
85600569 401
402%if %{with light}
226bcc40 403install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
404install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
0da077af 405install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
d323480a 406install %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
4e61eac8 407install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
85600569 408%endif
409
410%if %{with mail}
0da077af 411install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
412install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
413install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
d323480a 414install %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
4e61eac8 415install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
85600569 416%endif
417
418%if %{with perl}
419install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
0da077af 420install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
421install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
422install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
d323480a 423install %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
d6fc4b09 424install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
425install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
426install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
4e61eac8 427install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
85600569 428%endif
f9e65082
ER
429
430rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
431rm -rf $RPM_BUILD_ROOT%{_prefix}/html
432
433%clean
434rm -rf $RPM_BUILD_ROOT
435
b0fa7cc6 436%pre
a37373c3 437%groupadd -r -g 213 %{name}
362f5ab2 438%groupadd -g 51 http
a37373c3 439%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 440%addusertogroup %{name} http
f1fc9780 441
738166d2 442%post standard
443for a in access.log error.log; do
444 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
98376457 445 umask 022
738166d2 446 touch /var/log/%{name}/nginx-standard_$a
1cf92547 447 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
738166d2 448 chmod 644 /var/log/%{name}/nginx-standard_$a
449 fi
450done
3d760264 451/sbin/chkconfig --add %{name}-standard
d323480a 452%systemd_post %{name}-standard.service
3d760264 453%service %{name}-standard restart
a20d2702 454echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
599f35f0
JK
455if ! [ -L /etc/systemd/system/nginx.service ] ; then
456 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
457fi
738166d2 458
459%post light
460for a in access.log error.log; do
461 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
98376457 462 umask 022
738166d2 463 touch /var/log/%{name}/nginx-light_$a
464 chown nginx:nginx /var/log/%{name}/nginx-light_$a
465 chmod 644 /var/log/%{name}/nginx-light_$a
466 fi
467done
3d760264 468/sbin/chkconfig --add %{name}-light
d323480a 469%systemd_post %{name}-light.service
3d760264 470%service %{name}-light restart
a20d2702 471echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
738166d2 472
473%post perl
474for a in access.log error.log; do
475 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
98376457 476 umask 022
738166d2 477 touch /var/log/%{name}/nginx-perl_$a
478 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
479 chmod 644 /var/log/%{name}/nginx-perl_$a
480 fi
481done
3d760264 482/sbin/chkconfig --add %{name}-perl
d323480a 483%systemd_post %{name}-perl.service
3d760264 484%service %{name}-perl restart
a20d2702 485echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
738166d2 486
487%post mail
362f5ab2 488for a in access.log error.log; do
738166d2 489 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
98376457 490 umask 022
738166d2 491 touch /var/log/%{name}/nginx-mail_$a
492 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
493 chmod 644 /var/log/%{name}/nginx-mail_$a
362f5ab2 494 fi
495done
3d760264 496/sbin/chkconfig --add %{name}-mail
d323480a 497%systemd_post %{name}-mail.service
3d760264 498%service %{name}-mail restart
a20d2702 499echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
f9e65082 500
b0fa7cc6 501%preun standard
7d80c773 502if [ "$1" = "0" ];then
6eef4074 503 %service %{name}-standard stop
226bcc40 504 /sbin/chkconfig --del %{name}-standard
f9e65082 505fi
d323480a 506%systemd_preun %{name}-standard.service
f9e65082 507
0663f9da 508%preun light
509if [ "$1" = "0" ]; then
6eef4074 510 %service %{name}-light stop
226bcc40 511 /sbin/chkconfig --del %{name}-light
0663f9da 512fi
d323480a 513%systemd_preun %{name}-light.service
0663f9da 514
515%preun perl
516if [ "$1" = "0" ]; then
6eef4074 517 %service %{name}-perl stop
226bcc40 518 /sbin/chkconfig --del %{name}-perl
0663f9da 519fi
d323480a 520%systemd_preun %{name}-perl.service
0663f9da 521
522%preun mail
523if [ "$1" = "0" ]; then
6eef4074 524 %service %{name}-mail stop
226bcc40 525 /sbin/chkconfig --del %{name}-mail
0663f9da 526fi
d323480a 527%systemd_preun %{name}-mail.service
0663f9da 528
b0fa7cc6 529%postun
f1fc9780 530if [ "$1" = "0" ]; then
7d9b86c7
ER
531 %userremove %{name}
532 %groupremove %{name}
f1fc9780 533fi
534
d323480a
JK
535%postun standard
536%systemd_reload
537
538%postun light
539%systemd_reload
540
541%postun perl
542%systemd_reload
543
544%postun mail
545%systemd_reload
546
547%triggerpostun -- %{name}-standard < 1.4.1-4
548%systemd_trigger %{name}-standard.service
549
550%triggerpostun -- %{name}-light < 1.4.1-4
551%systemd_trigger %{name}-light.service
552
553%triggerpostun -- %{name}-perl < 1.4.1-4
554%systemd_trigger %{name}-perl.service
555
556%triggerpostun -- %{name}-mail < 1.4.1-4
557%systemd_trigger %{name}-mail.service
558
f9e65082
ER
559%files
560%defattr(644,root,root,755)
6f8318ed 561%doc CHANGES LICENSE README html/index.html conf/nginx.conf
f9e65082 562%doc %lang(ru) CHANGES.ru
f1fc9780 563%dir %attr(754,root,root) %{_sysconfdir}
164ab75d 564%dir %{_nginxdir}
565%dir %{_nginxdir}/cgi-bin
566%dir %{_nginxdir}/html
567%dir %{_nginxdir}/errors
28a25161 568%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
98376457 569# XXX: duplicates, don't use such glob here
57f21172 570#%attr(640,root,root) %{_sysconfdir}/*[_-]*
98376457 571%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
394dc7b0 572%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
f1fc9780 573%attr(640,root,root) %{_sysconfdir}/mime.types
57f21172 574%attr(640,root,root) %{_sysconfdir}/koi-utf
575%attr(640,root,root) %{_sysconfdir}/koi-win
576%attr(640,root,root) %{_sysconfdir}/win-utf
debe6eba
JR
577%attr(750,nginx,logs) %dir /var/log/archive/%{name}
578%attr(750,nginx,logs) /var/log/%{name}
475fecd1 579%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
cd728db7 580%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
599f35f0 581%ghost /etc/systemd/system/nginx.service
28a25161 582
b0fa7cc6 583%files standard
584%defattr(644,root,root,755)
de0bfb9b 585%attr(755,root,root) %{_sbindir}/%{name}-standard
1846cd14 586%attr(770,root,%{name}) /var/cache/%{name}-standard
0da077af 587%attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
4ddbebd7 588%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
d323480a 589%{systemdunitdir}/%{name}-standard.service
b0fa7cc6 590
85600569 591%if %{with mail}
592%files mail
593%defattr(644,root,root,755)
4e61eac8 594%attr(755,root,root) %{_sbindir}/%{name}-mail
1846cd14 595%attr(770,root,%{name}) /var/cache/%{name}-mail
0da077af 596%attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
4ddbebd7 597%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
d323480a 598%{systemdunitdir}/%{name}-mail.service
85600569 599%endif
600
601%if %{with light}
602%files light
603%defattr(644,root,root,755)
4e61eac8 604%attr(755,root,root) %{_sbindir}/%{name}-light
1846cd14 605%attr(770,root,%{name}) /var/cache/%{name}-light
0da077af 606%attr(754,root,root) /etc/rc.d/init.d/%{name}-light
4ddbebd7 607%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
d323480a 608%{systemdunitdir}/%{name}-light.service
85600569 609%endif
610
611%if %{with perl}
612%files perl
613%defattr(644,root,root,755)
4e61eac8 614%attr(755,root,root) %{_sbindir}/%{name}-perl
0da077af 615%attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
f7b57295 616%attr(770,root,%{name}) /var/cache/%{name}-perl
1846cd14 617%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
85600569 618%dir %{perl_vendorarch}/auto/%{name}
619%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
98376457
JB
620%{perl_vendorarch}/auto/%{name}/%{name}.bs
621%{perl_vendorarch}/%{name}.pm
d323480a 622%{systemdunitdir}/%{name}-perl.service
dd7459ac 623%endif
624
625%files -n monit-rc-nginx
626%defattr(644,root,root,755)
627%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
628%if %{with perl}
1846cd14 629%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
85600569 630%endif
dd7459ac 631%if %{with light}
632%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
633%endif
634%if %{with mail}
635%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
636%endif
This page took 3.241865 seconds and 4 git commands to generate.