]>
Commit | Line | Data |
---|---|---|
f9e65082 | 1 | # TODO |
f1fc9780 | 2 | # - logrotate script |
362f5ab2 | 3 | # - more bconds (??) |
4 | # - subpackage with error pages | |
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 | 14 | Summary: High perfomance HTTP and reverse proxy server |
185313bb | 15 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
f9e65082 | 16 | Name: nginx |
22019997 | 17 | Version: 0.5.31 |
362f5ab2 | 18 | Release: 0.1 |
51ef519b | 19 | License: BSD-like |
7d9b86c7 | 20 | Group: Networking/Daemons |
f1fc9780 | 21 | Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz |
22019997 | 22 | # Source0-md5: d84ef8e624b8953faf9cee2b5da535c1 |
f1fc9780 | 23 | Source1: %{name}.init |
dfef7372 | 24 | Source2: %{name}-mime.types.sh |
362f5ab2 | 25 | Source3: http://www.nginx.eu/favicon.ico |
26 | # Source3-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab | |
27 | Source4: http://www.nginx.eu/download/proxy.conf | |
28 | # Source4-md5: f5263ae01c2edb18f46d5d1df2d3a5cd | |
29 | Source5: http://www.nginx.eu/download/nginx.monitrc | |
30 | # Source5-md5: 1d3f5eedfd34fe95213f9e0fc19daa88 | |
31 | Source6: http://www.nginx.eu/download/nginx.conf | |
32 | # Source6-md5: 1c112d6f03d0f365e4acc98c1d96261a | |
f1fc9780 | 33 | Patch0: %{name}-config.patch |
51ef519b | 34 | URL: http://nginx.net/ |
dfef7372 | 35 | BuildRequires: mailcap |
f9e65082 | 36 | BuildRequires: openssl-devel |
f1fc9780 | 37 | BuildRequires: pcre-devel |
7d9b86c7 | 38 | BuildRequires: rpmbuild(macros) >= 1.268 |
f9e65082 | 39 | BuildRequires: zlib-devel |
7d9b86c7 ER |
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 | |
f9e65082 ER |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
362f5ab2 | 50 | %define _sysconfdir /etc/%{name} |
51 | %define _nginxdir /home/services/%{name} | |
f9e65082 ER |
52 | |
53 | %description | |
8e1389c7 JB |
54 | High perfomance HTTP and reverse proxy server. |
55 | ||
390f5b88 JR |
56 | %description -l pl.UTF-8 |
57 | Serwer HTTP i odwrotne proxy o wysokiej wydajności. | |
f9e65082 ER |
58 | |
59 | %prep | |
60 | %setup -q | |
f1fc9780 | 61 | %patch0 -p0 |
f9e65082 | 62 | |
dfef7372 ER |
63 | # build mime.types.conf |
64 | sh %{SOURCE2} /etc/mime.types | |
65 | ||
f9e65082 ER |
66 | %build |
67 | # NB: not autoconf generated configure | |
68 | ./configure \ | |
69 | --prefix=%{_prefix} \ | |
70 | --sbin-path=%{_sbindir}/%{name} \ | |
71 | --conf-path=%{_sysconfdir}/%{name}.conf \ | |
72 | --error-log-path=%{_localstatedir}/log/%{name}/error.log \ | |
73 | --pid-path=%{_localstatedir}/run/%{name}.pid \ | |
dfef7372 ER |
74 | --user=nginx \ |
75 | --group=nginx \ | |
362f5ab2 | 76 | %{?with_stub_status:--with-http_stub_status_module} \ |
77 | %{?with_rtsig:--with-rtsig_module} \ | |
78 | %{?with_select:--with-select_module} \ | |
79 | %{?with_poll:--with-poll_module} \ | |
80 | %{?with_ssl:--with-http_ssl_module} \ | |
81 | %{?with_imap:--with-imap} \ | |
82 | %{?with_http_browser:--without-http_browser_module} \ | |
f9e65082 ER |
83 | --http-log-path=%{_localstatedir}/log/%{name}/access.log \ |
84 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \ | |
85 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \ | |
86 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \ | |
f9e65082 ER |
87 | --with-cc="%{__cc}" \ |
88 | --with-cc-opt="%{rpmcflags}" \ | |
89 | --with-ld-opt="%{rpmldflags}" \ | |
90 | %{?debug:--with-debug} | |
91 | ||
92 | %{__make} | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
362f5ab2 | 96 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \ |
97 | $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \ | |
98 | $RPM_BUILD_ROOT{%{_localstatedir}/log/{%{name},archive/%{name}},%{_localstatedir}/cache/%{name}} \ | |
99 | $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} | |
f9e65082 | 100 | |
f1fc9780 | 101 | install conf/* $RPM_BUILD_ROOT%{_sysconfdir} |
dfef7372 | 102 | install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types |
f1fc9780 | 103 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
362f5ab2 | 104 | install %{SOURCE3} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico |
105 | install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf | |
106 | install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.monitrc | |
107 | install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf | |
057a558d | 108 | |
f1fc9780 | 109 | install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name} |
f9e65082 ER |
110 | |
111 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default | |
112 | rm -rf $RPM_BUILD_ROOT%{_prefix}/html | |
113 | ||
114 | %clean | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
f1fc9780 | 117 | %pre |
a37373c3 | 118 | %groupadd -r -g 213 %{name} |
362f5ab2 | 119 | %groupadd -g 51 http |
a37373c3 | 120 | %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name} |
362f5ab2 | 121 | %addusertogroup %{name} http |
f1fc9780 | 122 | |
f9e65082 | 123 | %post |
362f5ab2 | 124 | for a in access.log error.log; do |
125 | if [ ! -f /var/log/%{name}/$a ]; then | |
126 | touch /var/log/%{name}/$a | |
127 | chown nginx:nginx /var/log/%{name}/$a | |
128 | chmod 644 /var/log/%{name}/$a | |
129 | fi | |
130 | done | |
f9e65082 ER |
131 | /sbin/chkconfig --add %{name} |
132 | %service %{name} restart | |
133 | ||
134 | %preun | |
135 | if [ "$1" = "0" ]; then | |
136 | %service -q %{name} stop | |
137 | /sbin/chkconfig --del %{name} | |
138 | fi | |
f9e65082 | 139 | |
f1fc9780 | 140 | %postun |
141 | if [ "$1" = "0" ]; then | |
7d9b86c7 ER |
142 | %userremove %{name} |
143 | %groupremove %{name} | |
f1fc9780 | 144 | fi |
145 | ||
f9e65082 ER |
146 | %files |
147 | %defattr(644,root,root,755) | |
148 | %doc CHANGES LICENSE README html/index.html conf/nginx.conf | |
149 | %doc %lang(ru) CHANGES.ru | |
f1fc9780 | 150 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
151 | %dir %attr(754,root,root) %{_sysconfdir} | |
164ab75d | 152 | %dir %{_nginxdir} |
153 | %dir %{_nginxdir}/cgi-bin | |
154 | %dir %{_nginxdir}/html | |
155 | %dir %{_nginxdir}/errors | |
f1fc9780 | 156 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf |
157 | %attr(640,root,root) %{_sysconfdir}/*[_-]* | |
362f5ab2 | 158 | %attr(640,root,root) %{_sysconfdir}/proxy.conf |
159 | %attr(640,root,root) %{_sysconfdir}/nginx.monitrc | |
f1fc9780 | 160 | %attr(640,root,root) %{_sysconfdir}/mime.types |
161 | %attr(755,root,root) %{_sbindir}/%{name} | |
162 | %attr(770,root,%{name}) /var/cache/%{name} | |
163 | %attr(750,%{name},logs) /var/log/%{name} | |
475fecd1 | 164 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/* |
164ab75d | 165 | #%attr(755,%{name},%{name}) %{_nginxdir}/html/favicon.ico |