[packages/python3-geoip2] initial; python3 only library
arekm
arekm at pld-linux.org
Thu Feb 15 15:21:12 CET 2024
commit 9987f50f1cd9e5d5f81d34c65956c94bf1f38329
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Feb 15 14:36:29 2024 +0100
initial; python3 only library
python3-geoip2.spec | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
---
diff --git a/python3-geoip2.spec b/python3-geoip2.spec
new file mode 100644
index 0000000..3f7aae8
--- /dev/null
+++ b/python3-geoip2.spec
@@ -0,0 +1,90 @@
+# Conditional build:
+%bcond_without doc # API documentation
+%bcond_without tests # unit tests
+
+%define module geoip2
+Summary: GeoIP2 webservice client and database reader
+Name: python3-%{module}
+Version: 4.8.0
+Release: 0.1
+License: LGPL v2.1
+Group: Libraries/Python
+Source0: https://pypi.debian.net/geoip2/%{module}-%{version}.tar.gz
+# Source0-md5: ad58a2379172ad3a338c92537e4e354b
+URL: https://pypi.org/project/geoip2/
+BuildRequires: python3-devel >= 1:3.8
+BuildRequires: python3-httpretty >= 0.6.1
+BuildRequires: python3-maxminddb
+BuildRequires: python3-modules
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with tests}
+BuildRequires: python3-mocket
+%endif
+%if %{with doc}
+BuildRequires: sphinx-pdg-3
+%endif
+Requires: python3-modules >= 1:3.2
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package provides an API for the GeoIP2 web services and
+databases. The API also works with MaxMind's free GeoLite2 databases.
+
+%package apidocs
+Summary: API documentation for Python %{module} module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
+Group: Documentation
+BuildArch: noarch
+
+%description apidocs
+API documentation for Python %{module} module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona %{module}.
+
+%prep
+%setup -q -n %{module}-%{version}
+
+cat >setup.py <<EOF
+from setuptools import setup
+setup()
+EOF
+
+%build
+%py3_build %{?with_tests:test}
+
+%if %{with doc}
+%{__make} -C docs html \
+ SPHINXBUILD=sphinx-build-3
+rm -rf docs/_build/html/_sources
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
+ | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc HISTORY.rst README.rst
+%dir %{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/%{module}/*.py
+%{py3_sitescriptdir}/%{module}/__pycache__
+%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%{_examplesdir}/%{name}-%{version}
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/*
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-geoip2.git/commitdiff/9987f50f1cd9e5d5f81d34c65956c94bf1f38329
More information about the pld-cvs-commit
mailing list