-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx-module-brotli.spec
299 lines (219 loc) · 8.82 KB
/
nginx-module-brotli.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
#
%define nginx_user nginx
%define nginx_group nginx
%define __arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
%if 0%{?rhel} || 0%{?amzn} || 0%{?fedora}
%define _group System Environment/Daemons
%if 0%{?amzn} == 2
BuildRequires: openssl11-devel
%else
BuildRequires: openssl-devel
%endif
%endif
%if 0%{?suse_version} >= 1315
%define _group Productivity/Networking/Web/Servers
BuildRequires: libopenssl-devel
%define _debugsource_template %{nil}
%endif
%if (0%{?rhel} == 7) && (0%{?amzn} == 0)
%define epoch 1
Epoch: %{epoch}
BuildRequires: perl-IPC-Cmd
%define dist .el7
%endif
%if (0%{?rhel} == 7) && (0%{?amzn} == 2)
%define epoch 1
Epoch: %{epoch}
%endif
%if 0%{?rhel} == 8
%define epoch 1
Epoch: %{epoch}
%define _debugsource_template %{nil}
%endif
%if 0%{?rhel} == 9
%define epoch 1
Epoch: %{epoch}
BuildRequires: gcc
%define _debugsource_template %{nil}
%endif
%if 0%{?fedora}
%define _debugsource_template %{nil}
%global _hardened_build 1
%endif
BuildRequires: git
%define openssl_version 3.1.7-quic1
%define base_version 1.27.2
%define base_release 2%{?dist}.ngx
%define bdir %{_builddir}/%{name}-%{base_version}
Summary: nginx Brotli dynamic modules
Name: nginx-module-brotli
Version: %{base_version}
Release: %{base_release}
Vendor: Eugene Wu <[email protected]>
URL: https://github.com/kuretru/nginx-module-brotli
Group: %{_group}
Source0: https://nginx.org/download/nginx-%{base_version}.tar.gz
Source1: COPYRIGHT
Source2: https://github.com/quictls/openssl/archive/refs/tags/openssl-%{openssl_version}.tar.gz
License: 2-clause BSD-like license
BuildRoot: %{_tmppath}/%{name}-%{base_version}-%{base_release}-root
BuildRequires: zlib-devel
BuildRequires: pcre2-devel
BuildRequires: perl
Requires: nginx-r%{base_version}
Provides: %{name}-r%{base_version}
%description
nginx Brotli dynamic modules.
%if 0%{?suse_version}
%debug_package
%endif
%define WITH_CC_OPT $(echo %{optflags} $(pcre2-config --cflags))
%define WITH_LD_OPT -Wl,-z,relro -Wl,-z,now -Wl,-as-needed
%define BASE_CONFIGURE_ARGS $(echo "--prefix=%{_sysconfdir}/nginx --sbin-path=%{_sbindir}/nginx --modules-path=%{_libdir}/nginx/modules --conf-path=%{_sysconfdir}/nginx/nginx.conf --error-log-path=%{_localstatedir}/log/nginx/error.log --http-log-path=%{_localstatedir}/log/nginx/access.log --pid-path=%{_localstatedir}/run/nginx.pid --lock-path=%{_localstatedir}/run/nginx.lock --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp --user=%{nginx_user} --group=%{nginx_group} --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module $( if [ 0%{?rhel} -eq 7 ] || [ 0%{?suse_version} -eq 1315 ]; then continue; else echo "--with-http_v3_module"; fi; ) --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module")
%define MODULE_CONFIGURE_ARGS $(echo "--add-dynamic-module=./ngx_brotli/")
%prep
%setup -qcTn %{name}-%{base_version}
tar -zxf %{SOURCE2}
tar --strip-components=1 -zxf %{SOURCE0}
git clone --recursive https://github.com/google/ngx_brotli.git
cd ngx_brotli/
git checkout 6e975bc
git submodule update --recursive
cd ../
%build
cd %{bdir}
./configure %{BASE_CONFIGURE_ARGS} %{MODULE_CONFIGURE_ARGS} \
--with-openssl=./openssl-openssl-%{openssl_version}/ \
--with-cc-opt="%{WITH_CC_OPT} " \
--with-ld-opt="%{WITH_LD_OPT} " \
--with-debug
make %{?_smp_mflags} modules
for so in `find %{bdir}/objs/ -type f -name "*.so"`; do
debugso=`echo $so | sed -e 's|\.so$|-debug.so|'`
mv $so $debugso
done
./configure %{BASE_CONFIGURE_ARGS} %{MODULE_CONFIGURE_ARGS} \
--with-openssl=./openssl-openssl-%{openssl_version}/ \
--with-cc-opt="%{WITH_CC_OPT} " \
--with-ld-opt="%{WITH_LD_OPT} "
make %{?_smp_mflags} modules
%install
cd %{bdir}
%{__rm} -rf $RPM_BUILD_ROOT
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/doc/nginx-module-brotli
%{__install} -m 644 -p %{SOURCE1} \
$RPM_BUILD_ROOT%{_datadir}/doc/nginx-module-brotli/
%{__mkdir} -p $RPM_BUILD_ROOT%{_libdir}/nginx/modules
for so in `find %{bdir}/objs/ -maxdepth 1 -type f -name "*.so"`; do
%{__install} -m755 $so \
$RPM_BUILD_ROOT%{_libdir}/nginx/modules/
done
%check
%{__rm} -rf $RPM_BUILD_ROOT/usr/src
cd %{bdir}
grep -v 'usr/src' debugfiles.list > debugfiles.list.new && mv debugfiles.list.new debugfiles.list
cat /dev/null > debugsources.list
%if 0%{?suse_version} >= 1500
cat /dev/null > debugsourcefiles.list
%endif
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_libdir}/nginx/modules/*
%dir %{_datadir}/doc/nginx-module-brotli
%{_datadir}/doc/nginx-module-brotli/*
%post
if [ $1 -eq 1 ]; then
cat <<BANNER
----------------------------------------------------------------------
The Brotli dynamic module for nginx has been installed.
To enable this module, add the following to /etc/nginx/nginx.conf
and reload nginx:
load_module modules/ngx_http_brotli_filter_module.so;
load_module modules/ngx_http_brotli_static_module.so;
Please refer to the module documentation for further details:
https://github.com/google/ngx_brotli
https://github.com/google/brotli
----------------------------------------------------------------------
BANNER
fi
%changelog
* Wed Oct 30 2024 Eugene Wu <[email protected]>
- base version updated to 1.27.2
* Sat Sep 07 2024 Eugene Wu <[email protected]>
- base version updated to 1.27.1
* Mon Jun 22 2024 Eugene Wu <[email protected]>
- base version updated to 1.27.0
* Mon Jun 22 2024 Eugene Wu <[email protected]>
- base version updated to 1.25.5
* Sat Feb 17 2024 Eugene Wu <[email protected]>
- base version updated to 1.25.4
* Sun Oct 29 2023 Eugene Wu <[email protected]>
- base version updated to 1.25.3
* Mon Aug 7 2023 Eugene Wu <[email protected]>
- base version updated to 1.25.2
* Thu Jul 13 2023 Eugene Wu <[email protected]>
- base version updated to 1.25.1
* Fri May 26 2023 Eugene Wu <[email protected]>
- base version updated to 1.25.0
* Wed Mar 29 2023 Eugene Wu <[email protected]>
- base version updated to 1.23.4
* Sun Jan 1 2023 Eugene Wu <[email protected]>
- base version updated to 1.23.3
* Fri Oct 21 2022 Eugene Wu <[email protected]>
- base version updated to 1.23.2
* Sat Jul 23 2022 Eugene Wu <[email protected]>
- base version updated to 1.23.1
* Wed Jun 22 2022 Eugene Wu <[email protected]>
- base version updated to 1.23.0
* Thu Jan 27 2022 Eugene Wu <[email protected]>
- base version updated to 1.21.6
* Mon Jan 3 2022 Eugene Wu <[email protected]>
- base version updated to 1.21.5
* Tue Nov 9 2021 Eugene Wu <[email protected]>
- base version updated to 1.21.4
* Fri Sep 10 2021 Eugene Wu <[email protected]>
- base version updated to 1.21.3
* Thu Sep 2 2021 Eugene Wu <[email protected]>
- base version updated to 1.21.2
* Wed Jul 7 2021 Eugene Wu <[email protected]>
- base version updated to 1.21.1
* Thu May 27 2021 Eugene Wu <[email protected]>
- base version updated to 1.21.0
* Thu Apr 15 2021 Eugene Wu <[email protected]>
- base version updated to 1.19.10
* Wed Mar 31 2021 Eugene Wu <[email protected]>
- base version updated to 1.19.9
* Thu Mar 11 2021 Eugene Wu <[email protected]>
- base version updated to 1.19.8
* Thu Feb 18 2021 Eugene Wu <[email protected]>
- base version updated to 1.19.7
* Tue Dec 22 2020 Eugene Wu <[email protected]>
- base version updated to 1.19.6
* Wed Nov 25 2020 Eugene Wu <[email protected]>
- base version updated to 1.19.5
* Fri Oct 30 2020 Eugene Wu <[email protected]>
- base version updated to 1.19.4
* Thu Oct 1 2020 Eugene Wu <[email protected]>
- base version updated to 1.19.3
* Wed Aug 12 2020 Eugene Wu <[email protected]>
- base version updated to 1.19.2
* Wed Jul 8 2020 Eugene Wu <[email protected]>
- base version updated to 1.19.1
* Wed May 27 2020 Eugene Wu <[email protected]>
- base version updated to 1.19.0
* Sat Apr 18 2020 Eugene Wu <[email protected]>
- base version updated to 1.17.10
* Thu Mar 5 2020 Eugene Wu <[email protected]>
- base version updated to 1.17.9
* Thu Jan 23 2020 Eugene Wu <[email protected]>
- base version updated to 1.17.8
* Sat Dec 28 2019 Eugene Wu <[email protected]>
- base version updated to 1.17.7
* Mon Nov 25 2019 Eugene Wu <[email protected]>
- base version updated to 1.17.6
* Wed Oct 23 2019 Eugene Wu <[email protected]>
- base version updated to 1.17.5
* Sun Oct 13 2019 Eugene Wu <[email protected]>
- base version updated to 1.17.4