33%define nginx_user nginx
44%define nginx_group nginx
55
6- %define main_version 1.16.1
7- %define main_release 2%{?dist }.levenlabs
6+ %define main_version 1.18.0
7+ %define main_release 1%{?dist }.levenlabs
8+
9+ %define openssl_version 1.1.1g
10+ %define pcre_version 8.44
11+ %define zlib_version 1.2.11
812
913%define nginx_more_headers_version 0.33
1014%define WITH_CC_OPT $(echo %{optflags } $(pcre-config --cflags)) -fPIC
@@ -25,14 +29,14 @@ Source4: nginx.conf
2529Source5: nginx-default.conf
2630Source8: nginx.service
2731Source90: https://github.com/openresty/headers-more-nginx-module/archive/v%{nginx_more_headers_version }/headers-more-nginx-module-%{nginx_more_headers_version }.tar.gz
28- Source91: https://www.openssl.org/source/openssl-1.1.1d.tar.gz
29- Source92: https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
30- Source93: https://www.zlib.net/zlib-1.2.11.tar.gz
31- Source94: https://github.com/vozlt/nginx-module-vts/archive/master.tar.gz
32+ Source100: https://www.openssl.org/source/openssl-%{openssl_version }.tar.gz
33+ Source101: https://ftp.pcre.org/pub/pcre/pcre-%{pcre_version }.tar.gz
34+ Source102: https://www.zlib.net/zlib-%{zlib_version }.tar.gz
3235
3336License: 2-clause BSD-like license
3437Group: System Environment/Daemons
3538
39+ BuildRequires: git
3640BuildRequires: gcc
3741BuildRequires: perl
3842BuildRequires: GeoIP-devel
@@ -48,10 +52,16 @@ nginx [engine x] is an HTTP and reverse proxy server
4852%prep
4953%setup -q
5054tar xf %{SOURCE90 } -C $RPM_BUILD_DIR
51- tar xf %{SOURCE91 } -C $RPM_BUILD_DIR
52- tar xf %{SOURCE92 } -C $RPM_BUILD_DIR
53- tar xf %{SOURCE93 } -C $RPM_BUILD_DIR
54- tar xf %{SOURCE94 } -C $RPM_BUILD_DIR
55+
56+ git clone https://github.com/vozlt/nginx-module-vts $RPM_BUILD_DIR/nginx-module-vts
57+ cd $RPM_BUILD_DIR/nginx-module-vts && git submodule update --init
58+
59+ git clone https://github.com/google/ngx_brotli $RPM_BUILD_DIR/ngx_brotli
60+ cd $RPM_BUILD_DIR/ngx_brotli && git submodule update --init
61+
62+ mkdir $RPM_BUILD_DIR/openssl && tar zxf %{SOURCE100 } -C $RPM_BUILD_DIR/openssl --strip-components 1
63+ mkdir $RPM_BUILD_DIR/pcre && tar zxf %{SOURCE101 } -C $RPM_BUILD_DIR/pcre --strip-components 1
64+ mkdir $RPM_BUILD_DIR/zlib && tar zxf %{SOURCE102 } -C $RPM_BUILD_DIR/zlib --strip-components 1
5565
5666%build
5767./configure \
@@ -72,6 +82,7 @@ tar xf %{SOURCE94} -C $RPM_BUILD_DIR
7282 --group=%{nginx_group } \
7383 --with-debug \
7484 --with-file-aio \
85+ --with-threads \
7586 --with-http_addition_module \
7687 --with-http_auth_request_module \
7788 --with-http_dav_module \
@@ -95,15 +106,17 @@ tar xf %{SOURCE94} -C $RPM_BUILD_DIR
95106 --with-pcre-jit \
96107 --with-stream \
97108 --with-stream_ssl_module \
98- --with-openssl=$RPM_BUILD_DIR /openssl-1.1.1d \
99- --with-pcre=$RPM_BUILD_DIR /pcre-8.43 \
109+ --with-openssl=$RPM_BUILD_DIR /openssl --with-openssl-opt=enable-tls1_3 \
110+ --with-stream_ssl_preread_module \
111+ --with-pcre=$RPM_BUILD_DIR /pcre \
100112 --with-pcre-opt=' -g -Ofast -fPIC -m64 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2' \
101- --with-zlib=$RPM_BUILD_DIR /zlib-1.2.11 \
113+ --with-zlib=$RPM_BUILD_DIR /zlib \
102114 --with-zlib-opt=' -g -Ofast -fPIC -m64 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2' \
103- --add-module=$RPM_BUILD_DIR /nginx-module-vts-master \
115+ --add-module=$RPM_BUILD_DIR /nginx-module-vts \
104116 --with-cc-opt=" %{WITH_CC_OPT}" \
105117 --with-ld-opt=" %{WITH_LD_OPT}" \
106118 --add-module=$RPM_BUILD_DIR /headers-more-nginx-module-%{nginx_more_headers_version } \
119+ --add-module=$RPM_BUILD_DIR /ngx_brotli \
107120
108121make %{?_smp_mflags }
109122
0 commit comments