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