%global _hardened_build 1 %global nginx_user nginx %ifnarch s390 s390x %global with_gperftools 1 %endif %global with_aio 1 %define nginx_ver 1.28.0 %define brotli_ver v1.0.0rc Name: nginx-mod-brotli Epoch: 1 Version: %{nginx_ver} Release: 1%{?dist} Summary: Brotli compression module for nginx License: BSD-2-Clause URL: https://github.com/google/ngx_brotli Source0: nginx-%{nginx_ver}.tar.gz Source1: ngx_brotli-%{brotli_ver}-full.tar.gz BuildRequires: gcc-c++ BuildRequires: make BuildRequires: openssl-devel BuildRequires: pcre-devel BuildRequires: pcre2-devel BuildRequires: zlib-devel BuildRequires: cmake %if 0%{?with_gperftools} BuildRequires: gperftools-devel %endif BuildRequires: gd-devel BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl(ExtUtils::Embed) BuildRequires: libxslt-devel BuildRequires: systemd Requires: nginx = %{epoch}:%{nginx_ver} Conflicts: nginx > %{epoch}:%{nginx_ver} Conflicts: nginx < %{epoch}:%{nginx_ver} Requires(post): systemd %description Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling. This nginx module provides Brotli compression support for nginx. %prep %setup -n nginx-%{nginx_ver} -q -a 1 mv ngx_brotli-* ngx_brotli %build export DESTDIR=%{buildroot} ./configure \ --prefix=%{_datadir}/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 \ --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 \ --pid-path=/run/nginx.pid \ --lock-path=/run/lock/subsys/nginx \ --user=%{nginx_user} \ --group=%{nginx_user} \ --with-compat \ --with-debug \ %if 0%{?with_aio} --with-file-aio \ %endif %if 0%{?with_gperftools} --with-google_perftools_module \ %endif --with-http_ssl_module \ --with-http_v2_module \ --with-http_realip_module \ --with-http_addition_module \ --with-http_xslt_module=dynamic \ --with-http_image_filter_module=dynamic \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_module \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-http_auth_request_module \ --with-http_random_index_module \ --with-http_secure_link_module \ --with-http_degradation_module \ --with-http_slice_module \ --with-http_stub_status_module \ --with-http_perl_module=dynamic \ --with-mail=dynamic \ --with-mail_ssl_module \ --with-stream=dynamic \ --with-stream_ssl_module \ --with-stream_ssl_preread_module \ --with-pcre \ --with-pcre-jit \ --with-threads \ --add-dynamic-module=./ngx_brotli \ --with-cc-opt="%{optflags}" \ --with-ld-opt="$RPM_LD_FLAGS -Wl,-E" make %{?_smp_mflags} modules %install install -d -m 0755 %{buildroot}%{_libdir}/nginx/modules install -d -m 0755 %{buildroot}%{_datadir}/nginx/modules install -m 0755 objs/ngx_http_brotli_filter_module.so %{buildroot}%{_libdir}/nginx/modules/ install -m 0755 objs/ngx_http_brotli_static_module.so %{buildroot}%{_libdir}/nginx/modules/ echo 'load_module "%{_libdir}/nginx/modules/ngx_http_brotli_filter_module.so";' \ > %{buildroot}%{_datadir}/nginx/modules/mod-brotli.conf echo 'load_module "%{_libdir}/nginx/modules/ngx_http_brotli_static_module.so";' \ >> %{buildroot}%{_datadir}/nginx/modules/mod-brotli.conf %post if [ $1 -eq 1 ]; then /usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || : fi %files %{_datadir}/nginx/modules/mod-brotli.conf %{_libdir}/nginx/modules/ngx_http_brotli_filter_module.so %{_libdir}/nginx/modules/ngx_http_brotli_static_module.so %changelog * Fri Sep 05 2025 COPR Builder - %{nginx_ver}-1 - Automated build from GitHub - Built against nginx version %{nginx_ver} - Using ngx_brotli release %{brotli_ver}