]> git.pld-linux.org Git - packages/nginx.git/blob - nginx.spec
0678757ae45ea8adb72545d5cb09dabe7210afbf
[packages/nginx.git] / nginx.spec
1 # TODO
2 # - bconds for modules as these are statically linked in
3 # - logrotate script
4
5 %bcond_with     initscript    # initscript
6
7 Summary:        High perfomance HTTP and reverse proxy server
8 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
9 Name:           nginx
10 Version:        0.5.14
11 Release:        0.1
12 License:        BSD-like
13 Group:          Applications
14 Source0:        http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
15 # Source0-md5:  3415c2b49b66fae5b11ca348ec0c2605
16 Source1:        %{name}.init
17 Patch0:         %{name}-config.patch
18 URL:            http://nginx.net/
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
26 %if %{with initscript}
27 BuildRequires:  rpmbuild(macros) >= 1.228
28 Requires(post,preun):   /sbin/chkconfig
29 Requires(post,preun):   rc-scripts
30 %endif
31 BuildRequires:  openssl-devel
32 BuildRequires:  pcre-devel
33 BuildRequires:  zlib-devel
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define         _sysconfdir /etc/%{name}
37
38 %description
39 High perfomance HTTP and reverse proxy server.
40
41 %description -l pl.UTF-8
42 Serwer HTTP i odwrotne proxy o wysokiej wydajności.
43
44 %prep
45 %setup -q
46 %patch0 -p0
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 \
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
76 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sbindir},%{_sysconfdir},/var/{log/%{name},cache/%{name}}}
77
78 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
79 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
80
81 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
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
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
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
105 %postun
106 if [ "$1" = "0" ]; then
107         %userremove %{name}
108         %groupremove %{name}
109 fi
110
111
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
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}
This page took 0.026884 seconds and 2 git commands to generate.