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