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