From f77916cc75569b96d135b691197c252fcfdfce8400c864a12be587a6e93604e9 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Fri, 18 May 2018 05:54:50 +0000 Subject: [PATCH] Accepting request 610116 from home:weberho:PHP56 Initial release 1.1.0 The old mod_geoip module will stop working 2019 because maxmind will no longer update the old database format. OBS-URL: https://build.opensuse.org/request/show/610116 OBS-URL: https://build.opensuse.org/package/show/Apache:Modules/apache2-mod_maxminddb?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + apache2-mod_maxminddb.changes | 4 +++ apache2-mod_maxminddb.spec | 68 +++++++++++++++++++++++++++++++++++ mod_maxminddb-1.1.0.tar.gz | 3 ++ mod_maxminddb.conf | 54 ++++++++++++++++++++++++++++ 6 files changed, 153 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 apache2-mod_maxminddb.changes create mode 100644 apache2-mod_maxminddb.spec create mode 100644 mod_maxminddb-1.1.0.tar.gz create mode 100644 mod_maxminddb.conf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/apache2-mod_maxminddb.changes b/apache2-mod_maxminddb.changes new file mode 100644 index 0000000..8f88bfa --- /dev/null +++ b/apache2-mod_maxminddb.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Thu May 17 14:11:14 UTC 2018 - jweberhofer@weberhofer.at + +- Initial release 1.1.0 diff --git a/apache2-mod_maxminddb.spec b/apache2-mod_maxminddb.spec new file mode 100644 index 0000000..23ae89f --- /dev/null +++ b/apache2-mod_maxminddb.spec @@ -0,0 +1,68 @@ +# +# spec file for package apache2-mod_maxminddb +# +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%define modname mod_maxminddb +Name: apache2-mod_maxminddb +Version: 1.1.0 +Release: 0 +Summary: MaxMind DB Apache Module +License: Apache-2.0 +Group: Productivity/Networking/Web/Servers +URL: https://maxmind.github.io/mod_maxminddb/ +Source: https://github.com/maxmind/mod_maxminddb/releases/download/%{version}/mod_maxminddb-%{version}.tar.gz +Source2: %{modname}.conf +BuildRequires: apache-rpm-macros +BuildRequires: apache2-devel +BuildRequires: pkgconfig +BuildRequires: pkgconfig(libmaxminddb) +Requires: %{apache_mmn} +Requires: %{apache_suse_maintenance_mmn} +Requires: apache2 + +%description +This module allows you to query MaxMind DB files from Apache 2.2+ using the libmaxminddb library. + +%prep +%setup -q -n %{modname}-%{version} +# This config file is used for loading the module without +# enabling any databases which are not available on OBS +echo "MaxMindDBEnable On" > test-enable-module.conf + +%build +%configure +make %{?_smp_mflags} + +%check +set +x +%apache_test_module_load -m maxminddb -i test-enable-module.conf +set -x + +%install +mkdir -p %{buildroot}/%{apache_libexecdir} +cp -p src/.libs/%{modname}.so %{buildroot}/%{apache_libexecdir} + +mkdir -p %{buildroot}/%{apache_sysconfdir}/conf.d +cp %{SOURCE2} %{buildroot}/%{apache_sysconfdir}/conf.d + +%files +%doc Changes.md README.md +%license LICENSE +%{apache_libexecdir}/%{modname}.so +%config(noreplace) %{apache_sysconfdir}/conf.d/%{modname}.conf + +%changelog diff --git a/mod_maxminddb-1.1.0.tar.gz b/mod_maxminddb-1.1.0.tar.gz new file mode 100644 index 0000000..eb10397 --- /dev/null +++ b/mod_maxminddb-1.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b31e63764ddcc1379229059a4726c733ee0538018727b1336d02afaaa8940782 +size 99821 diff --git a/mod_maxminddb.conf b/mod_maxminddb.conf new file mode 100644 index 0000000..6e6f6aa --- /dev/null +++ b/mod_maxminddb.conf @@ -0,0 +1,54 @@ + + MaxMindDBEnable On + + # ### + # specify database locations + # + MaxMindDBFile COUNTRY_DB /var/lib/GeoIP/GeoLite2-Country.mmdb + MaxMindDBFile CITY_DB /var/lib/GeoIP/GeoLite2-City.mmdb + + # ### + # assign the lookup result to an environment variable + # + MaxMindDBEnv COUNTRY_CODE COUNTRY_DB/country/iso_code + MaxMindDBEnv REGION_CODE CITY_DB/subdivisions/0/iso_code + + # ### + # ASN Database + # + #MaxMindDBFile ASN_DB /var/lib/GeoIP/GeoLite2-ASN.mmdb + # + #MaxMindDBEnv MM_ASN ASN_DB/autonomous_system_number + #MaxMindDBEnv MM_ASORG ASN_DB/autonomous_system_organization + + # ### + # City Database + # + #MaxMindDBEnv MM_COUNTRY_CODE CITY_DB/country/iso_code + #MaxMindDBEnv MM_COUNTRY_NAME CITY_DB/country/names/en + #MaxMindDBEnv MM_CITY_NAME CITY_DB/city/names/en + #MaxMindDBEnv MM_LONGITUDE CITY_DB/location/longitude + #MaxMindDBEnv MM_LATITUDE CITY_DB/location/latitude + + # ### + # Connection-Type Database + # + #MaxMindDBFile CONNECTION_TYPE_DB /var/lib/GeoIP/GeoIP2-Connection-Type.mmdb + #MaxMindDBEnv MM_CONNECTION_TYPE CONNECTION_TYPE_DB/connection_type + + # ### + # Domain Database + # + #MaxMindDBFile DOMAIN_DB /var/lib/GeoIP/GeoIP2-Domain.mmdb + #MaxMindDBEnv MM_DOMAIN DOMAIN_DB/domain + + # ### + # ISP Database + # + #MaxMindDBFile ISP_DB /var/lib/GeoIP/GeoIP2-ISP.mmdb + # + #MaxMindDBEnv MM_ASN ISP_DB/autonomous_system_number + #MaxMindDBEnv MM_ASORG ISP_DB/autonomous_system_organization + #MaxMindDBEnv MM_ISP ISP_DB/isp + #MaxMindDBEnv MM_ORG ISP_DB/organization +