]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
- %dir html and perms for favicon.ico
[packages/nginx.git] / nginx.spec
CommitLineData
f9e65082 1# TODO
f1fc9780 2# - logrotate script
362f5ab2 3# - more bconds (??)
4# - subpackage with error pages
5# Conditional build for nginx:
6%bcond_with stub_status # stats module
7%bcond_with rtsig
8%bcond_with select
9%bcond_with poll
10%bcond_with ssl # ssl support
11%bcond_with imap # imap proxy
12%bcond_without http_browser # parse header "User-agent"
13#
8e1389c7 14Summary: High perfomance HTTP and reverse proxy server
185313bb 15Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
f9e65082 16Name: nginx
22019997 17Version: 0.5.31
362f5ab2 18Release: 0.1
51ef519b 19License: BSD-like
7d9b86c7 20Group: Networking/Daemons
f1fc9780 21Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
22019997 22# Source0-md5: d84ef8e624b8953faf9cee2b5da535c1
f1fc9780 23Source1: %{name}.init
dfef7372 24Source2: %{name}-mime.types.sh
362f5ab2 25Source3: http://www.nginx.eu/favicon.ico
26# Source3-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
27Source4: http://www.nginx.eu/download/proxy.conf
28# Source4-md5: f5263ae01c2edb18f46d5d1df2d3a5cd
29Source5: http://www.nginx.eu/download/nginx.monitrc
30# Source5-md5: 1d3f5eedfd34fe95213f9e0fc19daa88
31Source6: http://www.nginx.eu/download/nginx.conf
32# Source6-md5: 1c112d6f03d0f365e4acc98c1d96261a
f1fc9780 33Patch0: %{name}-config.patch
51ef519b 34URL: http://nginx.net/
dfef7372 35BuildRequires: mailcap
f9e65082 36BuildRequires: openssl-devel
f1fc9780 37BuildRequires: pcre-devel
7d9b86c7 38BuildRequires: rpmbuild(macros) >= 1.268
f9e65082 39BuildRequires: zlib-devel
7d9b86c7
ER
40Requires(post,preun): /sbin/chkconfig
41Requires(postun): /usr/sbin/groupdel
42Requires(postun): /usr/sbin/userdel
43Requires(pre): /bin/id
44Requires(pre): /usr/bin/getgid
45Requires(pre): /usr/sbin/groupadd
46Requires(pre): /usr/sbin/useradd
47Requires: rc-scripts
f9e65082
ER
48BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
362f5ab2 50%define _sysconfdir /etc/%{name}
51%define _nginxdir /home/services/%{name}
f9e65082
ER
52
53%description
8e1389c7
JB
54High perfomance HTTP and reverse proxy server.
55
390f5b88
JR
56%description -l pl.UTF-8
57Serwer HTTP i odwrotne proxy o wysokiej wydajności.
f9e65082
ER
58
59%prep
60%setup -q
f1fc9780 61%patch0 -p0
f9e65082 62
dfef7372
ER
63# build mime.types.conf
64sh %{SOURCE2} /etc/mime.types
65
f9e65082
ER
66%build
67# NB: not autoconf generated configure
68./configure \
69 --prefix=%{_prefix} \
70 --sbin-path=%{_sbindir}/%{name} \
71 --conf-path=%{_sysconfdir}/%{name}.conf \
72 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
73 --pid-path=%{_localstatedir}/run/%{name}.pid \
dfef7372
ER
74 --user=nginx \
75 --group=nginx \
362f5ab2 76 %{?with_stub_status:--with-http_stub_status_module} \
77 %{?with_rtsig:--with-rtsig_module} \
78 %{?with_select:--with-select_module} \
79 %{?with_poll:--with-poll_module} \
80 %{?with_ssl:--with-http_ssl_module} \
81 %{?with_imap:--with-imap} \
82 %{?with_http_browser:--without-http_browser_module} \
f9e65082
ER
83 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
84 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
85 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
86 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
f9e65082
ER
87 --with-cc="%{__cc}" \
88 --with-cc-opt="%{rpmcflags}" \
89 --with-ld-opt="%{rpmldflags}" \
90 %{?debug:--with-debug}
91
92%{__make}
93
94%install
95rm -rf $RPM_BUILD_ROOT
362f5ab2 96install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
97 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
98 $RPM_BUILD_ROOT{%{_localstatedir}/log/{%{name},archive/%{name}},%{_localstatedir}/cache/%{name}} \
99 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}}
f9e65082 100
f1fc9780 101install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
dfef7372 102install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
f1fc9780 103install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
362f5ab2 104install %{SOURCE3} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
105install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
106install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.monitrc
107install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf
057a558d 108
f1fc9780 109install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
f9e65082
ER
110
111rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
112rm -rf $RPM_BUILD_ROOT%{_prefix}/html
113
114%clean
115rm -rf $RPM_BUILD_ROOT
116
f1fc9780 117%pre
a37373c3 118%groupadd -r -g 213 %{name}
362f5ab2 119%groupadd -g 51 http
a37373c3 120%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 121%addusertogroup %{name} http
f1fc9780 122
f9e65082 123%post
362f5ab2 124for a in access.log error.log; do
125 if [ ! -f /var/log/%{name}/$a ]; then
126 touch /var/log/%{name}/$a
127 chown nginx:nginx /var/log/%{name}/$a
128 chmod 644 /var/log/%{name}/$a
129 fi
130done
f9e65082
ER
131/sbin/chkconfig --add %{name}
132%service %{name} restart
133
134%preun
135if [ "$1" = "0" ]; then
136 %service -q %{name} stop
137 /sbin/chkconfig --del %{name}
138fi
f9e65082 139
f1fc9780 140%postun
141if [ "$1" = "0" ]; then
7d9b86c7
ER
142 %userremove %{name}
143 %groupremove %{name}
f1fc9780 144fi
145
f9e65082
ER
146%files
147%defattr(644,root,root,755)
148%doc CHANGES LICENSE README html/index.html conf/nginx.conf
149%doc %lang(ru) CHANGES.ru
f1fc9780 150%attr(754,root,root) /etc/rc.d/init.d/%{name}
151%dir %attr(754,root,root) %{_sysconfdir}
164ab75d 152%dir %{_nginxdir}
153%dir %{_nginxdir}/cgi-bin
154%dir %{_nginxdir}/html
155%dir %{_nginxdir}/errors
f1fc9780 156%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
157%attr(640,root,root) %{_sysconfdir}/*[_-]*
362f5ab2 158%attr(640,root,root) %{_sysconfdir}/proxy.conf
159%attr(640,root,root) %{_sysconfdir}/nginx.monitrc
f1fc9780 160%attr(640,root,root) %{_sysconfdir}/mime.types
161%attr(755,root,root) %{_sbindir}/%{name}
162%attr(770,root,%{name}) /var/cache/%{name}
163%attr(750,%{name},logs) /var/log/%{name}
164ab75d 164config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
165#%attr(755,%{name},%{name}) %{_nginxdir}/html/favicon.ico
This page took 0.627148 seconds and 4 git commands to generate.