]> git.pld-linux.org Git - packages/nginx.git/blob - nginx.spec
fa83bae3e999af85897145ce44109e186dc437af
[packages/nginx.git] / nginx.spec
1 # TODO
2 # - bconds for modules as these are statically linked in
3 # - logrotate script
4 Summary:        High perfomance HTTP and reverse proxy server
5 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
6 Name:           nginx
7 Version:        0.5.18
8 Release:        0.1
9 License:        BSD-like
10 Group:          Networking/Daemons
11 Source0:        http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
12 # Source0-md5:  c82a9479e6fc027575377a38405b5df0
13 Source1:        %{name}.init
14 Source2:        %{name}-mime.types.sh
15 Patch0:         %{name}-config.patch
16 URL:            http://nginx.net/
17 BuildRequires:  mailcap
18 BuildRequires:  openssl-devel
19 BuildRequires:  pcre-devel
20 BuildRequires:  rpmbuild(macros) >= 1.268
21 BuildRequires:  zlib-devel
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
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %define         _sysconfdir /etc/%{name}
33
34 %description
35 High perfomance HTTP and reverse proxy server.
36
37 %description -l pl.UTF-8
38 Serwer HTTP i odwrotne proxy o wysokiej wydajności.
39
40 %prep
41 %setup -q
42 %patch0 -p0
43
44 # build mime.types.conf
45 sh %{SOURCE2} /etc/mime.types
46
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 \
55         --user=nginx \
56         --group=nginx \
57         --with-rtsig_module \
58         --with-select_module \
59         --with-poll_module \
60         --with-http_ssl_module \
61         --http-log-path=%{_localstatedir}/log/%{name}/access.log \
62         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
63         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
64         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
65         --with-imap \
66         --with-cc="%{__cc}" \
67         --with-cc-opt="%{rpmcflags}" \
68         --with-ld-opt="%{rpmldflags}" \
69         %{?debug:--with-debug}
70
71 %{__make}
72
73 %install
74 rm -rf $RPM_BUILD_ROOT
75 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sbindir},%{_sysconfdir},/var/{log/%{name},cache/%{name}}}
76
77 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
78 install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
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 213 %{name}
91 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
92
93 %post
94 /sbin/chkconfig --add %{name}
95 %service %{name} restart
96
97 %preun
98 if [ "$1" = "0" ]; then
99         %service -q %{name} stop
100         /sbin/chkconfig --del %{name}
101 fi
102
103 %postun
104 if [ "$1" = "0" ]; then
105         %userremove %{name}
106         %groupremove %{name}
107 fi
108
109 %files
110 %defattr(644,root,root,755)
111 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
112 %doc %lang(ru) CHANGES.ru
113 %attr(754,root,root) /etc/rc.d/init.d/%{name}
114 %dir %attr(754,root,root) %{_sysconfdir}
115 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
116 %attr(640,root,root) %{_sysconfdir}/*[_-]*
117 %attr(640,root,root) %{_sysconfdir}/mime.types
118 %attr(755,root,root) %{_sbindir}/%{name}
119 %attr(770,root,%{name}) /var/cache/%{name}
120 %attr(750,%{name},logs) /var/log/%{name}
This page took 0.024333 seconds and 2 git commands to generate.