File nginx-stable.spec of Package nginx-stable
#
# spec file for package nginx-stable (Version 0.6.34)
#
# Copyright 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright Alexander Simonov <alex@simonov.in.ua>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# norootforbuild
Name: nginx-stable
Version: 0.6.34
Release: 0
#
%define pkg_name nginx
#
%define ngx_prefix %{_prefix}
%define ngx_sbindir %{_sbindir}/nginx
%define ngx_conf_dir %{_sysconfdir}/nginx
%define ngx_conf_path %{ngx_conf_dir}/nginx.conf
%define ngx_error_log /var/log/nginx/error.log
%define ngx_access_log /var/log/nginx/access.log
%define ngx_pid_path /var/run/nginx.pid
%define ngx_lock_path /var/run/nginx.lock
%define ngx_home /var/lib/nginx
%define ngx_tmp_http %{ngx_home}/tmp/
%define ngx_tmp_proxy %{ngx_home}/proxy/
%define ngx_tmp_fcgi %{ngx_home}/fastcgi/
%define ngx_user_group nginx
#
License: BSD
Group: Productivity/Networking/Web/Proxy
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: openssl-devel pcre-devel pkgconfig zlib-devel dos2unix
Conflicts: nginx nginx-0.5 nginx-0.7 nginx-0.6 nginx-devel
Provides: nginx-stable = %{version}-%{release}
PreReq: %insserv_prereq %fillup_prereq pwdutils
%requires_eq perl
#
Url: http://nginx.net/
Source: http://sysoev.ru/nginx/nginx-%{version}.tar.gz
Source1: nginx.init
Patch: nginx-0.4.0-no_Werror.patch
Patch1: nginx-0.6-html.patch
Patch2: nginx-0.4.0-perl_vendor_install.patch
Patch3: nginx-0.6.31_default_config.patch
#
Summary: A HTTP server and IMAP/POP3 proxy server
%description
nginx [engine x] is a HTTP server and IMAP/POP3 proxy server written by Igor Sysoev.
It has been running on many heavily loaded Russian sites for more than two years.
Authors:
--------
Igor Sysoev
%prep
%setup -n %{pkg_name}-%{version}
%patch
%patch1
%patch2
%patch3
dos2unix contrib/geo2nginx.pl
%build
./configure \
--prefix=%{ngx_prefix}/ \
--sbin-path=%{ngx_sbindir} \
--conf-path=%{ngx_conf_path} \
--error-log-path=%{ngx_error_log} \
--http-log-path=%{ngx_access_log} \
--pid-path=%{ngx_pid_path} \
--lock-path=%{ngx_lock_path} \
--http-client-body-temp-path=%{ngx_tmp_http} \
--http-proxy-temp-path=%{ngx_tmp_proxy} \
--http-fastcgi-temp-path=%{ngx_tmp_fcgi} \
--user=nginx --group=nginx \
--with-rtsig_module \
--with-select_module \
--with-poll_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_dav_module \
--with-http_perl_module \
--with-perl=%{_bindir}/perl \
--with-imap \
--with-md5=/usr \
--with-sha1=/usr \
%if 0%{?suse_version} > 1000 || 0%{?fedora_version} > 4 || 0%{?mandriva_version} > 2006
--with-cc-opt="%{optflags} -fstack-protector"
%else
--with-cc-opt="%{optflags}"
%endif
%{__make}
%install
%makeinstall
%perl_process_packlist
#
%{__install} -d -m 0750 %{buildroot}%{ngx_home}/{,tmp,proxy,fastcgi}
#
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{pkg_name}
%{__ln_s} -f %{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}
%post
%fillup_and_insserv %{pkg_name}
%preun
%stop_on_removal %{pkg_name}
%postun
%restart_on_update %{pkg_name}
%{insserv_cleanup}
%clean
%{__rm} -rf %{buildroot}
%pre
/usr/sbin/groupadd -r %{ngx_user_group} &>/dev/null ||:
/usr/sbin/useradd -g %{ngx_user_group} -s /bin/false -r -c "user for %{ngx_user_group}" -d %{ngx_home} %{ngx_user_group} &>/dev/null ||:
%files
%defattr(-,root,root,-)
%dir %{ngx_conf_dir}/
%config(noreplace) %{ngx_conf_dir}/koi-utf
%config(noreplace) %{ngx_conf_dir}/koi-win
%config(noreplace) %{ngx_conf_dir}/fastcgi_params
%config(noreplace) %{ngx_conf_dir}/fastcgi_params.default
%config(noreplace) %{ngx_conf_dir}/mime.types
%config(noreplace) %{ngx_conf_dir}/mime.types.default
%config(noreplace) %{ngx_conf_dir}/nginx.conf
%config(noreplace) %{ngx_conf_dir}/nginx.conf.default
%config(noreplace) %{ngx_conf_dir}/win-utf
%dir %{perl_vendorarch}/auto/nginx/
%{perl_vendorarch}/auto/nginx/.packlist
%{perl_vendorarch}/auto/nginx/nginx.bs
%{perl_vendorarch}/auto/nginx/nginx.so
%{perl_vendorarch}/nginx.pm
%{ngx_sbindir}
%{_mandir}/man3/nginx.3pm*
/srv/www/htdocs/50x.html
/srv/www/htdocs/index.html
/var/adm/perl-modules/%{name}
%{_sysconfdir}/init.d/%{pkg_name}
%{_sbindir}/rc%{pkg_name}
%dir %attr(750,%{ngx_user_group},%{ngx_user_group}) /var/log/nginx/
%dir %attr(750,%{ngx_user_group},%{ngx_user_group}) %{ngx_home}/
%dir %attr(750,%{ngx_user_group},%{ngx_user_group}) %{ngx_home}/tmp/
%dir %attr(750,%{ngx_user_group},%{ngx_user_group}) %{ngx_home}/proxy/
%dir %attr(750,%{ngx_user_group},%{ngx_user_group}) %{ngx_home}/fastcgi/
%doc CHANGES* LICENSE README
%doc conf/ contrib/
%changelog