]>
Commit | Line | Data |
---|---|---|
f9e65082 ER |
1 | # TODO |
2 | # - bconds for modules as these are statically linked in | |
f1fc9780 | 3 | # - logrotate script |
4 | ||
5 | %bcond_with initscript # initscript | |
6 | ||
8e1389c7 | 7 | Summary: High perfomance HTTP and reverse proxy server |
185313bb | 8 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
f9e65082 | 9 | Name: nginx |
f1fc9780 | 10 | Version: 0.5.14 |
11 | Release: 0.1 | |
51ef519b | 12 | License: BSD-like |
f9e65082 | 13 | Group: Applications |
f1fc9780 | 14 | Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz |
15 | # Source0-md5: 3415c2b49b66fae5b11ca348ec0c2605 | |
16 | Source1: %{name}.init | |
17 | Patch0: %{name}-config.patch | |
51ef519b | 18 | URL: http://nginx.net/ |
f1fc9780 | 19 | Requires(post,preun): /sbin/chkconfig |
20 | Requires(postun): /usr/sbin/groupdel | |
21 | Requires(postun): /usr/sbin/userdel | |
22 | Requires(pre): /bin/id | |
23 | Requires(pre): /usr/bin/getgid | |
24 | Requires(pre): /usr/sbin/groupadd | |
25 | Requires(pre): /usr/sbin/useradd | |
f9e65082 ER |
26 | %if %{with initscript} |
27 | BuildRequires: rpmbuild(macros) >= 1.228 | |
f9e65082 | 28 | Requires(post,preun): /sbin/chkconfig |
f1fc9780 | 29 | Requires(post,preun): rc-scripts |
f9e65082 | 30 | %endif |
f9e65082 | 31 | BuildRequires: openssl-devel |
f1fc9780 | 32 | BuildRequires: pcre-devel |
f9e65082 ER |
33 | BuildRequires: zlib-devel |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %define _sysconfdir /etc/%{name} | |
37 | ||
38 | %description | |
8e1389c7 JB |
39 | High perfomance HTTP and reverse proxy server. |
40 | ||
390f5b88 JR |
41 | %description -l pl.UTF-8 |
42 | Serwer HTTP i odwrotne proxy o wysokiej wydajności. | |
f9e65082 ER |
43 | |
44 | %prep | |
45 | %setup -q | |
f1fc9780 | 46 | %patch0 -p0 |
f9e65082 ER |
47 | |
48 | %build | |
49 | # NB: not autoconf generated configure | |
50 | ./configure \ | |
51 | --prefix=%{_prefix} \ | |
52 | --sbin-path=%{_sbindir}/%{name} \ | |
53 | --conf-path=%{_sysconfdir}/%{name}.conf \ | |
54 | --error-log-path=%{_localstatedir}/log/%{name}/error.log \ | |
55 | --pid-path=%{_localstatedir}/run/%{name}.pid \ | |
56 | --user=nobody \ | |
57 | --group=nobody \ | |
f9e65082 ER |
58 | --with-rtsig_module \ |
59 | --with-select_module \ | |
60 | --with-poll_module \ | |
61 | --with-http_ssl_module \ | |
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} |
79 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
057a558d | 80 | |
f1fc9780 | 81 | install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name} |
f9e65082 ER |
82 | |
83 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default | |
84 | rm -rf $RPM_BUILD_ROOT%{_prefix}/html | |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
f1fc9780 | 89 | %pre |
90 | %groupadd -r -g 212 %{name} | |
91 | %useradd -r -u 212 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name} | |
92 | ||
f9e65082 ER |
93 | %if %{with initscript} |
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 | |
103 | %endif | |
104 | ||
f1fc9780 | 105 | %postun |
106 | if [ "$1" = "0" ]; then | |
107 | %userremove %{name} | |
108 | %groupremove %{name} | |
109 | fi | |
110 | ||
111 | ||
f9e65082 ER |
112 | %files |
113 | %defattr(644,root,root,755) | |
114 | %doc CHANGES LICENSE README html/index.html conf/nginx.conf | |
115 | %doc %lang(ru) CHANGES.ru | |
f1fc9780 | 116 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
117 | %dir %attr(754,root,root) %{_sysconfdir} | |
118 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf | |
119 | %attr(640,root,root) %{_sysconfdir}/*[_-]* | |
120 | %attr(640,root,root) %{_sysconfdir}/mime.types | |
121 | %attr(755,root,root) %{_sbindir}/%{name} | |
122 | %attr(770,root,%{name}) /var/cache/%{name} | |
123 | %attr(750,%{name},logs) /var/log/%{name} |