Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 822500
 поиск   регистрация   авторизация 
 
Группа :: Система/Серверы
Пакет: nginx

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

%define pcre_version 4.5

%def_with perl

Name: nginx
Version: 0.5.31
Release: alt3.M24.1

Summary: Fast HTTP server
License: BSD
Group: System/Servers

Url: http://sysoev.ru/nginx
Source: %url/%name-%version.tar.gz
Source1: %name.conf.in
Source2: %name.init
Source3: %name.logrotate.in
Source4: README.ALT
Source5: %name.sysconfig

Packager: Denis Smirnov <mithraen at altlinux.ru>

BuildPreReq: perl-base
# Automatically added by buildreq on Mon May 07 2007
BuildRequires: libpcre-devel libssl-devel perl-devel zlib-devel

Requires(pre): shadow-utils

Requires(pre): perl-base
Requires: perl-base

%define nginx_user _nginx
%define nginx_group _nginx
%define nginx_etc %_sysconfdir/%name
%define nginx_spool %_spooldir/%name
%define nginx_log %_logdir/%name

%description
Fast HTTP server, extremely useful as an Apache frontend

%prep
%setup -q

%build
%ifarch i686
CPU="-mtune=pentiumpro" \
%else # pentium4 athlon
CPU="-mtune=%_arch" \
%endif
%ifarch i586
CPU="" \
%endif
%ifnarch %ix86
CPU="" \
%endif # for x86_64 TODO for amd64/nocona
# FIXME: %%configure?
CFLAGS="%optflags $CPU" ./configure \
--prefix=%buildroot \
--conf-path=%buildroot%nginx_etc/nginx.conf \
--sbin-path=%buildroot%_sbindir \
--error-log-path=%buildroot%nginx_log/nginx.error.log \
--http-log-path=%buildroot%nginx_log/nginx.log \
--http-client-body-temp-path=%nginx_spool/tmp/client \
--http-proxy-temp-path=%nginx_spool/tmp/proxy \
--http-fastcgi-temp-path=%nginx_spool/tmp/fastcgi \
--pid-path=%buildroot%_var/run/nginx.pid \
--user=%nginx_user \
--group=%nginx_group \
--with-http_ssl_module \
--with-cc-opt="-I %_includedir/pcre/" \
--with-rtsig_module \
--with-select_module    \
--with-poll_module      \
--with-mail \
--with-mail_ssl_module \
--with-imap \
--with-imap_ssl_module \
--with-md5=YES \
--with-sha1=YES \
--with-http_ssl_module  \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_stub_status_module \
%if_with perl
--with-http_perl_module
%endif


subst s!%buildroot!!g objs/*.h
%make_build DESTDIR=%buildroot

%install
mkdir -p %buildroot{%nginx_etc,%_sysconfdir/logrotate.d,%_sbindir,%nginx_spool/tmp,%nginx_log}
mkdir -p %buildroot%_spooldir/nginx/tmp/{client,proxy,fastcgi}
mkdir -p %buildroot%_lockdir/%name
%makeinstall DESTDIR=%buildroot

rm -f %buildroot%nginx_etc/%name.conf
install -pD -m644 %SOURCE1 %buildroot%nginx_etc/%name.conf
install -pD -m755 %SOURCE2 %buildroot%_initdir/%name
install -pD -m644 %SOURCE3 %buildroot%_sysconfdir/logrotate.d/%name
install -pD -m644 %SOURCE5 %buildroot%_sysconfdir/sysconfig/%name

subst s! at nginx_user at !%nginx_user!g %buildroot{%_sysconfdir/logrotate.d/%name,%nginx_etc/%name.conf}
subst s! at nginx_etc at !%nginx_etc!g %buildroot{%_sysconfdir/logrotate.d/%name,%nginx_etc/%name.conf}
subst s! at nginx_spool at !%nginx_spool!g %buildroot{%_sysconfdir/logrotate.d/%name,%nginx_etc/%name.conf}
subst s! at nginx_log at !%nginx_log!g %buildroot{%_sysconfdir/logrotate.d/%name,%nginx_etc/%name.conf}

mkdir -p %buildroot%_docdir/%name-%version
cp -a %SOURCE4 CHANGES CHANGES.ru %buildroot%_docdir/%name-%version/

%if_with perl
rm -f %buildroot/usr/lib/perl5/*-linux/perllocal.pod
rmdir %buildroot/usr/lib/perl5/*-linux
rmdir %buildroot/usr/lib/perl5
mv %buildroot/usr/local/lib/* %buildroot/usr/lib/
mv %buildroot/usr/local/share/* %buildroot/usr/share/
mkdir -p  %buildroot/usr/lib/perl5/vendor_perl
mv %buildroot/usr/lib/perl5/site_perl/*/* %buildroot/usr/lib/perl5/vendor_perl/
%endif

%files
%_initdir/*
%_sbindir/*
%dir %nginx_etc
# these are private; should also confirm to SPP (#12647)
%attr(0700,root,root) %dir %_lockdir/%name
%attr(1770,root,%nginx_group) %dir %nginx_spool/tmp
%attr(1770,root,%nginx_group) %dir %nginx_spool/tmp/client
%attr(1770,root,%nginx_group) %dir %nginx_spool/tmp/proxy
%attr(1770,root,%nginx_group) %dir %nginx_spool/tmp/fastcgi
%attr(1770,root,%nginx_group) %dir %nginx_spool
%attr(1770,root,%nginx_group) %dir %nginx_log
%config(noreplace) %nginx_etc/mime.types
%config(noreplace) %nginx_etc/nginx.conf
%config(noreplace) %_sysconfdir/logrotate.d/%name
%config(noreplace) %_sysconfdir/sysconfig/%name
%nginx_etc/*.default
%nginx_etc/koi-win
%nginx_etc/koi-utf
%nginx_etc/win-utf
%_docdir/%name-%version
%if_with perl
%perl_vendor_privlib/*
%perl_vendor_man3dir/*
%endif

%pre
%_sbindir/groupadd -r -f %nginx_group ||:
%_sbindir/useradd -r -g %nginx_group -d /dev/null -s /dev/null -n %nginx_user \
2> /dev/null > /dev/null ||:

%post
%post_service %name

%preun
%preun_service %name

%changelog

Полный changelog можно просмотреть здесь

 
design & coding: Vladimir Lettiev aka crux © 2004-2005