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 (1222B)


  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..14} )
  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. RDEPEND="
  14. dev-python/pyasn[${PYTHON_USEDEP}]
  15. "
  16. DEPEND="${RDEPEND}"
  17. BDEPEND="app-text/lowdown"
  18. distutils_enable_tests pytest
  19. src_prepare() {
  20. distutils-r1_src_prepare
  21. export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
  22. }
  23. python_test() {
  24. epytest -k 'not test_prometheus_record'
  25. }
  26. src_install() {
  27. distutils-r1_src_install
  28. lowdown -o asncounter.1 -s -t man asncounter.1.md || die
  29. doman asncounter.1
  30. }
  31. pkg_postinst() {
  32. optfeature "To get a debugging socket" dev-python/manhole
  33. optfeature "To scrape packets directly without tcpdump (slower)" net-analyzer/scapy
  34. optfeature "To export Prometheus metrics" dev-python/prometheus-client
  35. optfeature "To aggregate network blocks in the REPL or manhole" dev-python/netaddr
  36. }