git: 91b22f576ce2 - main - textproc/py-anonip: new port
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 26 Sep 2026 21:00:23 UTC
The branch main has been updated by michaelo:
URL: https://cgit.FreeBSD.org/ports/commit/?id=91b22f576ce2efc29e9bd64de8de9a14cf9d0a5d
commit 91b22f576ce2efc29e9bd64de8de9a14cf9d0a5d
Author: Martin Neubauer <m.ne@gmx.net>
AuthorDate: 2023-05-20 18:01:00 +0000
Commit: Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-09-26 20:59:59 +0000
textproc/py-anonip: new port
Anonip is a tool to anonymize IP addresses in log files.
Co-authored-by: Michael Osipov <michaelo@FreeBSD.org>
PR: 271543
---
textproc/Makefile | 1 +
textproc/py-anonip/Makefile | 22 ++++++++++++++++++++++
textproc/py-anonip/distinfo | 3 +++
textproc/py-anonip/files/patch-conftest.py | 14 ++++++++++++++
textproc/py-anonip/pkg-descr | 10 ++++++++++
5 files changed, 50 insertions(+)
diff --git a/textproc/Makefile b/textproc/Makefile
index 6b24fbc16805..f55fe8554edb 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -1355,6 +1355,7 @@
SUBDIR += py-agate-dbf
SUBDIR += py-agate-excel
SUBDIR += py-alabaster
+ SUBDIR += py-anonip
SUBDIR += py-ansi2html
SUBDIR += py-ansicolors
SUBDIR += py-ansiwrap
diff --git a/textproc/py-anonip/Makefile b/textproc/py-anonip/Makefile
new file mode 100644
index 000000000000..7fc0b68613a8
--- /dev/null
+++ b/textproc/py-anonip/Makefile
@@ -0,0 +1,22 @@
+PORTNAME= anonip
+PORTVERSION= 1.1.0
+CATEGORIES= textproc python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= m.ne@gmx.net
+COMMENT= Tool to anonymize IP addresses in log files
+WWW= https://github.com/DigitaleGesellschaft/Anonip
+
+LICENSE= BSD3CLAUSE
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+
+TEST_ARGS= tests.py
+
+USES= python
+USE_PYTHON= autoplist concurrent pep517 pytest
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/textproc/py-anonip/distinfo b/textproc/py-anonip/distinfo
new file mode 100644
index 000000000000..1aeb79490a67
--- /dev/null
+++ b/textproc/py-anonip/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1684450591
+SHA256 (anonip-1.1.0.tar.gz) = ea04348c573dbcb2ac2f1e90664e5ca031ebf03649118c40aa6f5f3580b7165a
+SIZE (anonip-1.1.0.tar.gz) = 12530
diff --git a/textproc/py-anonip/files/patch-conftest.py b/textproc/py-anonip/files/patch-conftest.py
new file mode 100644
index 000000000000..715d4e7f22e7
--- /dev/null
+++ b/textproc/py-anonip/files/patch-conftest.py
@@ -0,0 +1,14 @@
+--- /dev/null
++++ conftest.py
+@@ -0,0 +1,11 @@
++import sys
++
++import pytest
++
++
++@pytest.fixture
++def backup_and_restore_sys_argv():
++ old_argv = sys.argv
++ sys.argv = sys.argv.copy()
++ yield
++ sys.argv = old_argv
diff --git a/textproc/py-anonip/pkg-descr b/textproc/py-anonip/pkg-descr
new file mode 100644
index 000000000000..1190a3448d30
--- /dev/null
+++ b/textproc/py-anonip/pkg-descr
@@ -0,0 +1,10 @@
+Anonip is a tool to anonymize IP addresses in log files.
+
+It masks the last bits of IPv4 and IPv6 addresses. That way most of the relevant
+information is preserved, while the IP-address does not match a particular
+individuum anymore.
+
+Depending on your webserver software, the log entries may directly get piped to
+Anonip. The unmasked IP addresses will never be written to any file.
+
+Using shell redirects, it's also possible to rewrite existing log files.