55 lines
1.3 KiB
RPMSpec
55 lines
1.3 KiB
RPMSpec
%global pypi_name geoip2
|
|
%global srcname GeoIP2-python
|
|
%global desc This package provides an API for the GeoIP2 web services.
|
|
%global test_data MaxMind-DB
|
|
%global test_data_rls 1271107ccad72c320bc7dc8aefd767cba550101a
|
|
|
|
Name: python-%{pypi_name}
|
|
Version: 4.8.0
|
|
Release: 3%{?dist}
|
|
Summary: MaxMind GeoIP2 API
|
|
|
|
License: Apache-2.0
|
|
URL: https://www.maxmind.com/
|
|
Source0: https://github.com/maxmind/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz
|
|
Source1: https://github.com/maxmind/%{test_data}/archive/%{test_data_rls}/%{test_data}-%{test_data_rls}.tar.gz
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: python3.11-devel
|
|
BuildRequires: python3.11-rpm-macros
|
|
|
|
%description
|
|
%{desc}
|
|
|
|
%package -n python3.11-%{pypi_name}
|
|
Summary: %{summary}
|
|
Provides: python3-geoip2
|
|
|
|
%description -n python3.11-%{pypi_name}
|
|
%{desc}
|
|
|
|
|
|
%prep
|
|
%autosetup -n %{srcname}-%{version} -a 1
|
|
rmdir tests/data
|
|
mv -f %{test_data}-%{test_data_rls} tests/data
|
|
|
|
|
|
%build
|
|
%py3_build
|
|
|
|
rm -rf html/.{buildinfo,doctrees}
|
|
|
|
%install
|
|
%py3_install
|
|
|
|
%check
|
|
# tests/webservice_test.py requires mocket not available in Fedora
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m unittest tests/database_test.py tests/models_test.py
|
|
|
|
%files -n python3.11-%{pypi_name} -f %{pyproject_files}
|
|
%doc README.rst LICENSE
|
|
|
|
|