Update geoip to geoip2

This commit is contained in:
eabdullin 2022-07-15 16:33:05 +03:00
parent 866617d210
commit e24e97f4c4
3 changed files with 23 additions and 13 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ SOURCES/maxim.key
SOURCES/mdounin.key
SOURCES/nginx-1.20.1.tar.gz
SOURCES/sb.key
SOURCES/ngx_http_geoip2_module-3.4.tar

View File

@ -2,3 +2,4 @@ fe1bb3869c51a54f28e7e7a2c1d8a790a2ca7789 SOURCES/maxim.key
145bf87154a2689f7c09a376c11f307012a439de SOURCES/mdounin.key
6b4ab4eff3c617e133819f43fdfc14708e593a79 SOURCES/nginx-1.20.1.tar.gz
baa71c22e4e2b67be2a5f4f4df25a99962488f90 SOURCES/sb.key
9b0fa43e2935e350d70681be4420b7983540eebd SOURCES/ngx_http_geoip2_module-3.4.tar

View File

@ -41,7 +41,7 @@
Name: nginx
Epoch: 1
Version: 1.20.1
Release: 10%{?dist}.alma
Release: 10%{?dist}.alma.plus
Summary: A high performance web server and reverse proxy server
# BSD License (two clause)
@ -50,7 +50,8 @@ License: BSD
URL: https://nginx.org
Source0: https://nginx.org/download/nginx-%{version}.tar.gz
Source1: https://nginx.org/download/nginx-%{version}.tar.gz.asc
Source1: ngx_http_geoip2_module-3.4.tar
Source1000: https://nginx.org/download/nginx-%{version}.tar.gz.asc
# Keys are found here: https://nginx.org/en/pgp_keys.html
Source2: https://nginx.org/keys/maxim.key
Source3: https://nginx.org/keys/mdounin.key
@ -164,13 +165,15 @@ for the Nginx server including the correct permissions for the
directories.
%if %{with geoip}
%package mod-http-geoip
%package mod-http-geoip2
Summary: Nginx HTTP geoip module
BuildRequires: libmaxminddb-devel
BuildRequires: GeoIP-devel
Requires: nginx(abi) = %{nginx_abiversion}
Requires: GeoIP
Requires: libmaxminddb
%description mod-http-geoip
%description mod-http-geoip2
%{summary}.
%endif
@ -230,6 +233,7 @@ Requires: gperftools-devel
%endif
%if %{with geoip}
Requires: GeoIP-devel
Requires: libmaxminddb-devel
%endif
Requires: libxslt-devel
%if 0%{?fedora} || 0%{?rhel} >= 8
@ -249,8 +253,8 @@ Requires: zlib-devel
%prep
# Combine all keys from upstream into one file
cat %{S:2} %{S:3} %{S:4} > %{_builddir}/%{name}.gpg
%{gpgverify} --keyring='%{_builddir}/%{name}.gpg' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%autosetup -p1
%{gpgverify} --keyring='%{_builddir}/%{name}.gpg' --signature='%{SOURCE1000}' --data='%{SOURCE0}'
%autosetup -p1 -T -D -b 0 -b 1
cp %{SOURCE200} %{SOURCE210} %{SOURCE10} %{SOURCE12} .
%if 0%{?rhel} > 0 && 0%{?rhel} < 8
@ -308,7 +312,7 @@ if ! ./configure \
--with-http_degradation_module \
--with-http_flv_module \
%if %{with geoip}
--with-http_geoip_module=dynamic \
--add-dynamic-module=%{_builddir}/ngx_http_geoip2_module-3.4 \
%endif
--with-http_gunzip_module \
--with-http_gzip_static_module \
@ -418,8 +422,8 @@ for i in ftdetect ftplugin indent syntax; do
done
%if %{with geoip}
echo 'load_module "%{nginx_moduledir}/ngx_http_geoip_module.so";' \
> %{buildroot}%{nginx_moduleconfdir}/mod-http-geoip.conf
echo 'load_module "%{nginx_moduledir}/ngx_http_geoip2_module.so";' \
> %{buildroot}%{nginx_moduleconfdir}/mod-http-geoip2.conf
%endif
echo 'load_module "%{nginx_moduledir}/ngx_http_image_filter_module.so";' \
> %{buildroot}%{nginx_moduleconfdir}/mod-http-image-filter.conf
@ -459,7 +463,7 @@ exit 0
%systemd_post nginx.service
%if %{with geoip}
%post mod-http-geoip
%post mod-http-geoip2
if [ $1 -eq 1 ]; then
/usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
fi
@ -552,9 +556,10 @@ fi
%dir %{_unitdir}/nginx.service.d
%if %{with geoip}
%files mod-http-geoip
%{nginx_moduleconfdir}/mod-http-geoip.conf
%{nginx_moduledir}/ngx_http_geoip_module.so
%files mod-http-geoip2
%{nginx_moduleconfdir}/mod-http-geoip2.conf
%{nginx_moduledir}/ngx_http_geoip2_module.so
%{nginx_moduledir}/ngx_stream_geoip2_module.so
%endif
%files mod-http-image-filter
@ -587,6 +592,9 @@ fi
%changelog
* Fri Jul 15 2022 Eduard Abdullin <eabdullin@almalinux.org> - 1:1.20.1-1.alma.plus
- Update geoip to geoip2
* Wed May 18 2022 Eduard Abdullin <eabdullin@almalinux.org> - 1:1.20.1-10.alma
- Debrand for AlmaLinux