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