angie/nginx.spec
2012-06-15 04:54:32 +04:00

382 lines
11 KiB
RPMSpec

%define nginx_user nginx
%define nginx_group %{nginx_user}
%define nginx_home /var/lib/nginx
%define nginx_home_tmp %{nginx_home}/tmp
%define nginx_logdir /var/log/nginx
%define nginx_confdir %{_sysconfdir}/nginx
%define nginx_datadir %{_datadir}/nginx
%define nginx_webroot %{nginx_datadir}/html
Summary: Robust, small and high performance HTTP and reverse proxy server
Name: nginx
Version: 1.2.1
Release: 1
Group: System/Servers
# BSD License (two clause)
# http://www.freebsd.org/copyright/freebsd-license.html
License: BSD
URL: http://nginx.net/
Source0: http://nginx.org/download/nginx-%{version}.tar.gz
Source1: http://nginx.org/download/nginx-%{version}.tar.gz.asc
Source2: nginx.service
Source3: nginx.logrotate
Source4: virtual.conf
Source5: ssl.conf
Source100: index.html
Source101: poweredby.png
Source102: nginx-logo.png
Source103: 50x.html
Source104: 404.html
Requires(pre): rpm-helper
Requires(postun): rpm-helper
BuildRequires: gd-devel
BuildRequires: GeoIP-devel
BuildRequires: libxslt-devel
BuildRequires: openssl-devel
BuildRequires: pcre-devel
BuildRequires: perl-devel
BuildRequires: perl(ExtUtils::Embed)
BuildRequires: zlib-devel
Requires: pcre
Requires: geoip
Requires: openssl
Provides: webserver
%description
Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
proxy server written by Igor Sysoev.
%prep
%setup -q
%build
%serverbuild
./configure \
--user=%{nginx_user} \
--group=%{nginx_group} \
--prefix=%{nginx_datadir} \
--sbin-path=%{_sbindir}/%{name} \
--conf-path=%{nginx_confdir}/%{name}.conf \
--error-log-path=%{nginx_logdir}/error.log \
--http-log-path=%{nginx_logdir}/access.log \
--http-client-body-temp-path=%{nginx_home_tmp}/client_body \
--http-proxy-temp-path=%{nginx_home_tmp}/proxy \
--http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
--pid-path=/var/run/%{name}/%{name}.pid \
--lock-path=/var/lock/subsys/%{name} \
--with-file-aio \
--with-ipv6 \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
--with-http_image_filter_module \
--with-http_geoip_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_degradation_module \
--with-http_stub_status_module \
--with-http_perl_module \
--with-mail \
--with-mail_ssl_module \
--with-cc-opt="$CFLAGS $(pcre-config --cflags)"
# this is only passed to perl module being built and only overrides the
# default '-O' flag which anyways lowers optimizations (which we don't
# want)
%make OPTIMIZE="-fno-PIE"
%install
%makeinstall_std INSTALLDIRS=vendor
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
find %{buildroot} -type f -name perllocal.pod -exec rm -f {} \;
find %{buildroot} -type f -empty -exec rm -f {} \;
find %{buildroot} -type f -exec chmod 0644 {} \;
find %{buildroot} -type f -name '*.so' -exec chmod 0755 {} \;
chmod 0755 %{buildroot}%{_sbindir}/nginx
%{__install} -p -D -m 0755 %{SOURCE2} %{buildroot}/lib/systemd/system/nginx.service
%{__install} -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
%{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d
%{__install} -p -m 0644 %{SOURCE4} %{SOURCE5} %{buildroot}%{nginx_confdir}/conf.d
%{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp}
%{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir}
%{__install} -p -d -m 0755 %{buildroot}%{nginx_webroot}
%{__install} -p -m 0644 %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{buildroot}%{nginx_webroot}
# add current version
perl -pi -e "s|_VERSION_|%{version}|g" %{buildroot}%{nginx_webroot}/index.html
# convert to UTF-8 all files that give warnings.
for textfile in CHANGES; do
mv $textfile $textfile.old
iconv --from-code ISO8859-1 --to-code UTF-8 --output $textfile $textfile.old
rm -f $textfile.old
done
install -d %{buildroot}%{_mandir}/man8
install -m0644 man/*.8 %{buildroot}%{_mandir}/man8/
%pre
%_pre_useradd %{nginx_user} %{nginx_home} /bin/false
%post
if [ $1 -eq 1 ]; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [ $1 -eq 0 ]; then
/bin/systemctl --no-reload disable nginx.service >/dev/null 2>&1 || :
/bin/systemctl stop nginx.service >/dev/null 2>&1 || :
fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -gt 1 ]; then
/bin/systemctl try-restart nginx.service >/dev/null 2>&1 || :
fi
%_postun_userdel %{nginx_user}
%files
%defattr(-,root,root,-)
%doc LICENSE CHANGES README
%{nginx_datadir}/
%{_sbindir}/%{name}
%{_mandir}/man3/%{name}.3pm*
%{_mandir}/man8/*
/lib/systemd/system/nginx.service
%dir %{nginx_confdir}
%dir %{nginx_confdir}/conf.d
%config(noreplace) %{nginx_confdir}/conf.d/*.conf
%config(noreplace) %{nginx_confdir}/win-utf
%config(noreplace) %{nginx_confdir}/%{name}.conf.default
%config(noreplace) %{nginx_confdir}/scgi_params
%config(noreplace) %{nginx_confdir}/scgi_params.default
%config(noreplace) %{nginx_confdir}/fastcgi.conf
%config(noreplace) %{nginx_confdir}/fastcgi.conf.default
%config(noreplace) %{nginx_confdir}/mime.types.default
%config(noreplace) %{nginx_confdir}/fastcgi_params
%config(noreplace) %{nginx_confdir}/fastcgi_params.default
%config(noreplace) %{nginx_confdir}/koi-win
%config(noreplace) %{nginx_confdir}/koi-utf
%config(noreplace) %{nginx_confdir}/%{name}.conf
%config(noreplace) %{nginx_confdir}/mime.types
%config(noreplace) %{nginx_confdir}/uwsgi_params
%config(noreplace) %{nginx_confdir}/uwsgi_params.default
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %{perl_vendorarch}/auto/%{name}
%{perl_vendorarch}/%{name}.pm
%{perl_vendorarch}/auto/%{name}/%{name}.so
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home}
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp}
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_logdir}
%attr(-,%{nginx_user},%{nginx_group}) %dir /var/run/%{name}
%changelog
* Thu Jun 07 2012 Alexander Khrukin <akhrukin@mandriva.org> 1.2.1-1
+ Revision: 803077
- version update 1.2.1
* Wed Apr 25 2012 Dmitry Mikhirev <dmikhirev@mandriva.org> 1.2.0-1
+ Revision: 793321
- update to 1.2.0
* Thu Mar 29 2012 Oden Eriksson <oeriksson@mandriva.com> 1.1.18-1
+ Revision: 788064
- 1.1.18
- sync with fedora a bit
* Sat Mar 03 2012 Lonyai Gergely <aleph@mandriva.org> 1.1.16-1
+ Revision: 782041
- 1.1.16
* Tue Feb 21 2012 Lonyai Gergely <aleph@mandriva.org> 1.1.15-1
+ Revision: 778545
- 1.1.15
* Tue Feb 07 2012 Oden Eriksson <oeriksson@mandriva.com> 1.1.13-2
+ Revision: 771523
- rebuilt for new pcre
* Sun Feb 05 2012 Alexander Khrukin <akhrukin@mandriva.org> 1.1.13-1
+ Revision: 771307
- version update 1.1.13
* Tue Jan 31 2012 Per Øyvind Karlsen <peroyvind@mandriva.org> 1.0.8-2
+ Revision: 770066
- drop some dead DESTDIR hackiness
- drop legacy junk
- fix so that perl module isn't attempted to be compiled with -fPIE which break
built
- mass rebuild of perl extensions against perl 5.14.2
* Tue Oct 04 2011 Leonardo Coelho <leonardoc@mandriva.org> 1.0.8-1
+ Revision: 702740
- bump new version
* Fri Aug 12 2011 Oden Eriksson <oeriksson@mandriva.com> 1.0.5-1
+ Revision: 694277
- drop the config patch, seems redundant now
- 1.0.5
* Wed Jun 01 2011 Funda Wang <fwang@mandriva.org> 1.0.4-1
+ Revision: 682322
- update to new version 1.0.4
* Mon May 30 2011 Oden Eriksson <oeriksson@mandriva.com> 1.0.3-2
+ Revision: 681815
- package loss
* Thu May 26 2011 Funda Wang <fwang@mandriva.org> 1.0.3-1
+ Revision: 679137
- update to new version 1.0.3
* Tue May 10 2011 Funda Wang <fwang@mandriva.org> 1.0.2-1
+ Revision: 673308
- update to new version 1.0.2
* Mon May 09 2011 Oden Eriksson <oeriksson@mandriva.com> 1.0.1-1
+ Revision: 672714
- 1.0.1
* Sun Apr 10 2011 Oden Eriksson <oeriksson@mandriva.com> 0.9.7-1
+ Revision: 652249
- 0.9.7
* Sat Apr 02 2011 Oden Eriksson <oeriksson@mandriva.com> 0.9.6-1
+ Revision: 649785
- 0.9.6
* Sat Jan 01 2011 Oden Eriksson <oeriksson@mandriva.com> 0.9.3-1mdv2011.0
+ Revision: 627093
- 0.9.3
* Tue Nov 02 2010 Rémy Clouard <shikamaru@mandriva.org> 0.8.53-2mdv2011.0
+ Revision: 592564
- make nginx provide webserver
* Tue Oct 19 2010 Funda Wang <fwang@mandriva.org> 0.8.53-1mdv2011.0
+ Revision: 586696
- new version 0.8.53
* Mon Oct 04 2010 Funda Wang <fwang@mandriva.org> 0.8.52-1mdv2011.0
+ Revision: 582791
- update to new version 0.8.52
* Mon Aug 09 2010 Funda Wang <fwang@mandriva.org> 0.8.49-1mdv2011.0
+ Revision: 567990
- update to new version 0.8.49
* Wed Aug 04 2010 Funda Wang <fwang@mandriva.org> 0.8.48-1mdv2011.0
+ Revision: 565647
- update to new version 0.8.48
* Sun Aug 01 2010 Funda Wang <fwang@mandriva.org> 0.8.47-1mdv2011.0
+ Revision: 564290
- update to new version 0.8.47
* Tue Jul 20 2010 Jérôme Quelin <jquelin@mandriva.org> 0.8.46-2mdv2011.0
+ Revision: 555663
- rebuild
* Mon Jul 19 2010 Funda Wang <fwang@mandriva.org> 0.8.46-1mdv2011.0
+ Revision: 554964
- new version 0.8.46
* Tue Jun 15 2010 Oden Eriksson <oeriksson@mandriva.com> 0.8.41-1mdv2010.1
+ Revision: 548065
- 0.8.41
* Thu May 06 2010 Oden Eriksson <oeriksson@mandriva.com> 0.8.36-1mdv2010.1
+ Revision: 542875
- 0.8.36
* Wed Apr 14 2010 Oden Eriksson <oeriksson@mandriva.com> 0.8.35-1mdv2010.1
+ Revision: 534664
- 0.8.35
- use the %%serverbuild macro
* Wed Apr 07 2010 Funda Wang <fwang@mandriva.org> 0.8.34-3mdv2010.1
+ Revision: 532516
- rebuild
* Mon Mar 29 2010 Michael Scherer <misc@mandriva.org> 0.8.34-2mdv2010.1
+ Revision: 528833
- remove patch0, no longer useful ( as nginx compile fine with -Werror
and -D_FORTIFY_SOURCE=2 )
* Thu Mar 04 2010 Funda Wang <fwang@mandriva.org> 0.8.34-1mdv2010.1
+ Revision: 514055
- new version 0.8.34
* Fri Feb 26 2010 Oden Eriksson <oeriksson@mandriva.com> 0.8.33-2mdv2010.1
+ Revision: 511596
- rebuilt against openssl-0.9.8m
* Wed Feb 17 2010 Oden Eriksson <oeriksson@mandriva.com> 0.8.33-1mdv2010.1
+ Revision: 506976
- 0.8.33
* Thu Jan 14 2010 Michael Scherer <misc@mandriva.org> 0.8.31-2mdv2010.1
+ Revision: 491109
- enable ipv6, for point spec104 of 2010.1 ( ipv6 support )
+ Oden Eriksson <oeriksson@mandriva.com>
- fix deps (shikamaru)
* Wed Jan 06 2010 Frederik Himpe <fhimpe@mandriva.org> 0.8.31-1mdv2010.1
+ Revision: 486834
- update to new version 0.8.31
* Sun Dec 20 2009 Oden Eriksson <oeriksson@mandriva.com> 0.8.30-1mdv2010.1
+ Revision: 480481
- 0.8.30
* Sat Dec 12 2009 Frederik Himpe <fhimpe@mandriva.org> 0.8.29-1mdv2010.1
+ Revision: 477775
- update to new version 0.8.29
* Wed Nov 25 2009 Funda Wang <fwang@mandriva.org> 0.8.28-1mdv2010.1
+ Revision: 469934
- update to new version 0.8.28
* Tue Nov 17 2009 Frederik Himpe <fhimpe@mandriva.org> 0.8.27-1mdv2010.1
+ Revision: 467003
- update to new version 0.8.27
* Sat Nov 07 2009 Frederik Himpe <fhimpe@mandriva.org> 0.8.22-1mdv2010.1
+ Revision: 462619
- update to new version 0.8.22
+ Thomas Backlund <tmb@mandriva.org>
- fix typo in initscript
* Mon Sep 28 2009 Frederik Himpe <fhimpe@mandriva.org> 0.8.17-1mdv2010.0
+ Revision: 450653
- update to new version 0.8.17
* Mon Sep 14 2009 Frederik Himpe <fhimpe@mandriva.org> 0.8.15-1mdv2010.0
+ Revision: 440749
- update to new version 0.8.15
* Sat Aug 29 2009 Frederik Himpe <fhimpe@mandriva.org> 0.8.11-1mdv2010.0
+ Revision: 422223
- update to new version 0.8.11
* Wed Aug 12 2009 Frederik Himpe <fhimpe@mandriva.org> 0.8.8-1mdv2010.0
+ Revision: 415678
- update to new version 0.8.8
* Sun Jun 28 2009 Oden Eriksson <oeriksson@mandriva.com> 0.8.4-1mdv2010.0
+ Revision: 390248
- import nginx