commit a3d32a07a1a43f1065c768991383af576119ef28 Author: eabdullin Date: Tue Jul 12 15:28:42 2022 +0300 Initial commit diff --git a/SOURCES/10-maxminddb.conf b/SOURCES/10-maxminddb.conf new file mode 100644 index 0000000..f0bf6de --- /dev/null +++ b/SOURCES/10-maxminddb.conf @@ -0,0 +1 @@ +LoadModule maxminddb_module modules/mod_maxminddb.so diff --git a/SOURCES/maxminddb.conf b/SOURCES/maxminddb.conf new file mode 100644 index 0000000..f169356 --- /dev/null +++ b/SOURCES/maxminddb.conf @@ -0,0 +1,9 @@ + + MaxMindDBEnable On + + # GeoLite2 databases (provided by the RPM packages geolite2-country + # and geolite2-city) are free IP geolocation databases comparable to, + # but less accurate than, MaxMind's commercial GeoIP2 databases. + MaxMindDBFile COUNTRY_DB /usr/share/GeoIP/GeoLite2-Country.mmdb + MaxMindDBFile CITY_DB /usr/share/GeoIP/GeoLite2-City.mmdb + diff --git a/SPECS/mod_maxminddb.spec b/SPECS/mod_maxminddb.spec new file mode 100644 index 0000000..647f258 --- /dev/null +++ b/SPECS/mod_maxminddb.spec @@ -0,0 +1,51 @@ +# Module Magic Number +%{!?_httpd_mmn: %global _httpd_mmn %(cat %{_includedir}/httpd/.mmn 2> /dev/null || echo 0-0)} + +Summary: Module for the Apache web server to query MaxMind DB files +Name: mod_maxminddb +Version: 1.2.0 +Release: 1%{?dist} +License: ASL 2.0 +URL: https://maxmind.github.io/mod_maxminddb/ +Source0: https://github.com/maxmind/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz +Source1: 10-maxminddb.conf +Source2: maxminddb.conf +BuildRequires: gcc +BuildRequires: httpd-devel >= 2.2.0 +BuildRequires: libmaxminddb-devel +Requires: httpd-mmn = %{_httpd_mmn} +%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} > 7) +Recommends: geolite2-country +Recommends: geolite2-city +%else +Requires: geolite2-country +Requires: geolite2-city +%endif + +%description +The mod_maxminddb allows to query MaxMind DB files from the Apache web +server using the libmaxminddb library. The MaxMind DB files are provided +as free GeoLite2 databases as well as commercial GeoIP2 databases. + +%prep +%setup -q + +%build +%{_httpd_apxs} -lmaxminddb -c src/%{name}.c # Avoid faulty upstream Makefile + +%install +install -D -p -m 0755 src/.libs/%{name}.so $RPM_BUILD_ROOT%{_httpd_moddir}/%{name}.so +install -D -p -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-maxminddb.conf +install -D -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_httpd_confdir}/maxminddb.conf + +%files +%license LICENSE +%doc Changes.md README.md +%config(noreplace) %{_httpd_modconfdir}/10-maxminddb.conf +%config(noreplace) %{_httpd_confdir}/maxminddb.conf +%{_httpd_moddir}/%{name}.so + +%changelog +* Sun Nov 28 2021 Robert Scheck 1.2.0-1 +- Upgrade to 1.2.0 (#2027078) +- Initial spec file for Fedora and Red Hat Enterprise Linux