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