]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
- up to 0.5.32
[packages/nginx.git] / nginx.spec
CommitLineData
f9e65082 1# TODO
ee4f2132 2# - /etc/sysconfig/nginx file
d0c0492d 3# - prepare pld style like nginx.conf
4# - split into nginx-common, nginx, nginx-perl packages
ee4f2132 5#
362f5ab2 6# Conditional build for nginx:
d0c0492d 7%bcond_without addition # adds module
8%bcond_without dav # WebDAV
9%bcond_without flv # FLV stream
10%bcond_without imap # imap proxy
11%bcond_without mail # mail module
12%bcond_without perl # perl module
13%bcond_without poll # poll
14%bcond_without realip # real ip (behind proxy)
15%bcond_without rtsig # rtsig
16%bcond_without select # select
17%bcond_without status # stats module
18%bcond_without ssl # ssl support
ee4f2132 19%bcond_with http_browser # header "User-agent" parser
362f5ab2 20#
8e1389c7 21Summary: High perfomance HTTP and reverse proxy server
185313bb 22Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
f9e65082 23Name: nginx
908548b4 24Version: 0.5.32
25Release: 0.1
51ef519b 26License: BSD-like
7d9b86c7 27Group: Networking/Daemons
f1fc9780 28Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
908548b4 29# Source0-md5: 0088269b8a59a146b0ba9c9ee29853bb
f1fc9780 30Source1: %{name}.init
dfef7372 31Source2: %{name}-mime.types.sh
362f5ab2 32Source3: http://www.nginx.eu/favicon.ico
33# Source3-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
34Source4: http://www.nginx.eu/download/proxy.conf
35# Source4-md5: f5263ae01c2edb18f46d5d1df2d3a5cd
894ff1f7 36Source5: http://www.nginx.eu/download/%{name}.monitrc
362f5ab2 37# Source5-md5: 1d3f5eedfd34fe95213f9e0fc19daa88
894ff1f7 38Source6: http://www.nginx.eu/download/%{name}.conf
362f5ab2 39# Source6-md5: 1c112d6f03d0f365e4acc98c1d96261a
28a25161 40Source7: %{name}.logrotate
f1fc9780 41Patch0: %{name}-config.patch
51ef519b 42URL: http://nginx.net/
dfef7372 43BuildRequires: mailcap
f9e65082 44BuildRequires: openssl-devel
f1fc9780 45BuildRequires: pcre-devel
d0c0492d 46%{?with_perl:BuildRequires: perl-devel}
7d9b86c7 47BuildRequires: rpmbuild(macros) >= 1.268
f9e65082 48BuildRequires: zlib-devel
7d9b86c7
ER
49Requires(post,preun): /sbin/chkconfig
50Requires(postun): /usr/sbin/groupdel
51Requires(postun): /usr/sbin/userdel
52Requires(pre): /bin/id
53Requires(pre): /usr/bin/getgid
54Requires(pre): /usr/sbin/groupadd
55Requires(pre): /usr/sbin/useradd
d0c0492d 56Requires: openssl
57Requires: pcre
aba2d783 58Requires: rc-scripts >= 0.2.0
d0c0492d 59Requires: zlib
ee547c00 60Provides: group(http)
61Provides: group(nginx)
62Provides: user(nginx)
7ffe7917 63Provides: webserver
2d747e44 64Conflicts: logrotate < 3.7-4
f9e65082
ER
65BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
362f5ab2 67%define _sysconfdir /etc/%{name}
68%define _nginxdir /home/services/%{name}
f9e65082
ER
69
70%description
894ff1f7
ER
71Nginx ("engine x") is a high-performance HTTP server and reverse
72proxy, as well as an IMAP/POP3 proxy server. Nginx was written by Igor
73Sysoev for Rambler.ru, Russia's second-most visited website, where it
74has been running in production for over two and a half years. Igor has
75released the source code under a BSD-like license. Although still in
76beta, Nginx is known for its stability, rich feature set, simple
77configuration, and low resource consumption.
8e1389c7 78
390f5b88
JR
79%description -l pl.UTF-8
80Serwer HTTP i odwrotne proxy o wysokiej wydajności.
f9e65082 81
d0c0492d 82#%package common
83#Summary: Configuration files and documentation for Nginx
84#Summary(pl.UTF-8): Pliki konfiguracyjne i dokumentacja dla Nginx
85#Group: Networking/Daemons
28a25161 86
87%package -n monit-rc-nginx
88Summary: Nginx support for monit
89Summary(pl.UTF-8): Wsparcie nginx dla monit
90Group: Applications/System
91Requires: %{name} = %{version}-%{release}
92Requires: monit
93
94%description -n monit-rc-nginx
95monitrc file for monitoring nginx webserver server.
96
97%description -n monit-rc-nginx -l pl.UTF-8
ee4f2132 98Plik monitrc do monitorowania serwera www nginx.
28a25161 99
100
f9e65082
ER
101%prep
102%setup -q
f1fc9780 103%patch0 -p0
f9e65082 104
dfef7372
ER
105# build mime.types.conf
106sh %{SOURCE2} /etc/mime.types
107
f9e65082
ER
108%build
109# NB: not autoconf generated configure
110./configure \
111 --prefix=%{_prefix} \
112 --sbin-path=%{_sbindir}/%{name} \
113 --conf-path=%{_sysconfdir}/%{name}.conf \
114 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
115 --pid-path=%{_localstatedir}/run/%{name}.pid \
d0c0492d 116 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
dfef7372
ER
117 --user=nginx \
118 --group=nginx \
d0c0492d 119 %{?with_addition:--with-http_addition_module} \
120 %{?with_dav:--with-http_dav_module} \
121 %{?with_flv:--with-http_flv_module} \
122 %{?with_imap:--with-imap} \
123 %{?with_mail:--with-mail} \
124 %{?with_mail:--with-mail_ssl_module} \
125 %{?with_perl:--with-http_perl_module} \
126 %{?with_poll:--with-poll_module} \
127 %{?with_realip:--with-http_realip_module} \
362f5ab2 128 %{?with_rtsig:--with-rtsig_module} \
129 %{?with_select:--with-select_module} \
d0c0492d 130 %{?with_status:--with-http_stub_status_module} \
362f5ab2 131 %{?with_ssl:--with-http_ssl_module} \
ee4f2132 132 %{!?with_http_browser:--without-http_browser_module} \
f9e65082
ER
133 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
134 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
135 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
136 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
f9e65082
ER
137 --with-cc="%{__cc}" \
138 --with-cc-opt="%{rpmcflags}" \
139 --with-ld-opt="%{rpmldflags}" \
140 %{?debug:--with-debug}
f9e65082
ER
141%{__make}
142
143%install
144rm -rf $RPM_BUILD_ROOT
362f5ab2 145install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
146 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
147 $RPM_BUILD_ROOT{%{_localstatedir}/log/{%{name},archive/%{name}},%{_localstatedir}/cache/%{name}} \
d0c0492d 148 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/%{name} \
28a25161 149 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
d0c0492d 150 $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}} \
28a25161 151 $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
f9e65082 152
f1fc9780 153install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
dfef7372 154install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
f1fc9780 155install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
362f5ab2 156install %{SOURCE3} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
cd728db7 157install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
158install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
362f5ab2 159install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
28a25161 160install %{SOURCE5} $RPM_BUILD_ROOT/etc/monit/%{name}.monitrc
362f5ab2 161install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf
28a25161 162install %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
d0c0492d 163install objs/src/http/modules/perl/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
164install objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
165install objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
f1fc9780 166install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
f9e65082
ER
167
168rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
169rm -rf $RPM_BUILD_ROOT%{_prefix}/html
170
171%clean
172rm -rf $RPM_BUILD_ROOT
173
f1fc9780 174%pre
a37373c3 175%groupadd -r -g 213 %{name}
362f5ab2 176%groupadd -g 51 http
a37373c3 177%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 178%addusertogroup %{name} http
f1fc9780 179
f9e65082 180%post
362f5ab2 181for a in access.log error.log; do
182 if [ ! -f /var/log/%{name}/$a ]; then
183 touch /var/log/%{name}/$a
184 chown nginx:nginx /var/log/%{name}/$a
185 chmod 644 /var/log/%{name}/$a
186 fi
187done
f9e65082
ER
188/sbin/chkconfig --add %{name}
189%service %{name} restart
190
191%preun
192if [ "$1" = "0" ]; then
193 %service -q %{name} stop
194 /sbin/chkconfig --del %{name}
195fi
f9e65082 196
f1fc9780 197%postun
198if [ "$1" = "0" ]; then
7d9b86c7
ER
199 %userremove %{name}
200 %groupremove %{name}
f1fc9780 201fi
202
f9e65082
ER
203%files
204%defattr(644,root,root,755)
d0c0492d 205%doc CHANGES LICENSE README html/index.html conf/nginx.conf objs/src/http/modules/perl/blib/man3/nginx.3pm
f9e65082 206%doc %lang(ru) CHANGES.ru
f1fc9780 207%attr(754,root,root) /etc/rc.d/init.d/%{name}
208%dir %attr(754,root,root) %{_sysconfdir}
164ab75d 209%dir %{_nginxdir}
210%dir %{_nginxdir}/cgi-bin
211%dir %{_nginxdir}/html
212%dir %{_nginxdir}/errors
f1fc9780 213%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
28a25161 214%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
f1fc9780 215%attr(640,root,root) %{_sysconfdir}/*[_-]*
362f5ab2 216%attr(640,root,root) %{_sysconfdir}/proxy.conf
f1fc9780 217%attr(640,root,root) %{_sysconfdir}/mime.types
218%attr(755,root,root) %{_sbindir}/%{name}
d0c0492d 219%dir %{perl_vendorarch}/auto/%{name}
220%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
221%attr(700,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.bs
222%attr(700,root,root) %{perl_vendorarch}/%{name}.pm
f1fc9780 223%attr(770,root,%{name}) /var/cache/%{name}
fb1687bb 224%attr(750,root,root) %dir /var/log/archive/%{name}
f1fc9780 225%attr(750,%{name},logs) /var/log/%{name}
475fecd1 226%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
cd728db7 227%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
28a25161 228
229%files -n monit-rc-nginx
230%defattr(644,root,root,755)
231%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc
This page took 0.107324 seconds and 4 git commands to generate.