logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://anongit.hacktivis.me/git/overlay.git/

asncounter-0.3.0.ebuild (1206B)


  1. # Copyright 2025 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. PYTHON_COMPAT=( python3_12 )
  5. DISTUTILS_USE_PEP517=setuptools
  6. inherit distutils-r1 optfeature
  7. DESCRIPTION="Count hits per autonomous system number (ASN) and related network blocks"
  8. HOMEPAGE="https://gitlab.com/anarcat/asncounter"
  9. SRC_URI="https://gitlab.com/anarcat/asncounter/-/archive/${PV}/${P}.tar.gz"
  10. LICENSE="AGPL-3+"
  11. SLOT="0"
  12. KEYWORDS="~amd64"
  13. IUSE=""
  14. RDEPEND="
  15. dev-python/pyasn
  16. "
  17. DEPEND="${RDEPEND}"
  18. BDEPEND="app-text/lowdown"
  19. distutils_enable_tests pytest
  20. src_prepare() {
  21. distutils-r1_src_prepare
  22. export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
  23. }
  24. python_test() {
  25. epytest -k 'not test_prometheus_record'
  26. }
  27. src_install() {
  28. distutils-r1_src_install
  29. lowdown -o asncounter.1 -s -t man asncounter.1.md || die
  30. doman asncounter.1
  31. }
  32. pkg_postinst() {
  33. optfeature "To get a debugging socket" dev-python/manhole
  34. optfeature "To scrape packets directly without tcpdump (slower)" net-analyzer/scapy
  35. optfeature "To export Prometheus metrics" dev-python/prometheus-client
  36. optfeature "To aggregate network blocks in the REPL or manhole" dev-python/netaddr
  37. }