Blame SPECS/nginx.spec

c4323e
%{?scl:%scl_package nginx}
c4323e
c4323e
%if 0%{?rhel} > 6
c4323e
%define use_systemd 1
c4323e
%else
c4323e
%define use_systemd 0
c4323e
%endif
c4323e
c4323e
%define use_geoip 0
c4323e
%define use_perl 0
c4323e
%global with_gperftools     0
c4323e
%global with_passenger 1
c4323e
%global passenger_version 4.0.50
c4323e
c4323e
%global  _hardened_build     1
c4323e
%global  nginx_user          nginx
c4323e
%global  nginx_group         %{nginx_user}
c4323e
%global  nginx_home          %{_localstatedir}/lib/nginx
c4323e
%global  nginx_home_tmp      %{nginx_home}/tmp
c4323e
%global  nginx_confdir       %{_sysconfdir}/nginx
c4323e
%global  nginx_datadir       %{_datadir}/nginx
c4323e
%global  nginx_logdir        %{_localstatedir}/log/nginx
c4323e
%global  nginx_webroot       %{nginx_datadir}/html
c4323e
c4323e
%global service_name %{?scl_prefix}nginx
c4323e
c4323e
Name:              %{?scl:%scl_prefix}nginx
c4323e
Epoch:             1
82925c
Version:           1.8.1
82925c
Release:           1%{?dist}
c4323e
c4323e
Summary:           A high performance web server and reverse proxy server
c4323e
Group:             System Environment/Daemons
c4323e
# BSD License (two clause)
c4323e
# http://www.freebsd.org/copyright/freebsd-license.html
c4323e
License:           BSD
c4323e
URL:               http://nginx.org/
c4323e
c4323e
Source0:           http://nginx.org/download/nginx-%{version}.tar.gz
c4323e
Source1:           http://s3.amazonaws.com/phusion-passenger/releases/passenger-%{passenger_version}.tar.gz
c4323e
Source2:           scl-register-helper.sh
c4323e
Source10:          nginx.service
c4323e
Source11:          nginx.logrotate
c4323e
Source12:          nginx.conf
c4323e
Source13:          action-upgrade.sh
c4323e
Source15:          nginx.init
c4323e
Source16:          nginx.sysconfig
c4323e
Source100:         index.html
c4323e
Source101:         poweredby.png
c4323e
Source102:         nginx-logo.png
c4323e
Source103:         404.html
c4323e
Source104:         50x.html
c4323e
c4323e
# removes -Werror in upstream build scripts.  -Werror conflicts with
c4323e
# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
c4323e
Patch0:            nginx-auto-cc-gcc.patch
82925c
Patch1:            nginx-1.8.1-CVE-2016-4450.patch
82925c
c4323e
# Build Passenger against Fedora's (renamed) libeio
c4323e
Patch200:          passenger-4.0.38-libeio.patch
c4323e
# Fix passenger building with nginx-1.8.0
c4323e
Patch201:          passenger-4.50-nginx-1.8.patch
c4323e
c4323e
%if 0%{?with_passenger}
c4323e
BuildRequires: %{?scl:rh-passenger40-}libeio-devel
c4323e
BuildRequires: %{?scl:rh-passenger40-}libev-devel >= 4.0.0
c4323e
BuildRequires: %{?scl:rh-passenger40-}rubygem(mizuho)
c4323e
BuildRequires: %{?scl:ruby193-}ruby
c4323e
BuildRequires: %{?scl:ruby193-}ruby-devel
c4323e
BuildRequires: %{?scl:ruby193-}rubygems
c4323e
BuildRequires: %{?scl:ruby193-}rubygems-devel
c4323e
BuildRequires: %{?scl:ruby193-}rubygem(rake) >= 0.8.1
c4323e
BuildRequires: %{?scl:ruby193-}rubygem(rack)
c4323e
BuildRequires: %{?scl:ruby193-}rubygem(rspec)
c4323e
BuildRequires: %{?scl:ruby193-}rubygem(mime-types)
c4323e
BuildRequires: libcurl-devel
c4323e
BuildRequires: zlib-devel
c4323e
BuildRequires: pcre-devel
c4323e
BuildRequires: openssl-devel
c4323e
%endif
c4323e
c4323e
# BuildRequires:     GeoIP-devel
c4323e
BuildRequires:     gd-devel
c4323e
%if 0%{?with_gperftools}
c4323e
BuildRequires:     gperftools-devel
c4323e
%endif
c4323e
BuildRequires:     libxslt-devel
c4323e
BuildRequires:     openssl-devel
c4323e
BuildRequires:     pcre-devel
c4323e
BuildRequires:     perl-devel
c4323e
BuildRequires:     perl(ExtUtils::Embed)
c4323e
BuildRequires:     zlib-devel
c4323e
%if 0%{?use_geoip}
c4323e
Requires:          GeoIP
c4323e
%endif
c4323e
Requires:          gd
c4323e
Requires:          openssl
c4323e
Requires:          pcre
c4323e
%if 0%{?use_perl}
c4323e
Requires:          perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
c4323e
%endif
c4323e
Requires(pre):     shadow-utils
c4323e
Provides:          webserver
c4323e
c4323e
%if %{use_systemd}
c4323e
BuildRequires:     systemd
c4323e
Requires(post):    systemd
c4323e
Requires(preun):   systemd
c4323e
Requires(postun):  systemd
c4323e
%else
c4323e
Requires(post):    chkconfig
c4323e
Requires(preun):   chkconfig, initscripts
c4323e
Requires(postun):  initscripts
c4323e
%endif
c4323e
Requires(post): policycoreutils-python libselinux-utils
c4323e
%{?scl:Requires:%scl_runtime}
c4323e
c4323e
%description
c4323e
Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and
c4323e
IMAP protocols, with a strong focus on high concurrency, performance and low
c4323e
memory usage.
c4323e
c4323e
c4323e
%prep
c4323e
%setup -q -n nginx-%{version}
c4323e
%patch0 -p0
82925c
%patch1 -p1 -b .cve4450
c4323e
c4323e
%if 0%{?with_passenger}
c4323e
tar -xf %{SOURCE1}
c4323e
pushd passenger-%{passenger_version}
c4323e
%patch200 -p1 -b .uselibeio
c4323e
%patch201 -p1 -b .nginx
c4323e
popd
c4323e
%endif
c4323e
c4323e
%build
c4323e
%if 0%{?with_passenger}
c4323e
%{?scl:scl enable ruby193 rh-passenger40 - << \EOF}
c4323e
pushd passenger-%{passenger_version}
c4323e
export USE_VENDORED_LIBEV=false
c4323e
export USE_VENDORED_LIBEIO=false
c4323e
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
c4323e
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ;
c4323e
FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ;
c4323e
c4323e
export LANG=en_US.UTF-8
c4323e
export LANGUAGE=en_US.UTF-8
c4323e
export LC_ALL=en_US.UTF-8
c4323e
c4323e
rake nginx \
c4323e
    NATIVE_PACKAGING_METHOD=rpm \
c4323e
    EXTRA_CFLAGS="-fPIC" \
c4323e
    EXTRA_CXXFLAGS="-fPIC" \
c4323e
    FS_PREFIX=%{_prefix} \
c4323e
    FS_BINDIR=%{_bindir} \
c4323e
    FS_SBINDIR=%{_sbindir} \
c4323e
    FS_DATADIR=%{_datadir} \
c4323e
    FS_LIBDIR=%{_libdir} \
c4323e
    FS_DOCDIR=%{_docdir} \
c4323e
    RUBYLIBDIR=%{_datadir}/passenger/
c4323e
    RUBYARCHDIR=%{_libdir}/passenger/
c4323e
popd
c4323e
%endif
c4323e
c4323e
# nginx does not utilize a standard configure script.  It has its own
c4323e
# and the standard configure options cause the nginx configure script
c4323e
# to error out.  This is is also the reason for the DESTDIR environment
c4323e
# variable.
c4323e
export DESTDIR=%{buildroot}
c4323e
./configure \
c4323e
    --prefix=%{nginx_datadir} \
c4323e
    --sbin-path=%{_sbindir}/nginx \
c4323e
    --conf-path=%{nginx_confdir}/nginx.conf \
c4323e
    --error-log-path=%{nginx_logdir}/error.log \
c4323e
    --http-log-path=%{nginx_logdir}/access.log \
c4323e
    --http-client-body-temp-path=%{nginx_home_tmp}/client_body \
c4323e
    --http-proxy-temp-path=%{nginx_home_tmp}/proxy \
c4323e
    --http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
c4323e
    --http-uwsgi-temp-path=%{nginx_home_tmp}/uwsgi \
c4323e
    --http-scgi-temp-path=%{nginx_home_tmp}/scgi \
c4323e
    --pid-path=%{_localstatedir}/run/nginx/nginx.pid \
c4323e
    --lock-path=%{_localstatedir}/lock/subsys/nginx \
c4323e
    --user=%{nginx_user} \
c4323e
    --group=%{nginx_group} \
c4323e
    --with-file-aio \
c4323e
    --with-ipv6 \
c4323e
    --with-http_ssl_module \
c4323e
    --with-http_spdy_module \
c4323e
    --with-http_realip_module \
c4323e
    --with-http_addition_module \
c4323e
    --with-http_xslt_module \
c4323e
    --with-http_image_filter_module \
c4323e
%if 0%{?use_geoip}
c4323e
    --with-http_geoip_module \
c4323e
%endif
c4323e
    --with-http_sub_module \
c4323e
    --with-http_dav_module \
c4323e
    --with-http_flv_module \
c4323e
    --with-http_mp4_module \
c4323e
    --with-http_gunzip_module \
c4323e
    --with-http_gzip_static_module \
c4323e
    --with-http_random_index_module \
c4323e
    --with-http_secure_link_module \
c4323e
    --with-http_degradation_module \
c4323e
    --with-http_stub_status_module \
c4323e
%if 0%{?use_perl}
c4323e
    --with-http_perl_module \
c4323e
%endif
c4323e
    --with-mail \
c4323e
    --with-mail_ssl_module \
c4323e
    --with-pcre \
c4323e
%if 0%{?with_gperftools}
c4323e
    --with-google_perftools_module \
c4323e
%endif
c4323e
%if 0%{?with_passenger}
c4323e
    --add-module="./passenger-%{passenger_version}/ext/nginx" \
c4323e
%endif
c4323e
    --with-debug \
c4323e
    --with-cc-opt="%{optflags} $(pcre-config --cflags)" \
c4323e
    --with-ld-opt="$RPM_LD_FLAGS -Wl,-E" # so the perl module finds its symbols
c4323e
c4323e
make %{?_smp_mflags}
c4323e
c4323e
%if 0%{?with_passenger}
c4323e
%{?scl:EOF}
c4323e
%endif
c4323e
c4323e
%install
c4323e
#include helper script for creating register stuff
c4323e
export _SR_BUILDROOT=%{buildroot}
c4323e
export _SR_SCL_SCRIPTS=%{?_scl_scripts}
c4323e
source %{SOURCE2}
c4323e
c4323e
make install DESTDIR=%{buildroot} INSTALLDIRS=vendor
c4323e
c4323e
find %{buildroot} -type f -name .packlist -exec rm -f '{}' \;
c4323e
find %{buildroot} -type f -name perllocal.pod -exec rm -f '{}' \;
c4323e
find %{buildroot} -type f -empty -exec rm -f '{}' \;
c4323e
find %{buildroot} -type f -iname '*.so' -exec chmod 0755 '{}' \;
c4323e
%if %{use_systemd}
c4323e
install -p -D -m 0644 %{SOURCE10} \
c4323e
    %{buildroot}%{_unitdir}/%{?scl:%scl_prefix}nginx.service
c4323e
c4323e
sed -i 's|\$sbindir|%{_sbindir}|' \
c4323e
    %{buildroot}%{_unitdir}/%{?scl:%scl_prefix}nginx.service
c4323e
sed -i 's|\$localstatedir|%{_localstatedir}|' \
c4323e
    %{buildroot}%{_unitdir}/%{?scl:%scl_prefix}nginx.service
c4323e
c4323e
scl_reggen %{name} --cpfile %{_unitdir}/%{?scl:%scl_prefix}nginx.service
c4323e
c4323e
# Install action scripts
c4323e
mkdir -p $RPM_BUILD_ROOT%{_root_libexecdir}/initscripts/legacy-actions/%{?scl:%scl_prefix}nginx
c4323e
for f in upgrade; do
c4323e
	install -p -m 755 $RPM_SOURCE_DIR/action-${f}.sh \
c4323e
			$RPM_BUILD_ROOT%{_root_libexecdir}/initscripts/legacy-actions/%{?scl:%scl_prefix}nginx/${f}
c4323e
	sed -i 's|\$nginxservice|%{?scl:%scl_prefix}nginx|' \
c4323e
		$RPM_BUILD_ROOT%{_root_libexecdir}/initscripts/legacy-actions/%{?scl:%scl_prefix}nginx/${f}
c4323e
	sed -i 's|\$localstatedir|%{_localstatedir}|' \
c4323e
		$RPM_BUILD_ROOT%{_root_libexecdir}/initscripts/legacy-actions/%{?scl:%scl_prefix}nginx/${f}
c4323e
	scl_reggen %{name} --cpfile %{_root_libexecdir}/initscripts/legacy-actions/%{?scl:%scl_prefix}nginx/${f}
c4323e
done
c4323e
c4323e
%else
c4323e
install -p -D -m 0755 %{SOURCE15} \
c4323e
    %{buildroot}/etc/rc.d/init.d/%{?scl:%scl_prefix}nginx
c4323e
c4323e
sed -i 's|\$sbindir|%{_sbindir}|' \
c4323e
    %{buildroot}/etc/rc.d/init.d/%{?scl:%scl_prefix}nginx
c4323e
sed -i 's|\$localstatedir|%{_localstatedir}|' \
c4323e
    %{buildroot}/etc/rc.d/init.d/%{?scl:%scl_prefix}nginx
c4323e
sed -i 's|\$sysconfdir|%{_sysconfdir}|' \
c4323e
    %{buildroot}/etc/rc.d/init.d/%{?scl:%scl_prefix}nginx
c4323e
sed -i 's|\$scl|%scl_prefix|' \
c4323e
    %{buildroot}/etc/rc.d/init.d/%{?scl:%scl_prefix}nginx
c4323e
scl_reggen %{name} --cpfile %{_root_initddir}/%{?scl:%scl_prefix}nginx
c4323e
c4323e
install -p -D -m 0644 %{SOURCE16} \
c4323e
    %{buildroot}/%{_sysconfdir}/sysconfig/%{?scl:%scl_prefix}nginx
c4323e
c4323e
sed -i 's|\$sysconfdir|%{_sysconfdir}|' \
c4323e
    %{buildroot}/%{_sysconfdir}/sysconfig/%{?scl:%scl_prefix}nginx
c4323e
scl_reggen %{name} --mkdir %{_sysconfdir}/sysconfig
c4323e
scl_reggen %{name} --cpfile %{_sysconfdir}/sysconfig/%{?scl:%scl_prefix}nginx
c4323e
%endif
c4323e
c4323e
install -p -D -m 0644 %{SOURCE11} \
c4323e
    %{buildroot}/etc/logrotate.d/%{?scl:%scl_prefix}nginx
c4323e
c4323e
sed -i 's|\$logdir|%{nginx_logdir}|' \
c4323e
    %{buildroot}/etc/logrotate.d/%{?scl:%scl_prefix}nginx
c4323e
sed -i 's|\$localstatedir|%{_localstatedir}|' \
c4323e
    %{buildroot}/etc/logrotate.d/%{?scl:%scl_prefix}nginx
c4323e
scl_reggen %{name} --cpfile %{_root_sysconfdir}/logrotate.d/%{?scl:%scl_prefix}nginx
c4323e
c4323e
install -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d
c4323e
install -p -d -m 0700 %{buildroot}%{nginx_home}
c4323e
install -p -d -m 0700 %{buildroot}%{nginx_home_tmp}
c4323e
install -p -d -m 0700 %{buildroot}%{nginx_home_tmp}/client_body
c4323e
install -p -d -m 0700 %{buildroot}%{nginx_home_tmp}/proxy
c4323e
install -p -d -m 0700 %{buildroot}%{nginx_home_tmp}/fastcgi
c4323e
install -p -d -m 0700 %{buildroot}%{nginx_home_tmp}/uwsgi
c4323e
install -p -d -m 0700 %{buildroot}%{nginx_home_tmp}/scgi
c4323e
install -p -d -m 0700 %{buildroot}%{nginx_logdir}
c4323e
install -p -d -m 0755 %{buildroot}%{nginx_webroot}
c4323e
c4323e
scl_reggen %{name} --mkdir %{nginx_confdir}/conf.d
c4323e
scl_reggen %{name} --mkdir %{nginx_home}
c4323e
scl_reggen %{name} --mkdir %{nginx_home_tmp}
c4323e
scl_reggen %{name} --mkdir %{nginx_home_tmp}/client_body
c4323e
scl_reggen %{name} --mkdir %{nginx_home_tmp}/proxy
c4323e
scl_reggen %{name} --mkdir %{nginx_home_tmp}/fastcgi
c4323e
scl_reggen %{name} --mkdir %{nginx_home_tmp}/uwsgi
c4323e
scl_reggen %{name} --mkdir %{nginx_home_tmp}/scgi
c4323e
scl_reggen %{name} --mkdir %{nginx_logdir}
c4323e
scl_reggen %{name} --mkdir %{nginx_webroot}
c4323e
c4323e
scl_reggen %{name} --chmod 0755 %{nginx_confdir}/conf.d
c4323e
scl_reggen %{name} --chmod 0700 %{nginx_home}
c4323e
scl_reggen %{name} --chmod 0700 %{nginx_home_tmp}
c4323e
scl_reggen %{name} --chmod 0700 %{nginx_home_tmp}/client_body
c4323e
scl_reggen %{name} --chmod 0700 %{nginx_home_tmp}/proxy
c4323e
scl_reggen %{name} --chmod 0700 %{nginx_home_tmp}/fastcgi
c4323e
scl_reggen %{name} --chmod 0700 %{nginx_home_tmp}/uwsgi
c4323e
scl_reggen %{name} --chmod 0700 %{nginx_home_tmp}/scgi
c4323e
scl_reggen %{name} --chmod 0700 %{nginx_logdir}
c4323e
scl_reggen %{name} --chmod 0755 %{nginx_webroot}
c4323e
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/fastcgi.conf
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/fastcgi.conf.default
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/fastcgi_params
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/fastcgi_params.default
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/koi-utf
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/koi-win
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/mime.types
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/mime.types.default
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/nginx.conf
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/nginx.conf.default
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/scgi_params
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/scgi_params.default
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/uwsgi_params
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/uwsgi_params.default
c4323e
scl_reggen %{name} --cpfile %{nginx_confdir}/win-utf
c4323e
0c2e95
0c2e95
scl_reggen %{name} --runafterregister "semanage fcontext -a -e /var/log/nginx %{nginx_logdir} >/dev/null 2>&1 || :"
0c2e95
scl_reggen %{name} --runafterregister "restorecon -R %{nginx_logdir} >/dev/null 2>&1 || :"
0c2e95
scl_reggen %{name} --runafterregister "semanage fcontext -a -e %{_root_sysconfdir}/nginx %{nginx_confdir} >/dev/null 2>&1 || :"
0c2e95
scl_reggen %{name} --runafterregister "restorecon -R %{nginx_confdir} >/dev/null 2>&1 || :"
0c2e95
scl_reggen %{name} --runafterregister "semanage fcontext -a -e %{_root_localstatedir}/lib/nginx %{_localstatedir}/lib/nginx >/dev/null 2>&1 || :"
0c2e95
scl_reggen %{name} --runafterregister "restorecon -R %{_localstatedir}/lib/nginx >/dev/null 2>&1 || :"
0c2e95
scl_reggen %{name} --runafterregister "semanage fcontext -a -e %{_root_localstatedir}/run/nginx %{_localstatedir}/run/nginx >/dev/null 2>&1 || :"
0c2e95
scl_reggen %{name} --runafterregister "restorecon -R %{_localstatedir}/run/nginx >/dev/null 2>&1 || :"
0c2e95
c4323e
install -p -m 0644 %{SOURCE12} \
c4323e
    %{buildroot}%{nginx_confdir}
c4323e
c4323e
# Change the nginx.conf paths
c4323e
sed -i 's|\$datadir|%{_datadir}|' \
c4323e
    %{buildroot}%{nginx_confdir}/nginx.conf
c4323e
sed -i 's|\$sysconfdir|%{_sysconfdir}|' \
c4323e
    %{buildroot}%{nginx_confdir}/nginx.conf
c4323e
sed -i 's|\$localstatedir|%{_localstatedir}|' \
c4323e
    %{buildroot}%{nginx_confdir}/nginx.conf
c4323e
sed -i 's|\$logdir|%{nginx_logdir}|' \
c4323e
    %{buildroot}%{nginx_confdir}/nginx.conf
c4323e
c4323e
touch -r %{SOURCE12} %{buildroot}%{nginx_confdir}/nginx.conf
c4323e
c4323e
install -p -m 0644 %{SOURCE100} \
c4323e
    %{buildroot}%{nginx_webroot}
c4323e
install -p -m 0644 %{SOURCE101} %{SOURCE102} \
c4323e
    %{buildroot}%{nginx_webroot}
c4323e
install -p -m 0644 %{SOURCE103} %{SOURCE104} \
c4323e
    %{buildroot}%{nginx_webroot}
c4323e
c4323e
install -p -D -m 0644 %{_builddir}/nginx-%{version}/man/nginx.8 \
c4323e
    %{buildroot}%{_mandir}/man8/nginx.8
c4323e
c4323e
%if 0%{?scl:1} && 0%{?use_perl}
c4323e
# pm man page is installed to bad directory for some reason... Move it to
c4323e
# the proper one.
c4323e
mkdir -p %{buildroot}%{_mandir}/man3/
c4323e
mv %{buildroot}/usr/share/man/man3/* %{buildroot}%{_mandir}/man3/
c4323e
%endif
c4323e
c4323e
mkdir -p %{buildroot}%{_localstatedir}/run/nginx
c4323e
c4323e
# Replaces variables in man page with proper values
c4323e
sed -i 's|\%\%PREFIX\%\%|%{nginx_datadir}|' \
c4323e
    %{buildroot}%{_mandir}/man8/nginx.8
c4323e
sed -i 's|\%\%PID_PATH\%\%|%{_localstatedir}/run/nginx/nginx.pid|' \
c4323e
    %{buildroot}%{_mandir}/man8/nginx.8
c4323e
sed -i 's|\%\%CONF_PATH\%\%|%{nginx_confdir}/nginx.conf|' \
c4323e
    %{buildroot}%{_mandir}/man8/nginx.8
c4323e
sed -i 's|\%\%ERROR_LOG_PATH\%\%|%{nginx_logdir}/error.log|' \
c4323e
    %{buildroot}%{_mandir}/man8/nginx.8
c4323e
c4323e
%pre
c4323e
getent group %{nginx_group} > /dev/null || groupadd -r %{nginx_group}
c4323e
getent passwd %{nginx_user} > /dev/null || \
c4323e
    useradd -r -d %{nginx_home} -g %{nginx_group} \
c4323e
    -s /sbin/nologin -c "Nginx web server" %{nginx_user}
c4323e
exit 0
c4323e
c4323e
%post
c4323e
restorecon -R %{_scl_root} >/dev/null 2>&1 || :
c4323e
semanage fcontext -a -e /var/log/nginx %{nginx_logdir} >/dev/null 2>&1 || :
c4323e
restorecon -R %{nginx_logdir} >/dev/null 2>&1 || :
0c2e95
0c2e95
semanage fcontext -a -e %{_root_sysconfdir}/nginx %{nginx_confdir} >/dev/null 2>&1 || :
0c2e95
restorecon -R %{nginx_confdir} >/dev/null 2>&1 || :
0c2e95
0c2e95
semanage fcontext -a -e %{_root_localstatedir}/lib/nginx %{_localstatedir}/lib/nginx >/dev/null 2>&1 || :
0c2e95
restorecon -R %{_localstatedir}/lib/nginx >/dev/null 2>&1 || :
0c2e95
0c2e95
semanage fcontext -a -e %{_root_localstatedir}/run/nginx %{_localstatedir}/run/nginx >/dev/null 2>&1 || :
0c2e95
restorecon -R %{_localstatedir}/run/nginx >/dev/null 2>&1 || :
0c2e95
c4323e
%if %{use_systemd}
c4323e
%systemd_post %{service_name}.service
c4323e
%else
c4323e
semanage fcontext -a -e /etc/rc.d/init.d/nginx /etc/rc.d/init.d/%{?scl:%scl_prefix}nginx >/dev/null 2>&1 || :
c4323e
restorecon -R /etc/rc.d/init.d/%{?scl:%scl_prefix}nginx >/dev/null 2>&1 || :
c4323e
if [ $1 -eq 1 ]; then
c4323e
    /sbin/chkconfig --add %{name}
c4323e
fi
c4323e
%endif
c4323e
if [ $1 -eq 2 ]; then
c4323e
    # Make sure these directories are not world readable.
c4323e
    chmod 700 %{nginx_home}
c4323e
    chmod -R 700 %{nginx_home_tmp}
c4323e
    chmod 700 %{nginx_logdir}
c4323e
fi
c4323e
c4323e
%preun
c4323e
%if %{use_systemd}
c4323e
%systemd_preun %{service_name}.service
c4323e
%else
c4323e
if [ $1 -eq 0 ]; then
c4323e
    /sbin/service %{name} stop >/dev/null 2>&1
c4323e
    /sbin/chkconfig --del %{name}
c4323e
fi
c4323e
%endif
c4323e
c4323e
%postun
c4323e
%if %{use_systemd}
c4323e
%systemd_postun %{service_name}.service
c4323e
%else
c4323e
if [ $1 -eq 2 ]; then
c4323e
    /sbin/service %{name} upgrade || :
c4323e
fi
c4323e
%endif
c4323e
c4323e
%files
c4323e
%doc LICENSE CHANGES README
c4323e
%{nginx_datadir}/
c4323e
%{_sbindir}/nginx
c4323e
%if 0%{?use_perl}
c4323e
%{_mandir}/man3/nginx.3pm*
c4323e
%endif
c4323e
%{_mandir}/man8/nginx.8*
c4323e
%if %{use_systemd}
c4323e
%{_unitdir}/%{service_name}.service
c4323e
%dir %{_root_libexecdir}/initscripts/legacy-actions/%{?scl:%scl_prefix}nginx
c4323e
%{_root_libexecdir}/initscripts/legacy-actions/%{?scl:%scl_prefix}nginx/*
c4323e
%else
c4323e
/etc/rc.d/init.d/%{?scl:%scl_prefix}nginx
c4323e
%config(noreplace) %{_sysconfdir}/sysconfig/%{?scl:%scl_prefix}nginx
c4323e
%endif
c4323e
%dir %{nginx_confdir}
c4323e
%dir %{nginx_confdir}/conf.d
c4323e
%config(noreplace) %{nginx_confdir}/fastcgi.conf
c4323e
%config(noreplace) %{nginx_confdir}/fastcgi.conf.default
c4323e
%config(noreplace) %{nginx_confdir}/fastcgi_params
c4323e
%config(noreplace) %{nginx_confdir}/fastcgi_params.default
c4323e
%config(noreplace) %{nginx_confdir}/koi-utf
c4323e
%config(noreplace) %{nginx_confdir}/koi-win
c4323e
%config(noreplace) %{nginx_confdir}/mime.types
c4323e
%config(noreplace) %{nginx_confdir}/mime.types.default
c4323e
%config(noreplace) %{nginx_confdir}/nginx.conf
c4323e
%config(noreplace) %{nginx_confdir}/nginx.conf.default
c4323e
%config(noreplace) %{nginx_confdir}/scgi_params
c4323e
%config(noreplace) %{nginx_confdir}/scgi_params.default
c4323e
%config(noreplace) %{nginx_confdir}/uwsgi_params
c4323e
%config(noreplace) %{nginx_confdir}/uwsgi_params.default
c4323e
%config(noreplace) %{nginx_confdir}/win-utf
c4323e
%config(noreplace) /etc/logrotate.d/%{?scl:%scl_prefix}nginx
c4323e
%if 0%{?use_perl}
c4323e
%dir %{perl_vendorarch}/auto/nginx
c4323e
%{perl_vendorarch}/nginx.pm
c4323e
%{perl_vendorarch}/auto/nginx/nginx.so
c4323e
%endif
c4323e
%attr(700,%{nginx_user},%{nginx_group}) %dir %{nginx_home}
c4323e
%attr(700,%{nginx_user},%{nginx_group}) %{nginx_home_tmp}
c4323e
%attr(700,%{nginx_user},%{nginx_group}) %dir %{nginx_logdir}
c4323e
%attr(700,%{nginx_user},%{nginx_group}) %dir %{_localstatedir}/run/nginx
c4323e
c4323e
%{?scl: %{_scl_scripts}/register.d/*}
c4323e
%{?scl: %{_scl_scripts}/register.content/*}
c4323e
%{?scl: %{_scl_scripts}/deregister.d/*}
c4323e
c4323e
%changelog
82925c
* Mon Jun 20 2016 Joe Orton <jorton@redhat.com> - 1:1.8.1-1
82925c
- update to 1.8.1 (CVE-2016-0742 CVE-2016-0746 CVE-2016-0747)
82925c
- add security fix for CVE-2016-4450
82925c
0c2e95
* Fri Nov 13 2015 Jan Kaluza <jkaluza@redhat.com> - 1:1.8.0-4
0c2e95
- fix SELinux context of /var/opt and /etc/opt directories (#1280221)
0c2e95
c4323e
* Fri Sep 11 2015 Jan Kaluza <jkaluza@redhat.com> - 1:1.8.0-3
c4323e
- fix bad path to nginx.pid in logrotate configuration (#1260595)
c4323e
c4323e
* Tue Aug 11 2015 Jan Kaluza <jkaluza@redhat.com> - 1:1.8.0-2
c4323e
- move logs to /var/opt/rh/rh-nginx18/log (#1250095)
c4323e
c4323e
* Wed Jul 08 2015 Jan Kaluza <jkaluza@redhat.com> - 1:1.8.0-1
c4323e
- update to version 1.8.0
c4323e
c4323e
* Wed Jan 21 2015 Jan Kaluza <jkaluza@redhat.com> - 1:1.6.2-3
c4323e
- set use_systemd only on RHEL7
c4323e
c4323e
* Mon Jan 19 2015 Jan Kaluza <jkaluza@redhat.com> - 1:1.6.2-2
c4323e
- add support for Phusion Passenger
c4323e
c4323e
* Tue Jan 06 2015 Jan Kaluza <jkaluza@redhat.com> - 1:1.6.2-1
c4323e
- update to version 1.6.2
c4323e
- do not use conditionals in systemd macros (#1152514)
c4323e
c4323e
* Wed Sep 17 2014 Jan Kaluza <jkaluza@redhat.com> - 1:1.6.1-2
c4323e
- prevent SSL session reuse in unrelated server{} blocks (CVE-2014-3616)
c4323e
c4323e
* Wed Aug 06 2014 Jan Kaluza <jkaluza@redhat.com> - 1:1.6.1-1
c4323e
- update to 1.6.1 (CVE-2014-3556)
c4323e
c4323e
* Wed Jul 02 2014 Jan Kaluza <jkaluza@redhat.com> - 1:1.6.0-4
c4323e
- correct the path for previous SELinux fix (#1088912)
c4323e
c4323e
* Wed Jul 02 2014 Jan Kaluza <jkaluza@redhat.com> - 1:1.6.0-3
c4323e
- fix SELinux context of initscript (#1088912)
c4323e
c4323e
* Tue Jun 24 2014 Jan Kaluza <jkaluza@redhat.com> - 1:1.6.0-2
c4323e
- rebuild because of rename to nginx16
c4323e
c4323e
* Mon Jun  9 2014 Joe Orton <jorton@redhat.com> - 1:1.6.0-1
c4323e
- update to 1.6.0 (#1101921)
c4323e
c4323e
* Tue Mar  4 2014 Joe Orton <jorton@redhat.com> - 1:1.4.4-10
c4323e
- run restorecon in %%post for #1072266
c4323e
c4323e
* Tue Mar  4 2014 Joe Orton <jorton@redhat.com> - 1:1.4.4-9
c4323e
- fix SELinux context for log directory (#1072266)
c4323e
c4323e
* Thu Feb 20 2014 Jan Kaluza <jkaluza@redhat.com> - 1:1.4.4-8
c4323e
- update poweredby logo and show it on default pages (#1065981)
c4323e
c4323e
* Wed Jan 15 2014 Jan Kaluza <jkaluza@redhat.com> - 1:1.4.4-7
c4323e
- call restorecon in post script (#1052935)
c4323e
c4323e
* Mon Jan 06 2014 Jan Kaluza <jkaluza@redhat.com> - 1:1.4.4-6
c4323e
- create temp subdirectories in nginx_home_tmp during installation (#1040470)
c4323e
c4323e
* Tue Nov 26 2013 Joe Orton <jorton@redhat.com> - 1:1.4.4-5
c4323e
- further default config tweak
c4323e
c4323e
* Tue Nov 26 2013 Joe Orton <jorton@redhat.com> - 1:1.4.4-4
c4323e
- update config file for log directory
c4323e
c4323e
* Tue Nov 26 2013 Joe Orton <jorton@redhat.com> - 1:1.4.4-3
c4323e
- change log directory
c4323e
c4323e
* Tue Nov 19 2013 Joe Orton <jorton@redhat.com> - 1:1.4.4-1
c4323e
- update to 1.4.4 (CVE-2013-4547)
c4323e
c4323e
* Mon Nov 18 2013 Jan Kaluza <jkaluza@redhat.com> - 1:1.4.2-6
c4323e
- require scl_runtime
c4323e
c4323e
* Mon Nov 18 2013 Jan Kaluza <jkaluza@redhat.com> - 1:1.4.2-5
c4323e
- improved index.html
c4323e
c4323e
* Mon Nov 18 2013 Jan Kaluza <jkaluza@redhat.com> - 1:1.4.2-4
c4323e
- support for software collections
c4323e
c4323e
* Fri Aug 09 2013 Jonathan Steffan <jsteffan@fedoraproject.org> - 1:1.4.2-3
c4323e
- Add in conditionals to build for non-systemd targets
c4323e
c4323e
* Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 1:1.4.2-2
c4323e
- Perl 5.18 rebuild
c4323e
c4323e
* Fri Jul 19 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.4.2-1
c4323e
- update to upstream release 1.4.2
c4323e
c4323e
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 1:1.4.1-3
c4323e
- Perl 5.18 rebuild
c4323e
c4323e
* Tue Jun 11 2013 Remi Collet <rcollet@redhat.com> - 1:1.4.1-2
c4323e
- rebuild for new GD 2.1.0
c4323e
c4323e
* Tue May 07 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.4.1-1
c4323e
- update to upstream release 1.4.1 (#960605, #960606):
c4323e
  CVE-2013-2028 stack-based buffer overflow when handling certain chunked
c4323e
  transfer encoding requests
c4323e
c4323e
* Sun Apr 28 2013 Dan Horák <dan[at]danny.cz> - 1:1.4.0-2
c4323e
- gperftools exist only on selected arches
c4323e
c4323e
* Fri Apr 26 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.4.0-1
c4323e
- update to upstream release 1.4.0
c4323e
- enable SPDY module (new in this version)
c4323e
- enable http gunzip module (new in this version)
c4323e
- enable google perftools module and add gperftools-devel to BR
c4323e
- enable debugging (#956845)
c4323e
- trim changelog
c4323e
c4323e
* Tue Apr 02 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.8-1
c4323e
- update to upstream release 1.2.8
c4323e
c4323e
* Fri Feb 22 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.7-2
c4323e
- make sure nginx directories are not world readable (#913724, #913735)
c4323e
c4323e
* Sat Feb 16 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.7-1
c4323e
- update to upstream release 1.2.7
c4323e
- add .asc file
c4323e
c4323e
* Tue Feb 05 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.6-6
c4323e
- use 'kill' instead of 'systemctl' when rotating log files to workaround
c4323e
  SELinux issue (#889151)
c4323e
c4323e
* Wed Jan 23 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.6-5
c4323e
- uncomment "include /etc/nginx/conf.d/*.conf by default but leave the
c4323e
  conf.d directory empty (#903065)
c4323e
c4323e
* Wed Jan 23 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.6-4
c4323e
- add comment in nginx.conf regarding "include /etc/nginf/conf.d/*.conf"
c4323e
  (#903065)
c4323e
c4323e
* Wed Dec 19 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.6-3
c4323e
- use correct file ownership when rotating log files
c4323e
c4323e
* Tue Dec 18 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.6-2
c4323e
- send correct kill signal and use correct file permissions when rotating
c4323e
  log files (#888225)
c4323e
- send correct kill signal in nginx-upgrade
c4323e
c4323e
* Tue Dec 11 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.6-1
c4323e
- update to upstream release 1.2.6
c4323e
c4323e
* Sat Nov 17 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.5-1
c4323e
- update to upstream release 1.2.5
c4323e
c4323e
* Sun Oct 28 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.4-1
c4323e
- update to upstream release 1.2.4
c4323e
- introduce new systemd-rpm macros (#850228)
c4323e
- link to official documentation not the community wiki (#870733)
c4323e
- do not run systemctl try-restart after package upgrade to allow the
c4323e
  administrator to run nginx-upgrade and avoid downtime
c4323e
- add nginx man page (#870738)
c4323e
- add nginx-upgrade man page and remove README.fedora
c4323e
- remove chkconfig from Requires(post/preun)
c4323e
- remove initscripts from Requires(preun/postun)
c4323e
- remove separate configuration files in "/etc/nginx/conf.d" directory
c4323e
  and revert to upstream default of a centralized nginx.conf file
c4323e
  (#803635) (#842738)
c4323e
c4323e
* Fri Sep 21 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.3-1
c4323e
- update to upstream release 1.2.3
c4323e
c4323e
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.2.1-3
c4323e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c4323e
c4323e
* Thu Jun 28 2012 Petr Pisar <ppisar@redhat.com> - 1:1.2.1-2
c4323e
- Perl 5.16 rebuild
c4323e
c4323e
* Sun Jun 10 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.1-1
c4323e
- update to upstream release 1.2.1
c4323e
c4323e
* Fri Jun 08 2012 Petr Pisar <ppisar@redhat.com> - 1:1.2.0-2
c4323e
- Perl 5.16 rebuild
c4323e
c4323e
* Wed May 16 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.2.0-1
c4323e
- update to upstream release 1.2.0
c4323e
c4323e
* Wed May 16 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.15-4
c4323e
- add nginx-upgrade to replace functionality from the nginx initscript
c4323e
  that was lost after migration to systemd
c4323e
- add README.fedora to describe usage of nginx-upgrade
c4323e
- nginx.logrotate: use built-in systemd kill command in postrotate script
c4323e
- nginx.service: start after syslog.target and network.target
c4323e
- nginx.service: remove unnecessary references to config file location
c4323e
- nginx.service: use /bin/kill instead of "/usr/sbin/nginx -s" following
c4323e
  advice from nginx-devel
c4323e
- nginx.service: use private /tmp
c4323e
c4323e
* Mon May 14 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.15-3
c4323e
- fix incorrect postrotate script in nginx.logrotate
c4323e
c4323e
* Thu Apr 19 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.15-2
c4323e
- renable auto-cc-gcc patch due to warnings on rawhide
c4323e
c4323e
* Sat Apr 14 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.15-1
c4323e
- update to upstream release 1.0.15
c4323e
- no need to apply auto-cc-gcc patch
c4323e
- add %%global _hardened_build 1
c4323e
c4323e
* Thu Mar 15 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.14-1
c4323e
- update to upstream release 1.0.14
c4323e
- amend some %%changelog formatting
c4323e
c4323e
* Tue Mar 06 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.13-1
c4323e
- update to upstream release 1.0.13
c4323e
- amend --pid-path and --log-path
c4323e
c4323e
* Sun Mar 04 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.12-5
c4323e
- change pid path in nginx.conf to match systemd service file
c4323e
c4323e
* Sun Mar 04 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.12-3
c4323e
- fix %%pre scriptlet
c4323e
c4323e
* Mon Feb 20 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 1:1.0.12-2
c4323e
- update upstream URL
c4323e
- replace %%define with %%global
c4323e
- remove obsolete BuildRoot tag, %%clean section and %%defattr
c4323e
- remove various unnecessary commands
c4323e
- add systemd service file and update scriptlets
c4323e
- add Epoch to accommodate %%triggerun as part of systemd migration
c4323e
c4323e
* Sun Feb 19 2012 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.0.12-1
c4323e
- Update to 1.0.12
c4323e
c4323e
* Thu Nov 17 2011 Keiran "Affix" Smith <fedora@affix.me> - 1.0.10-1
c4323e
- Bugfix: a segmentation fault might occur in a worker process if resolver got a big DNS response. Thanks to Ben Hawkes.
c4323e
- Bugfix: in cache key calculation if internal MD5 implementation wasused; the bug had appeared in 1.0.4.
c4323e
- Bugfix: the module ngx_http_mp4_module sent incorrect "Content-Length" response header line if the "start" argument was used. Thanks to Piotr Sikora.
c4323e
c4323e
* Thu Oct 27 2011 Keiran "Affix" Smith <fedora@affix.me> - 1.0.8-1
c4323e
- Update to new 1.0.8 stable release
c4323e
c4323e
* Fri Aug 26 2011 Keiran "Affix" Smith <fedora@affix.me> - 1.0.5-1
c4323e
- Update nginx to Latest Stable Release
c4323e
c4323e
* Fri Jun 17 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.0.0-3
c4323e
- Perl mass rebuild
c4323e
c4323e
* Thu Jun 09 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.0.0-2
c4323e
- Perl 5.14 mass rebuild
c4323e
c4323e
* Wed Apr 27 2011 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.0.0-1
c4323e
- Update to 1.0.0
c4323e
c4323e
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.53-6
c4323e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
c4323e
c4323e
* Sun Dec 12 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.8.53.5
c4323e
- Extract out default config into its own file (bug #635776)
c4323e
c4323e
* Sun Dec 12 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.8.53-4
c4323e
- Revert ownership of log dir
c4323e
c4323e
* Sun Dec 12 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.8.53-3
c4323e
- Change ownership of /var/log/nginx to be 0700 nginx:nginx
c4323e
- update init script to use killproc -p
c4323e
- add reopen_logs command to init script
c4323e
- update init script to use nginx -q option
c4323e
c4323e
* Sun Oct 31 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.8.53-2
c4323e
- Fix linking of perl module
c4323e
c4323e
* Sun Oct 31 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.8.53-1
c4323e
- Update to new stable 0.8.53
c4323e
c4323e
* Sat Jul 31 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.7.67-2
c4323e
- add Provides: webserver (bug #619693)
c4323e
c4323e
* Sun Jun 20 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.7.67-1
c4323e
- Update to new stable 0.7.67
c4323e
- fix bugzilla #591543
c4323e
c4323e
* Tue Jun 01 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.7.65-2
c4323e
- Mass rebuild with perl-5.12.0
c4323e
c4323e
* Mon Feb 15 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.7.65-1
c4323e
- Update to new stable 0.7.65
c4323e
- change ownership of logdir to root:root
c4323e
- add support for ipv6 (bug #561248)
c4323e
- add random_index_module
c4323e
- add secure_link_module
c4323e
c4323e
* Fri Dec 04 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.7.64-1
c4323e
- Update to new stable 0.7.64