]>
Commit | Line | Data |
---|---|---|
f9e65082 ER |
1 | # TODO |
2 | # - bconds for modules as these are statically linked in | |
f1fc9780 | 3 | # - logrotate script |
8e1389c7 | 4 | Summary: High perfomance HTTP and reverse proxy server |
185313bb | 5 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
f9e65082 | 6 | Name: nginx |
22019997 | 7 | Version: 0.5.31 |
194c908f | 8 | Release: 2 |
51ef519b | 9 | License: BSD-like |
7d9b86c7 | 10 | Group: Networking/Daemons |
f1fc9780 | 11 | Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz |
22019997 | 12 | # Source0-md5: d84ef8e624b8953faf9cee2b5da535c1 |
f1fc9780 | 13 | Source1: %{name}.init |
dfef7372 | 14 | Source2: %{name}-mime.types.sh |
f1fc9780 | 15 | Patch0: %{name}-config.patch |
51ef519b | 16 | URL: http://nginx.net/ |
dfef7372 | 17 | BuildRequires: mailcap |
f9e65082 | 18 | BuildRequires: openssl-devel |
f1fc9780 | 19 | BuildRequires: pcre-devel |
7d9b86c7 | 20 | BuildRequires: rpmbuild(macros) >= 1.268 |
f9e65082 | 21 | BuildRequires: zlib-devel |
7d9b86c7 ER |
22 | Requires(post,preun): /sbin/chkconfig |
23 | Requires(postun): /usr/sbin/groupdel | |
24 | Requires(postun): /usr/sbin/userdel | |
25 | Requires(pre): /bin/id | |
26 | Requires(pre): /usr/bin/getgid | |
27 | Requires(pre): /usr/sbin/groupadd | |
28 | Requires(pre): /usr/sbin/useradd | |
29 | Requires: rc-scripts | |
f9e65082 ER |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %define _sysconfdir /etc/%{name} | |
33 | ||
34 | %description | |
8e1389c7 JB |
35 | High perfomance HTTP and reverse proxy server. |
36 | ||
390f5b88 JR |
37 | %description -l pl.UTF-8 |
38 | Serwer HTTP i odwrotne proxy o wysokiej wydajności. | |
f9e65082 ER |
39 | |
40 | %prep | |
41 | %setup -q | |
f1fc9780 | 42 | %patch0 -p0 |
f9e65082 | 43 | |
dfef7372 ER |
44 | # build mime.types.conf |
45 | sh %{SOURCE2} /etc/mime.types | |
46 | ||
f9e65082 ER |
47 | %build |
48 | # NB: not autoconf generated configure | |
49 | ./configure \ | |
50 | --prefix=%{_prefix} \ | |
51 | --sbin-path=%{_sbindir}/%{name} \ | |
52 | --conf-path=%{_sysconfdir}/%{name}.conf \ | |
53 | --error-log-path=%{_localstatedir}/log/%{name}/error.log \ | |
54 | --pid-path=%{_localstatedir}/run/%{name}.pid \ | |
dfef7372 ER |
55 | --user=nginx \ |
56 | --group=nginx \ | |
f9e65082 ER |
57 | --with-rtsig_module \ |
58 | --with-select_module \ | |
59 | --with-poll_module \ | |
60 | --with-http_ssl_module \ | |
194c908f | 61 | --with-http_stub_status_module \ |
f9e65082 ER |
62 | --http-log-path=%{_localstatedir}/log/%{name}/access.log \ |
63 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \ | |
64 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \ | |
65 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \ | |
66 | --with-imap \ | |
67 | --with-cc="%{__cc}" \ | |
68 | --with-cc-opt="%{rpmcflags}" \ | |
69 | --with-ld-opt="%{rpmldflags}" \ | |
70 | %{?debug:--with-debug} | |
71 | ||
72 | %{__make} | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
f1fc9780 | 76 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sbindir},%{_sysconfdir},/var/{log/%{name},cache/%{name}}} |
f9e65082 | 77 | |
f1fc9780 | 78 | install conf/* $RPM_BUILD_ROOT%{_sysconfdir} |
dfef7372 | 79 | install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types |
f1fc9780 | 80 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
057a558d | 81 | |
f1fc9780 | 82 | install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name} |
f9e65082 ER |
83 | |
84 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default | |
85 | rm -rf $RPM_BUILD_ROOT%{_prefix}/html | |
86 | ||
87 | %clean | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
f1fc9780 | 90 | %pre |
a37373c3 | 91 | %groupadd -r -g 213 %{name} |
92 | %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name} | |
f1fc9780 | 93 | |
f9e65082 ER |
94 | %post |
95 | /sbin/chkconfig --add %{name} | |
96 | %service %{name} restart | |
97 | ||
98 | %preun | |
99 | if [ "$1" = "0" ]; then | |
100 | %service -q %{name} stop | |
101 | /sbin/chkconfig --del %{name} | |
102 | fi | |
f9e65082 | 103 | |
f1fc9780 | 104 | %postun |
105 | if [ "$1" = "0" ]; then | |
7d9b86c7 ER |
106 | %userremove %{name} |
107 | %groupremove %{name} | |
f1fc9780 | 108 | fi |
109 | ||
f9e65082 ER |
110 | %files |
111 | %defattr(644,root,root,755) | |
112 | %doc CHANGES LICENSE README html/index.html conf/nginx.conf | |
113 | %doc %lang(ru) CHANGES.ru | |
f1fc9780 | 114 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
115 | %dir %attr(754,root,root) %{_sysconfdir} | |
116 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf | |
117 | %attr(640,root,root) %{_sysconfdir}/*[_-]* | |
118 | %attr(640,root,root) %{_sysconfdir}/mime.types | |
119 | %attr(755,root,root) %{_sbindir}/%{name} | |
120 | %attr(770,root,%{name}) /var/cache/%{name} | |
121 | %attr(750,%{name},logs) /var/log/%{name} |