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