2012-04-19 15:35:35 +00:00
|
|
|
%global _hardened_build 1
|
2012-02-22 15:15:49 +00:00
|
|
|
%global nginx_user nginx
|
|
|
|
|
2018-01-24 11:52:35 +00:00
|
|
|
# Disable strict symbol checks in the link editor.
|
|
|
|
# See: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af19
|
|
|
|
%undefine _strict_symbol_defs_build
|
|
|
|
|
2018-07-30 16:09:08 +00:00
|
|
|
%bcond_with geoip
|
2018-07-19 09:22:19 +00:00
|
|
|
|
2022-10-19 16:10:40 +00:00
|
|
|
# nginx gperftools support should be disabled for RHEL >= 8
|
2021-02-22 16:59:18 +00:00
|
|
|
# see: https://bugzilla.redhat.com/show_bug.cgi?id=1931402
|
|
|
|
%if 0%{?rhel} >= 8
|
|
|
|
%global with_gperftools 0
|
|
|
|
%else
|
2022-10-19 16:10:40 +00:00
|
|
|
# gperftools exists only on selected arches
|
2017-10-24 07:32:28 +00:00
|
|
|
# gperftools *detection* is failing on ppc64*, possibly only configure
|
|
|
|
# bug, but disable anyway.
|
|
|
|
%ifnarch s390 s390x ppc64 ppc64le
|
2015-10-04 05:56:54 +00:00
|
|
|
%global with_gperftools 1
|
2013-04-28 09:00:10 +00:00
|
|
|
%endif
|
2021-02-22 16:59:18 +00:00
|
|
|
%endif
|
2013-04-28 09:00:10 +00:00
|
|
|
|
2015-10-04 05:56:54 +00:00
|
|
|
%global with_aio 1
|
2014-07-02 16:29:22 +00:00
|
|
|
|
2020-04-24 01:41:22 +00:00
|
|
|
%if 0%{?fedora} > 22
|
2015-10-04 05:56:54 +00:00
|
|
|
%global with_mailcap_mimetypes 1
|
2015-09-25 06:16:03 +00:00
|
|
|
%endif
|
|
|
|
|
2022-10-19 16:10:40 +00:00
|
|
|
# kTLS requires OpenSSL 3.0 (default in F36+ and EL9+, available in EPEL8)
|
|
|
|
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 8
|
|
|
|
%global with_ktls 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Build against OpenSSL 1.1 on EL7
|
|
|
|
%if 0%{?rhel} == 7
|
|
|
|
%global openssl_pkgversion 11
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Build against OpenSSL 3 on EL8
|
|
|
|
%if 0%{?rhel} == 8
|
|
|
|
%global openssl_pkgversion 3
|
|
|
|
%endif
|
|
|
|
|
2021-08-10 16:30:05 +00:00
|
|
|
# Cf. https://www.nginx.com/blog/creating-installable-packages-dynamic-modules/
|
|
|
|
%global nginx_abiversion %{version}
|
|
|
|
|
|
|
|
%global nginx_moduledir %{_libdir}/nginx/modules
|
|
|
|
%global nginx_moduleconfdir %{_datadir}/nginx/modules
|
|
|
|
%global nginx_srcdir %{_usrsrc}/%{name}-%{version}-%{release}
|
|
|
|
|
|
|
|
# Do not generate provides/requires from nginx sources
|
|
|
|
%global __provides_exclude_from ^%{nginx_srcdir}/.*$
|
|
|
|
%global __requires_exclude_from ^%{nginx_srcdir}/.*$
|
|
|
|
|
|
|
|
|
2012-02-22 15:15:49 +00:00
|
|
|
Name: nginx
|
2015-08-12 08:29:13 +00:00
|
|
|
Epoch: 1
|
2023-04-11 21:31:15 +00:00
|
|
|
Version: 1.24.0
|
2023-04-11 21:25:55 +00:00
|
|
|
Release: %autorelease
|
2012-02-22 15:15:49 +00:00
|
|
|
|
|
|
|
Summary: A high performance web server and reverse proxy server
|
2007-08-18 18:22:11 +00:00
|
|
|
# BSD License (two clause)
|
2007-08-18 00:48:07 +00:00
|
|
|
# http://www.freebsd.org/copyright/freebsd-license.html
|
2012-02-22 15:15:49 +00:00
|
|
|
License: BSD
|
2020-04-24 01:41:22 +00:00
|
|
|
URL: https://nginx.org
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2017-08-15 08:12:38 +00:00
|
|
|
Source0: https://nginx.org/download/nginx-%{version}.tar.gz
|
2020-04-24 01:41:22 +00:00
|
|
|
Source1: https://nginx.org/download/nginx-%{version}.tar.gz.asc
|
|
|
|
# Keys are found here: https://nginx.org/en/pgp_keys.html
|
2021-04-21 01:59:53 +00:00
|
|
|
Source2: https://nginx.org/keys/maxim.key
|
|
|
|
Source3: https://nginx.org/keys/mdounin.key
|
|
|
|
Source4: https://nginx.org/keys/sb.key
|
2022-05-25 11:59:56 +00:00
|
|
|
Source5: https://nginx.org/keys/thresh.key
|
2013-02-16 08:52:47 +00:00
|
|
|
Source10: nginx.service
|
|
|
|
Source11: nginx.logrotate
|
|
|
|
Source12: nginx.conf
|
|
|
|
Source13: nginx-upgrade
|
|
|
|
Source14: nginx-upgrade.8
|
2021-08-10 16:30:05 +00:00
|
|
|
Source15: macros.nginxmods.in
|
|
|
|
Source16: nginxmods.attr
|
2012-02-22 15:15:49 +00:00
|
|
|
Source102: nginx-logo.png
|
|
|
|
Source103: 404.html
|
|
|
|
Source104: 50x.html
|
2016-07-02 18:48:53 +00:00
|
|
|
Source200: README.dynamic
|
2016-07-02 15:16:54 +00:00
|
|
|
Source210: UPGRADE-NOTES-1.6-to-1.10
|
2007-03-24 18:31:48 +00:00
|
|
|
|
|
|
|
# removes -Werror in upstream build scripts. -Werror conflicts with
|
|
|
|
# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
|
2021-04-21 01:59:53 +00:00
|
|
|
Patch0: 0001-remove-Werror-in-upstream-build-scripts.patch
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2021-04-21 01:59:53 +00:00
|
|
|
# downstream patch - fix PIDFile race condition (rhbz#1869026)
|
|
|
|
# rejected upstream: https://trac.nginx.org/nginx/ticket/1897
|
2021-04-21 15:47:30 +00:00
|
|
|
Patch1: 0002-fix-PIDFile-handling.patch
|
2021-04-21 01:59:53 +00:00
|
|
|
|
|
|
|
BuildRequires: make
|
2018-07-16 13:20:11 +00:00
|
|
|
BuildRequires: gcc
|
2020-04-24 01:41:22 +00:00
|
|
|
BuildRequires: gnupg2
|
2013-04-28 09:00:10 +00:00
|
|
|
%if 0%{?with_gperftools}
|
2013-04-26 20:21:15 +00:00
|
|
|
BuildRequires: gperftools-devel
|
2013-04-28 09:00:10 +00:00
|
|
|
%endif
|
2022-10-19 16:10:40 +00:00
|
|
|
BuildRequires: openssl%{?openssl_pkgversion}-devel
|
2022-05-25 11:59:56 +00:00
|
|
|
BuildRequires: pcre2-devel
|
2012-02-22 15:15:49 +00:00
|
|
|
BuildRequires: zlib-devel
|
2014-09-22 11:07:39 +00:00
|
|
|
|
|
|
|
Requires: nginx-filesystem = %{epoch}:%{version}-%{release}
|
2019-09-15 09:32:10 +00:00
|
|
|
%if 0%{?el7}
|
|
|
|
# centos-logos el7 does not provide 'system-indexhtml'
|
|
|
|
Requires: system-logos redhat-indexhtml
|
|
|
|
# need to remove epel7 geoip sub-package, doesn't work anymore
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1576034
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1664957
|
|
|
|
Obsoletes: nginx-mod-http-geoip <= 1:1.16
|
|
|
|
%else
|
2019-05-14 18:58:45 +00:00
|
|
|
Requires: system-logos-httpd
|
2019-09-15 09:32:10 +00:00
|
|
|
%endif
|
2016-04-19 08:34:43 +00:00
|
|
|
|
2013-08-09 17:28:28 +00:00
|
|
|
Provides: webserver
|
2021-04-21 15:47:30 +00:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
2020-04-24 01:41:22 +00:00
|
|
|
Recommends: logrotate
|
2021-04-21 15:47:30 +00:00
|
|
|
%endif
|
2022-03-25 14:19:21 +00:00
|
|
|
Requires: %{name}-core = %{epoch}:%{version}-%{release}
|
2013-08-09 17:28:28 +00:00
|
|
|
|
|
|
|
BuildRequires: systemd
|
2012-10-28 15:24:09 +00:00
|
|
|
Requires(post): systemd
|
|
|
|
Requires(preun): systemd
|
|
|
|
Requires(postun): systemd
|
2021-08-10 16:30:05 +00:00
|
|
|
# For external nginx modules
|
|
|
|
Provides: nginx(abi) = %{nginx_abiversion}
|
2007-03-24 18:31:48 +00:00
|
|
|
|
|
|
|
%description
|
2012-02-22 15:15:49 +00:00
|
|
|
Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and
|
|
|
|
IMAP protocols, with a strong focus on high concurrency, performance and low
|
|
|
|
memory usage.
|
|
|
|
|
2022-03-25 14:19:21 +00:00
|
|
|
%package core
|
|
|
|
Summary: nginx minimal core
|
|
|
|
%if 0%{?with_mailcap_mimetypes}
|
|
|
|
Requires: nginx-mimetypes
|
|
|
|
%endif
|
2022-10-19 16:10:40 +00:00
|
|
|
Requires: openssl%{?openssl_pkgversion}-libs
|
2022-03-25 14:19:21 +00:00
|
|
|
Requires(pre): nginx-filesystem
|
2022-06-27 22:46:27 +00:00
|
|
|
Conflicts: nginx < 1:1.20.2-4
|
2022-03-25 14:19:21 +00:00
|
|
|
|
|
|
|
%description core
|
|
|
|
nginx minimal core
|
|
|
|
|
2016-04-19 08:34:43 +00:00
|
|
|
%package all-modules
|
|
|
|
Summary: A meta package that installs all available Nginx modules
|
|
|
|
BuildArch: noarch
|
|
|
|
|
2018-07-19 09:22:19 +00:00
|
|
|
%if %{with geoip}
|
2016-04-19 08:34:43 +00:00
|
|
|
Requires: nginx-mod-http-geoip = %{epoch}:%{version}-%{release}
|
2018-07-19 09:22:19 +00:00
|
|
|
%endif
|
2016-04-19 08:34:43 +00:00
|
|
|
Requires: nginx-mod-http-image-filter = %{epoch}:%{version}-%{release}
|
|
|
|
Requires: nginx-mod-http-perl = %{epoch}:%{version}-%{release}
|
|
|
|
Requires: nginx-mod-http-xslt-filter = %{epoch}:%{version}-%{release}
|
|
|
|
Requires: nginx-mod-mail = %{epoch}:%{version}-%{release}
|
|
|
|
Requires: nginx-mod-stream = %{epoch}:%{version}-%{release}
|
|
|
|
|
|
|
|
%description all-modules
|
2019-03-04 18:22:38 +00:00
|
|
|
Meta package that installs all available nginx modules.
|
2016-04-19 08:34:43 +00:00
|
|
|
|
2014-09-22 11:07:39 +00:00
|
|
|
%package filesystem
|
|
|
|
Summary: The basic directory layout for the Nginx server
|
|
|
|
BuildArch: noarch
|
|
|
|
Requires(pre): shadow-utils
|
|
|
|
|
|
|
|
%description filesystem
|
|
|
|
The nginx-filesystem package contains the basic directory layout
|
|
|
|
for the Nginx server including the correct permissions for the
|
|
|
|
directories.
|
|
|
|
|
2018-07-19 09:22:19 +00:00
|
|
|
%if %{with geoip}
|
2016-04-19 08:34:43 +00:00
|
|
|
%package mod-http-geoip
|
|
|
|
Summary: Nginx HTTP geoip module
|
|
|
|
BuildRequires: GeoIP-devel
|
2021-08-10 16:30:05 +00:00
|
|
|
Requires: nginx(abi) = %{nginx_abiversion}
|
2016-04-19 08:34:43 +00:00
|
|
|
Requires: GeoIP
|
|
|
|
|
|
|
|
%description mod-http-geoip
|
|
|
|
%{summary}.
|
2018-07-19 09:22:19 +00:00
|
|
|
%endif
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%package mod-http-image-filter
|
|
|
|
Summary: Nginx HTTP image filter module
|
|
|
|
BuildRequires: gd-devel
|
2021-08-10 16:30:05 +00:00
|
|
|
Requires: nginx(abi) = %{nginx_abiversion}
|
2016-04-19 08:34:43 +00:00
|
|
|
Requires: gd
|
|
|
|
|
|
|
|
%description mod-http-image-filter
|
|
|
|
%{summary}.
|
|
|
|
|
|
|
|
%package mod-http-perl
|
|
|
|
Summary: Nginx HTTP perl module
|
|
|
|
BuildRequires: perl-devel
|
2019-09-15 09:32:10 +00:00
|
|
|
%if 0%{?fedora} >= 24 || 0%{?rhel} >= 7
|
2016-06-24 07:30:25 +00:00
|
|
|
BuildRequires: perl-generators
|
2016-07-02 15:07:00 +00:00
|
|
|
%endif
|
2016-04-19 08:34:43 +00:00
|
|
|
BuildRequires: perl(ExtUtils::Embed)
|
2021-08-10 16:30:05 +00:00
|
|
|
Requires: nginx(abi) = %{nginx_abiversion}
|
2018-08-06 11:36:24 +00:00
|
|
|
Requires: perl(constant)
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%description mod-http-perl
|
|
|
|
%{summary}.
|
|
|
|
|
|
|
|
%package mod-http-xslt-filter
|
|
|
|
Summary: Nginx XSLT module
|
|
|
|
BuildRequires: libxslt-devel
|
2021-08-10 16:30:05 +00:00
|
|
|
Requires: nginx(abi) = %{nginx_abiversion}
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%description mod-http-xslt-filter
|
|
|
|
%{summary}.
|
|
|
|
|
|
|
|
%package mod-mail
|
|
|
|
Summary: Nginx mail modules
|
2021-08-10 16:30:05 +00:00
|
|
|
Requires: nginx(abi) = %{nginx_abiversion}
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%description mod-mail
|
|
|
|
%{summary}.
|
|
|
|
|
|
|
|
%package mod-stream
|
|
|
|
Summary: Nginx stream modules
|
2021-08-10 16:30:05 +00:00
|
|
|
Requires: nginx(abi) = %{nginx_abiversion}
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%description mod-stream
|
|
|
|
%{summary}.
|
|
|
|
|
2021-08-10 16:30:05 +00:00
|
|
|
%package mod-devel
|
|
|
|
Summary: Nginx module development files
|
|
|
|
Requires: nginx = %{epoch}:%{version}-%{release}
|
|
|
|
Requires: make
|
|
|
|
Requires: gcc
|
|
|
|
Requires: gd-devel
|
|
|
|
%if 0%{?with_gperftools}
|
|
|
|
Requires: gperftools-devel
|
|
|
|
%endif
|
|
|
|
%if %{with geoip}
|
|
|
|
Requires: GeoIP-devel
|
|
|
|
%endif
|
|
|
|
Requires: libxslt-devel
|
2022-10-19 16:10:40 +00:00
|
|
|
Requires: openssl%{?openssl_pkgversion}-devel
|
2022-05-25 11:59:56 +00:00
|
|
|
Requires: pcre2-devel
|
2021-08-10 16:30:05 +00:00
|
|
|
Requires: perl-devel
|
|
|
|
Requires: perl(ExtUtils::Embed)
|
|
|
|
Requires: zlib-devel
|
|
|
|
|
|
|
|
%description mod-devel
|
|
|
|
%{summary}.
|
|
|
|
|
2007-03-24 18:31:48 +00:00
|
|
|
|
|
|
|
%prep
|
2020-04-24 01:41:22 +00:00
|
|
|
# Combine all keys from upstream into one file
|
2022-05-25 11:59:56 +00:00
|
|
|
cat %{S:2} %{S:3} %{S:4} %{S:5} > %{_builddir}/%{name}.gpg
|
2020-04-24 01:41:22 +00:00
|
|
|
%{gpgverify} --keyring='%{_builddir}/%{name}.gpg' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
2021-04-21 01:59:53 +00:00
|
|
|
%autosetup -p1
|
2017-08-15 08:21:24 +00:00
|
|
|
cp %{SOURCE200} %{SOURCE210} %{SOURCE10} %{SOURCE12} .
|
2007-03-24 18:31:48 +00:00
|
|
|
|
2017-08-15 08:21:24 +00:00
|
|
|
%if 0%{?rhel} > 0 && 0%{?rhel} < 8
|
|
|
|
sed -i -e 's#KillMode=.*#KillMode=process#g' nginx.service
|
|
|
|
sed -i -e 's#PROFILE=SYSTEM#HIGH:!aNULL:!MD5#' nginx.conf
|
2016-04-27 11:30:00 +00:00
|
|
|
%endif
|
|
|
|
|
2022-10-19 16:10:40 +00:00
|
|
|
%if 0%{?openssl_pkgversion}
|
2021-04-21 15:47:30 +00:00
|
|
|
sed \
|
2022-10-19 16:10:40 +00:00
|
|
|
-e 's|\(ngx_feature_path=\)$|\1%{_includedir}/openssl%{openssl_pkgversion}|' \
|
|
|
|
-e 's|\(ngx_feature_libs="\)|\1-L%{_libdir}/openssl%{openssl_pkgversion} |' \
|
2021-04-21 15:47:30 +00:00
|
|
|
-i auto/lib/openssl/conf
|
|
|
|
%endif
|
|
|
|
|
2021-08-10 16:30:05 +00:00
|
|
|
# Prepare sources for installation
|
|
|
|
cp -a ../%{name}-%{version} ../%{name}-%{version}-%{release}-src
|
|
|
|
mv ../%{name}-%{version}-%{release}-src .
|
|
|
|
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2007-03-24 18:31:48 +00:00
|
|
|
%build
|
|
|
|
# nginx does not utilize a standard configure script. It has its own
|
|
|
|
# and the standard configure options cause the nginx configure script
|
|
|
|
# to error out. This is is also the reason for the DESTDIR environment
|
2012-02-22 15:15:49 +00:00
|
|
|
# variable.
|
2007-03-24 18:31:48 +00:00
|
|
|
export DESTDIR=%{buildroot}
|
2018-07-16 14:54:20 +00:00
|
|
|
# So the perl module finds its symbols:
|
|
|
|
nginx_ldopts="$RPM_LD_FLAGS -Wl,-E"
|
|
|
|
if ! ./configure \
|
2016-04-19 08:34:43 +00:00
|
|
|
--prefix=%{_datadir}/nginx \
|
2012-02-22 15:15:49 +00:00
|
|
|
--sbin-path=%{_sbindir}/nginx \
|
2021-08-10 16:30:05 +00:00
|
|
|
--modules-path=%{nginx_moduledir} \
|
2016-04-19 08:34:43 +00:00
|
|
|
--conf-path=%{_sysconfdir}/nginx/nginx.conf \
|
|
|
|
--error-log-path=%{_localstatedir}/log/nginx/error.log \
|
|
|
|
--http-log-path=%{_localstatedir}/log/nginx/access.log \
|
|
|
|
--http-client-body-temp-path=%{_localstatedir}/lib/nginx/tmp/client_body \
|
|
|
|
--http-proxy-temp-path=%{_localstatedir}/lib/nginx/tmp/proxy \
|
|
|
|
--http-fastcgi-temp-path=%{_localstatedir}/lib/nginx/tmp/fastcgi \
|
|
|
|
--http-uwsgi-temp-path=%{_localstatedir}/lib/nginx/tmp/uwsgi \
|
|
|
|
--http-scgi-temp-path=%{_localstatedir}/lib/nginx/tmp/scgi \
|
2012-03-06 08:30:34 +00:00
|
|
|
--pid-path=/run/nginx.pid \
|
|
|
|
--lock-path=/run/lock/subsys/nginx \
|
2012-02-22 15:15:49 +00:00
|
|
|
--user=%{nginx_user} \
|
2016-04-19 08:34:43 +00:00
|
|
|
--group=%{nginx_user} \
|
2021-04-21 01:59:53 +00:00
|
|
|
--with-compat \
|
|
|
|
--with-debug \
|
2014-07-02 16:29:22 +00:00
|
|
|
%if 0%{?with_aio}
|
2012-02-22 15:15:49 +00:00
|
|
|
--with-file-aio \
|
2014-07-02 16:29:22 +00:00
|
|
|
%endif
|
2021-04-21 01:59:53 +00:00
|
|
|
%if 0%{?with_gperftools}
|
|
|
|
--with-google_perftools_module \
|
|
|
|
%endif
|
2007-03-24 18:31:48 +00:00
|
|
|
--with-http_addition_module \
|
2021-04-21 01:59:53 +00:00
|
|
|
--with-http_auth_request_module \
|
|
|
|
--with-http_dav_module \
|
|
|
|
--with-http_degradation_module \
|
|
|
|
--with-http_flv_module \
|
2018-07-19 09:22:19 +00:00
|
|
|
%if %{with geoip}
|
2016-04-19 08:34:43 +00:00
|
|
|
--with-http_geoip_module=dynamic \
|
2022-05-25 11:59:56 +00:00
|
|
|
--with-stream_geoip_module=dynamic \
|
2018-07-19 09:22:19 +00:00
|
|
|
%endif
|
2013-04-26 20:21:15 +00:00
|
|
|
--with-http_gunzip_module \
|
2008-05-12 05:04:52 +00:00
|
|
|
--with-http_gzip_static_module \
|
2021-04-21 01:59:53 +00:00
|
|
|
--with-http_image_filter_module=dynamic \
|
|
|
|
--with-http_mp4_module \
|
|
|
|
--with-http_perl_module=dynamic \
|
2010-02-16 06:32:21 +00:00
|
|
|
--with-http_random_index_module \
|
2021-04-21 01:59:53 +00:00
|
|
|
--with-http_realip_module \
|
2010-02-16 06:32:21 +00:00
|
|
|
--with-http_secure_link_module \
|
2016-04-19 08:34:43 +00:00
|
|
|
--with-http_slice_module \
|
2021-04-21 01:59:53 +00:00
|
|
|
--with-http_ssl_module \
|
2007-08-18 18:22:11 +00:00
|
|
|
--with-http_stub_status_module \
|
2021-04-21 01:59:53 +00:00
|
|
|
--with-http_sub_module \
|
|
|
|
--with-http_v2_module \
|
|
|
|
--with-http_xslt_module=dynamic \
|
2016-04-19 08:34:43 +00:00
|
|
|
--with-mail=dynamic \
|
2007-03-24 18:31:48 +00:00
|
|
|
--with-mail_ssl_module \
|
2022-10-19 16:10:40 +00:00
|
|
|
%if 0%{?with_ktls}
|
|
|
|
--with-openssl-opt=enable-ktls \
|
|
|
|
%endif
|
2013-04-26 20:21:15 +00:00
|
|
|
--with-pcre \
|
2015-04-22 14:18:26 +00:00
|
|
|
--with-pcre-jit \
|
2016-04-19 08:34:43 +00:00
|
|
|
--with-stream=dynamic \
|
2022-05-25 11:59:56 +00:00
|
|
|
--with-stream_realip_module \
|
2016-04-19 08:34:43 +00:00
|
|
|
--with-stream_ssl_module \
|
2021-04-21 01:59:53 +00:00
|
|
|
--with-stream_ssl_preread_module \
|
|
|
|
--with-threads \
|
2022-05-25 11:59:56 +00:00
|
|
|
--with-cc-opt="%{optflags} $(pcre2-config --cflags)" \
|
2018-07-16 14:54:20 +00:00
|
|
|
--with-ld-opt="$nginx_ldopts"; then
|
|
|
|
: configure failed
|
|
|
|
cat objs/autoconf.err
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2021-04-21 01:59:53 +00:00
|
|
|
%make_build
|
2007-03-24 18:31:48 +00:00
|
|
|
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2007-03-24 18:31:48 +00:00
|
|
|
%install
|
2021-04-21 01:59:53 +00:00
|
|
|
%make_install INSTALLDIRS=vendor
|
2012-02-22 15:15:49 +00:00
|
|
|
|
|
|
|
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 -iname '*.so' -exec chmod 0755 '{}' \;
|
2016-04-19 08:34:43 +00:00
|
|
|
|
2017-08-15 08:21:24 +00:00
|
|
|
install -p -D -m 0644 ./nginx.service \
|
2012-02-22 15:15:49 +00:00
|
|
|
%{buildroot}%{_unitdir}/nginx.service
|
2013-02-16 08:52:47 +00:00
|
|
|
install -p -D -m 0644 %{SOURCE11} \
|
2012-02-22 15:15:49 +00:00
|
|
|
%{buildroot}%{_sysconfdir}/logrotate.d/nginx
|
|
|
|
|
2017-09-19 09:21:49 +00:00
|
|
|
install -p -d -m 0755 %{buildroot}%{_sysconfdir}/systemd/system/nginx.service.d
|
|
|
|
install -p -d -m 0755 %{buildroot}%{_unitdir}/nginx.service.d
|
|
|
|
|
2016-04-19 08:34:43 +00:00
|
|
|
install -p -d -m 0755 %{buildroot}%{_sysconfdir}/nginx/conf.d
|
|
|
|
install -p -d -m 0755 %{buildroot}%{_sysconfdir}/nginx/default.d
|
|
|
|
|
|
|
|
install -p -d -m 0700 %{buildroot}%{_localstatedir}/lib/nginx
|
|
|
|
install -p -d -m 0700 %{buildroot}%{_localstatedir}/lib/nginx/tmp
|
|
|
|
install -p -d -m 0700 %{buildroot}%{_localstatedir}/log/nginx
|
|
|
|
|
|
|
|
install -p -d -m 0755 %{buildroot}%{_datadir}/nginx/html
|
2021-08-10 16:30:05 +00:00
|
|
|
install -p -d -m 0755 %{buildroot}%{nginx_moduleconfdir}
|
|
|
|
install -p -d -m 0755 %{buildroot}%{nginx_moduledir}
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2017-08-15 08:21:24 +00:00
|
|
|
install -p -m 0644 ./nginx.conf \
|
2016-04-19 08:34:43 +00:00
|
|
|
%{buildroot}%{_sysconfdir}/nginx
|
2019-05-14 18:58:45 +00:00
|
|
|
|
|
|
|
rm -f %{buildroot}%{_datadir}/nginx/html/index.html
|
2019-09-15 09:32:10 +00:00
|
|
|
%if 0%{?el7}
|
|
|
|
ln -s ../../doc/HTML/index.html \
|
|
|
|
%{buildroot}%{_datadir}/nginx/html/index.html
|
|
|
|
ln -s ../../doc/HTML/img \
|
|
|
|
%{buildroot}%{_datadir}/nginx/html/img
|
|
|
|
ln -s ../../doc/HTML/en-US \
|
|
|
|
%{buildroot}%{_datadir}/nginx/html/en-US
|
|
|
|
%else
|
2021-04-30 11:28:06 +00:00
|
|
|
ln -s ../../testpage/index.html \
|
2019-05-14 18:58:45 +00:00
|
|
|
%{buildroot}%{_datadir}/nginx/html/index.html
|
2019-09-15 09:32:10 +00:00
|
|
|
%endif
|
2019-05-14 18:58:45 +00:00
|
|
|
install -p -m 0644 %{SOURCE102} \
|
2016-04-19 08:34:43 +00:00
|
|
|
%{buildroot}%{_datadir}/nginx/html
|
2019-05-14 18:58:45 +00:00
|
|
|
ln -s nginx-logo.png %{buildroot}%{_datadir}/nginx/html/poweredby.png
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/nginx/html/icons
|
|
|
|
|
|
|
|
# Symlink for the powered-by-$DISTRO image:
|
|
|
|
ln -s ../../../pixmaps/poweredby.png \
|
|
|
|
%{buildroot}%{_datadir}/nginx/html/icons/poweredby.png
|
|
|
|
|
2021-08-09 14:31:16 +00:00
|
|
|
%if 0%{?rhel} >= 9
|
|
|
|
ln -s ../../pixmaps/system-noindex-logo.png \
|
|
|
|
%{buildroot}%{_datadir}/nginx/html/system_noindex_logo.png
|
|
|
|
%endif
|
|
|
|
|
2012-02-22 15:15:49 +00:00
|
|
|
install -p -m 0644 %{SOURCE103} %{SOURCE104} \
|
2016-04-19 08:34:43 +00:00
|
|
|
%{buildroot}%{_datadir}/nginx/html
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2015-10-04 05:56:54 +00:00
|
|
|
%if 0%{?with_mailcap_mimetypes}
|
|
|
|
rm -f %{buildroot}%{_sysconfdir}/nginx/mime.types
|
2015-09-25 06:16:03 +00:00
|
|
|
%endif
|
|
|
|
|
2018-12-11 09:41:48 +00:00
|
|
|
install -p -D -m 0644 %{_builddir}/nginx-%{version}/objs/nginx.8 \
|
2012-10-28 15:24:09 +00:00
|
|
|
%{buildroot}%{_mandir}/man8/nginx.8
|
|
|
|
|
2013-02-16 08:52:47 +00:00
|
|
|
install -p -D -m 0755 %{SOURCE13} %{buildroot}%{_bindir}/nginx-upgrade
|
|
|
|
install -p -D -m 0644 %{SOURCE14} %{buildroot}%{_mandir}/man8/nginx-upgrade.8
|
2012-05-16 21:11:49 +00:00
|
|
|
|
2019-05-07 04:58:57 +00:00
|
|
|
for i in ftdetect ftplugin indent syntax; do
|
2014-10-22 18:17:55 +00:00
|
|
|
install -p -D -m644 contrib/vim/${i}/nginx.vim \
|
|
|
|
%{buildroot}%{_datadir}/vim/vimfiles/${i}/nginx.vim
|
|
|
|
done
|
|
|
|
|
2018-07-19 09:22:19 +00:00
|
|
|
%if %{with geoip}
|
2021-08-10 16:30:05 +00:00
|
|
|
echo 'load_module "%{nginx_moduledir}/ngx_http_geoip_module.so";' \
|
|
|
|
> %{buildroot}%{nginx_moduleconfdir}/mod-http-geoip.conf
|
2018-07-19 09:22:19 +00:00
|
|
|
%endif
|
2021-08-10 16:30:05 +00:00
|
|
|
echo 'load_module "%{nginx_moduledir}/ngx_http_image_filter_module.so";' \
|
|
|
|
> %{buildroot}%{nginx_moduleconfdir}/mod-http-image-filter.conf
|
|
|
|
echo 'load_module "%{nginx_moduledir}/ngx_http_perl_module.so";' \
|
|
|
|
> %{buildroot}%{nginx_moduleconfdir}/mod-http-perl.conf
|
|
|
|
echo 'load_module "%{nginx_moduledir}/ngx_http_xslt_filter_module.so";' \
|
|
|
|
> %{buildroot}%{nginx_moduleconfdir}/mod-http-xslt-filter.conf
|
|
|
|
echo 'load_module "%{nginx_moduledir}/ngx_mail_module.so";' \
|
|
|
|
> %{buildroot}%{nginx_moduleconfdir}/mod-mail.conf
|
|
|
|
echo 'load_module "%{nginx_moduledir}/ngx_stream_module.so";' \
|
|
|
|
> %{buildroot}%{nginx_moduleconfdir}/mod-stream.conf
|
|
|
|
|
|
|
|
# Install files for supporting nginx module builds
|
|
|
|
## Install source files
|
|
|
|
mkdir -p %{buildroot}%{_usrsrc}
|
|
|
|
mv %{name}-%{version}-%{release}-src %{buildroot}%{nginx_srcdir}
|
|
|
|
## Install rpm macros
|
|
|
|
mkdir -p %{buildroot}%{_rpmmacrodir}
|
|
|
|
sed -e "s|@@NGINX_ABIVERSION@@|%{nginx_abiversion}|g" \
|
|
|
|
-e "s|@@NGINX_MODDIR@@|%{nginx_moduledir}|g" \
|
|
|
|
-e "s|@@NGINX_MODCONFDIR@@|%{nginx_moduleconfdir}|g" \
|
|
|
|
-e "s|@@NGINX_SRCDIR@@|%{nginx_srcdir}|g" \
|
|
|
|
%{SOURCE15} > %{buildroot}%{_rpmmacrodir}/macros.nginxmods
|
|
|
|
## Install dependency generator
|
2021-10-18 23:30:44 +00:00
|
|
|
install -Dpm0644 %{SOURCE16} %{buildroot}%{_fileattrsdir}/nginxmods.attr
|
2021-08-10 16:30:05 +00:00
|
|
|
|
2007-03-24 18:31:48 +00:00
|
|
|
|
2014-09-22 11:07:39 +00:00
|
|
|
%pre filesystem
|
2016-04-19 08:34:43 +00:00
|
|
|
getent group %{nginx_user} > /dev/null || groupadd -r %{nginx_user}
|
2013-04-26 20:21:15 +00:00
|
|
|
getent passwd %{nginx_user} > /dev/null || \
|
2016-04-19 08:34:43 +00:00
|
|
|
useradd -r -d %{_localstatedir}/lib/nginx -g %{nginx_user} \
|
2013-04-26 20:21:15 +00:00
|
|
|
-s /sbin/nologin -c "Nginx web server" %{nginx_user}
|
|
|
|
exit 0
|
2007-03-24 18:31:48 +00:00
|
|
|
|
|
|
|
%post
|
2012-10-28 15:24:09 +00:00
|
|
|
%systemd_post nginx.service
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2018-07-19 09:22:19 +00:00
|
|
|
%if %{with geoip}
|
2016-04-19 08:34:43 +00:00
|
|
|
%post mod-http-geoip
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
/usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
|
|
|
|
fi
|
2018-07-19 09:22:19 +00:00
|
|
|
%endif
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%post mod-http-image-filter
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
/usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
|
|
|
|
fi
|
|
|
|
|
|
|
|
%post mod-http-perl
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
/usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
|
|
|
|
fi
|
|
|
|
|
|
|
|
%post mod-http-xslt-filter
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
/usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
|
|
|
|
fi
|
|
|
|
|
|
|
|
%post mod-mail
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
/usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
|
|
|
|
fi
|
|
|
|
|
|
|
|
%post mod-stream
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
/usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
|
|
|
|
fi
|
|
|
|
|
2007-03-24 18:31:48 +00:00
|
|
|
%preun
|
2012-10-28 15:24:09 +00:00
|
|
|
%systemd_preun nginx.service
|
2007-03-24 18:31:48 +00:00
|
|
|
|
|
|
|
%postun
|
2012-10-28 15:24:09 +00:00
|
|
|
%systemd_postun nginx.service
|
2015-05-10 08:10:51 +00:00
|
|
|
if [ $1 -ge 1 ]; then
|
|
|
|
/usr/bin/nginx-upgrade >/dev/null 2>&1 || :
|
|
|
|
fi
|
2012-02-22 15:15:49 +00:00
|
|
|
|
2007-03-24 18:31:48 +00:00
|
|
|
%files
|
2016-07-04 13:09:58 +00:00
|
|
|
%if 0%{?rhel} == 7
|
2016-07-02 15:16:54 +00:00
|
|
|
%doc UPGRADE-NOTES-1.6-to-1.10
|
|
|
|
%endif
|
2016-04-19 08:34:43 +00:00
|
|
|
%{_datadir}/nginx/html/*
|
2012-05-16 21:11:49 +00:00
|
|
|
%{_bindir}/nginx-upgrade
|
2014-10-22 18:17:55 +00:00
|
|
|
%{_datadir}/vim/vimfiles/ftdetect/nginx.vim
|
2019-05-07 05:40:42 +00:00
|
|
|
%{_datadir}/vim/vimfiles/ftplugin/nginx.vim
|
2014-10-22 18:17:55 +00:00
|
|
|
%{_datadir}/vim/vimfiles/syntax/nginx.vim
|
|
|
|
%{_datadir}/vim/vimfiles/indent/nginx.vim
|
2012-10-28 15:24:09 +00:00
|
|
|
%{_mandir}/man3/nginx.3pm*
|
|
|
|
%{_mandir}/man8/nginx.8*
|
|
|
|
%{_mandir}/man8/nginx-upgrade.8*
|
2012-02-22 15:15:49 +00:00
|
|
|
%{_unitdir}/nginx.service
|
2022-03-25 14:19:21 +00:00
|
|
|
|
|
|
|
%files core
|
|
|
|
%license LICENSE
|
|
|
|
%doc CHANGES README README.dynamic
|
|
|
|
%{_sbindir}/nginx
|
2016-04-19 08:34:43 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/fastcgi.conf
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/fastcgi.conf.default
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/fastcgi_params
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/fastcgi_params.default
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/koi-utf
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/koi-win
|
2015-10-04 05:56:54 +00:00
|
|
|
%if ! 0%{?with_mailcap_mimetypes}
|
2016-04-19 08:34:43 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/mime.types
|
2015-09-25 06:16:03 +00:00
|
|
|
%endif
|
2016-04-19 08:34:43 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/mime.types.default
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/nginx.conf
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/nginx.conf.default
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/scgi_params
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/scgi_params.default
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/uwsgi_params
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/uwsgi_params.default
|
|
|
|
%config(noreplace) %{_sysconfdir}/nginx/win-utf
|
2012-02-22 15:15:49 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/nginx
|
2018-05-02 14:59:46 +00:00
|
|
|
%attr(770,%{nginx_user},root) %dir %{_localstatedir}/lib/nginx
|
|
|
|
%attr(770,%{nginx_user},root) %dir %{_localstatedir}/lib/nginx/tmp
|
2021-06-01 17:28:30 +00:00
|
|
|
%attr(711,root,root) %dir %{_localstatedir}/log/nginx
|
|
|
|
%ghost %attr(640,%{nginx_user},root) %{_localstatedir}/log/nginx/access.log
|
|
|
|
%ghost %attr(640,%{nginx_user},root) %{_localstatedir}/log/nginx/error.log
|
2021-08-10 16:30:05 +00:00
|
|
|
%dir %{nginx_moduledir}
|
|
|
|
%dir %{nginx_moduleconfdir}
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%files all-modules
|
|
|
|
|
|
|
|
%files filesystem
|
|
|
|
%dir %{_datadir}/nginx
|
|
|
|
%dir %{_datadir}/nginx/html
|
|
|
|
%dir %{_sysconfdir}/nginx
|
|
|
|
%dir %{_sysconfdir}/nginx/conf.d
|
|
|
|
%dir %{_sysconfdir}/nginx/default.d
|
2017-09-19 09:21:49 +00:00
|
|
|
%dir %{_sysconfdir}/systemd/system/nginx.service.d
|
|
|
|
%dir %{_unitdir}/nginx.service.d
|
2016-04-19 08:34:43 +00:00
|
|
|
|
2018-07-19 09:22:19 +00:00
|
|
|
%if %{with geoip}
|
2016-04-19 08:34:43 +00:00
|
|
|
%files mod-http-geoip
|
2021-08-10 16:30:05 +00:00
|
|
|
%{nginx_moduleconfdir}/mod-http-geoip.conf
|
|
|
|
%{nginx_moduledir}/ngx_http_geoip_module.so
|
2018-07-19 09:22:19 +00:00
|
|
|
%endif
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%files mod-http-image-filter
|
2021-08-10 16:30:05 +00:00
|
|
|
%{nginx_moduleconfdir}/mod-http-image-filter.conf
|
|
|
|
%{nginx_moduledir}/ngx_http_image_filter_module.so
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%files mod-http-perl
|
2021-08-10 16:30:05 +00:00
|
|
|
%{nginx_moduleconfdir}/mod-http-perl.conf
|
|
|
|
%{nginx_moduledir}/ngx_http_perl_module.so
|
2012-02-22 15:15:49 +00:00
|
|
|
%dir %{perl_vendorarch}/auto/nginx
|
|
|
|
%{perl_vendorarch}/nginx.pm
|
|
|
|
%{perl_vendorarch}/auto/nginx/nginx.so
|
2007-03-24 18:31:48 +00:00
|
|
|
|
2016-04-19 08:34:43 +00:00
|
|
|
%files mod-http-xslt-filter
|
2021-08-10 16:30:05 +00:00
|
|
|
%{nginx_moduleconfdir}/mod-http-xslt-filter.conf
|
|
|
|
%{nginx_moduledir}/ngx_http_xslt_filter_module.so
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%files mod-mail
|
2021-08-10 16:30:05 +00:00
|
|
|
%{nginx_moduleconfdir}/mod-mail.conf
|
|
|
|
%{nginx_moduledir}/ngx_mail_module.so
|
2016-04-19 08:34:43 +00:00
|
|
|
|
|
|
|
%files mod-stream
|
2021-08-10 16:30:05 +00:00
|
|
|
%{nginx_moduleconfdir}/mod-stream.conf
|
|
|
|
%{nginx_moduledir}/ngx_stream_module.so
|
|
|
|
|
|
|
|
%files mod-devel
|
|
|
|
%{_rpmmacrodir}/macros.nginxmods
|
|
|
|
%{_fileattrsdir}/nginxmods.attr
|
|
|
|
%{nginx_srcdir}/
|
2014-09-22 11:07:39 +00:00
|
|
|
|
2007-03-24 18:31:48 +00:00
|
|
|
|
|
|
|
%changelog
|
2023-04-11 21:25:55 +00:00
|
|
|
%autochangelog
|