summaryrefslogtreecommitdiff
path: root/net-analyzer/net-snmp
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/net-snmp')
-rw-r--r--net-analyzer/net-snmp/Manifest2
-rw-r--r--net-analyzer/net-snmp/files/net-snmp-5.9.4-c99.patch30
-rw-r--r--net-analyzer/net-snmp/net-snmp-5.9.4-r1.ebuild241
3 files changed, 273 insertions, 0 deletions
diff --git a/net-analyzer/net-snmp/Manifest b/net-analyzer/net-snmp/Manifest
index ad642e0e5dab..ad2681f242fd 100644
--- a/net-analyzer/net-snmp/Manifest
+++ b/net-analyzer/net-snmp/Manifest
@@ -7,6 +7,7 @@ AUX net-snmp-5.9.3-0002-Tidy-up-net-snmp-config-output.patch 1786 BLAKE2B 3f672a
AUX net-snmp-5.9.3-0003-Prune-Libs.private-entries-in-netsnmp-.pc.in.patch 1045 BLAKE2B 1cb4eb17363b9de90cecec0670ce220b04bdcb7e91af6931889139ba82ea69c24f399c5e4e1fd7ef3ae192372d7cd5bc5737b49a662cfeb685aab982ae321ede SHA512 0a1c51555359cec3f4294c0fe931c40e1cf1139a9a0e15fa7c75d6934b69cbedecc70b1bf44747f296274649bd39bf55ca55c0f9c4096a106e042b90698c95a1
AUX net-snmp-5.9.3-0004-Search-for-ltinfo-in-configure-if-needed.patch 722 BLAKE2B 00c301bbf6482f201ef2b4b82fb9899458a27e26bd0564bd98c69895f905b3abbbf5b1b8dc1ea7069059d9f1ad84a1335b84a6c151e7e75b81fc7fa3a135c578 SHA512 23e5e8920e41911dc4183a1c14b33f284a7d026a12c800dca6ddf0fa685e5a31041787599cab2671949163f539c85879e1e962128bab31ec478ebd47195ae3e0
AUX net-snmp-5.9.3-configure-clang16.patch 4779 BLAKE2B fbe551a16272c6a374ed1abdcb024e7babd15bf8854cbfec568c3c58546b3f78302ea27cbb289faa5eb84b5e8b2086505fe74bba62e76e9d1a84a09949700f26 SHA512 3b85e813b645a3a3220d1ef1b5aceee4b2ea4150159f723249171f6283c1d45a034069b3d79e5ed0faa32556a0cb662c3a8b4ad93bd69ff12d517622df21291e
+AUX net-snmp-5.9.4-c99.patch 1123 BLAKE2B dbb8ede2a810023f73a80b28d19c936c81df484b3d6b8dab96150a773a82650926945279c20e0dc8483f8a99b74a7abcb7ac0e6d790d5f43653db809f40cf183 SHA512 2ec4bb80b6f1ae11ebefd59e72e1ddc7df46e4a5dae44c1533bad6a5aadffd8b45797ac5f81ba5ec5e0b3f8eddaddf4b0e985f7962d671f2b9848145a3e8fbda
AUX snmpd.conf 552 BLAKE2B 9d2801b0ddc2148a62e332a1d355a9ddc050ec95aea2dde31f25413096c4b91dbab794c1e71b75f5baba1234d89729a6e8c50287098c04991a3eec4d9f512b3c SHA512 e64f93631e5cb2160d3fb26abb84fc74f5632d8875227d5c8dfa24809b25e8202dcf23251ea8f296aedf16298c31ce49b8e64fb6325c18775d8899a50b853bbc
AUX snmpd.init.2 680 BLAKE2B ce21b60980c2a0d74c810bb473c6b4c70eb11a2fc0636ec4af8a262ce412324ba80bc6c72b2544d359b4e2f536cf329df99e0be7d96035fa20c25f9ab7dc4a16 SHA512 10394f04dee23537a195f5aed63a3e758ca90227e269076ae9d13f883c7bd666c1c43823d1b869c43f232e97dc4138e52648cae995327f7a7f676ba416ee6fff
AUX snmpd.service 181 BLAKE2B e68aa957e78178c624faa41c93eee84dcadec817fd0b0fcba19eeded1b52d265923cfe69070d3fb71a03ba071fe10bc6b5ce0c99e3c9720521d2b37d04ce8ace SHA512 e8fe55538bf8c14ddb84c464bceddc33fdd0a03d303413783fb23d49c5d2417ead17fbcbbe460bf89738a5cff543f3ea0c7a4fd28e6f598dc9458da1d30d74ac
@@ -17,6 +18,7 @@ DIST net-snmp-5.7.3-patches-3.tar.xz 3176 BLAKE2B 1a71d6743afb841f664c6058e32c7c
DIST net-snmp-5.9.3.tar.gz 6646950 BLAKE2B b8e3de60e178ec16ad2848ad77f3bd4cbd35eaa9be103c0fa5d17514c29df4e69015ac53b54c9e565e3032b0c0bb47c19729e65310a6acefae901e101ea49451 SHA512 a476df4967029a2eb03d27b0e250170785d0a8c143d49b900ee958c3cbdfaccd415b70af40f6fbed9cb8819d522c35a6073a431091d908ccc7c018fa0aaa2abc
DIST net-snmp-5.9.4.tar.gz 6681606 BLAKE2B 2f3dfdc4ce2f4d9a1a771a77e0b0c427a89e3de6dc217009df385baabc7d860ca7714fa76360a4d14521f1b88c9c13ad46b25d3975e33e8bc4bce3eb3b27b99d SHA512 a510fa91a21e9ddc86a12fd1d0bc6b356e63f3ea53f184d2e31439004d41d902390664134dc40b3b828eabb4282eaf3da628a07c4d480fa00eff7e700950c423
EBUILD net-snmp-5.9.3-r3.ebuild 6557 BLAKE2B 719158070ba93af0208d0d970b7ac5b9858ff612f8de4ef83c6e6c6cb63e8c51f0f5452e7df220a67c3e6d660390b56d8b7b800379f1df3171eec1440fa0fcde SHA512 a63a6b28d9ce43e8f0660be514ed75f4b09adc145d04422f2f55fb4ee11604777ab25850b266d18674f976404756a13ab55e299fa72ed5115ce786665d15e44e
+EBUILD net-snmp-5.9.4-r1.ebuild 6563 BLAKE2B c29cb709e787b68ca8f3659e79c07aeec2fed913697ba82bbd81193f4fd405ed04a47c2a0c34776e16324f9c896be3f71e788de4568975c857e9b0fc0de9d22d SHA512 a6662327bd0bc448a1281c107363db5fd056587cf14e78924fbf4d964f6bc84139a20e906cfd95a9150e353d087703fca27d1972ab7fd112447fcd44f841facb
EBUILD net-snmp-5.9.4.ebuild 6526 BLAKE2B fc0a68e7e79abb9f55bab849a9378720050ba08312b671f158ed4b0e8774d667e0e10f3fa27dd5f75f9f6006ea823215b610286e9308a45818b3a9d5597298f3 SHA512 b8ce931bc4955761018ba20a6f6dadebbe1fcff2b95f9e81969970fc78484903930ba0999cc9865e470dc4c2b7bff49f8d85ea81419ca8fcab626070c44cf754
EBUILD net-snmp-9999.ebuild 6186 BLAKE2B 41fdd326cd4b9b7281aa455c741d8aa7756f6f8ef49477fa04386e809a9a1252c1881f7a50738b83896adb276f0e0545228e8d88c544bd1604d1a6d51cf685c9 SHA512 1ffc81d800fd8b20fc97bbd4cce48990c7b037ac76ff4336d681bec62c0d69d4a976cacfdfee751fe75deb8067f53da44eef16c90a3c0d632779e93d336eee8f
MISC metadata.xml 1552 BLAKE2B 4e2f3ca85f76e2bd5992e87385485055dc61f2ff52ba7a6ccc6cf2a3e34557a0d98840cfd34a88ee3c1513ebd2609e294f2db68d5963fa884eb0eb940d8599e3 SHA512 b666ad1730772cc9856bde562ad43db51b7ae1b2b9865d5804dd3313a0ca9200989d036be4ac33eaf1f5b1eda9864d9b9be4f5a58bcca8b1455d6e508e534bc2
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.9.4-c99.patch b/net-analyzer/net-snmp/files/net-snmp-5.9.4-c99.patch
new file mode 100644
index 000000000000..fd8f16c7b6e2
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-5.9.4-c99.patch
@@ -0,0 +1,30 @@
+https://github.com/net-snmp/net-snmp/issues/815
+https://github.com/net-snmp/net-snmp/commit/d30d63523bfd9ccc85175e484fea821815273237
+
+From d30d63523bfd9ccc85175e484fea821815273237 Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Wed, 15 May 2024 10:08:04 -0600
+Subject: [PATCH] snmptrapd: Fix compilation against recent versions of the
+ MySQL library
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fix the following build error:
+
+snmptrapd_sql.c:541:50: error: assignment to ‘_Bool *’ from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
+541 | _tbind[TBIND_v3_SECURITY_ENGINE].is_null = &_no_v3;
+
+Fixes: https://github.com/net-snmp/net-snmp/issues/815
+--- a/apps/snmptrapd_sql.c
++++ b/apps/snmptrapd_sql.c
+@@ -201,7 +201,7 @@ typedef struct sql_buf_t {
+ * static bind structures, plus 2 static buffers to bind to.
+ */
+ static MYSQL_BIND _tbind[TBIND_MAX], _vbind[VBIND_MAX];
+-static char _no_v3;
++static typeof(*((MYSQL_BIND*)NULL)->is_null) _no_v3;
+
+ static void _sql_process_queue(u_int dontcare, void *meeither);
+
+
diff --git a/net-analyzer/net-snmp/net-snmp-5.9.4-r1.ebuild b/net-analyzer/net-snmp/net-snmp-5.9.4-r1.ebuild
new file mode 100644
index 000000000000..bf9f27337a9c
--- /dev/null
+++ b/net-analyzer/net-snmp/net-snmp-5.9.4-r1.ebuild
@@ -0,0 +1,241 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_OPTIONAL=yes
+DISTUTILS_SINGLE_IMPL=yes
+GENTOO_DEPEND_ON_PERL=no
+PYTHON_COMPAT=( python3_{10..11} )
+WANT_AUTOMAKE=none
+
+inherit autotools distutils-r1 libtool perl-module systemd
+
+DESCRIPTION="Software for generating and retrieving SNMP data"
+HOMEPAGE="https://www.net-snmp.org/"
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/net-snmp/net-snmp"
+ inherit git-r3
+else
+ # https://github.com/net-snmp/net-snmp/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ SRC_URI="https://downloads.sourceforge.net/${PN}/${PN}/${PV}/${P}.tar.gz"
+
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+SRC_URI+=" https://dev.gentoo.org/~jsmolic/distfiles/${PN}-5.7.3-patches-3.tar.xz"
+
+# GPL-2 for the init scripts
+LICENSE="HPND BSD GPL-2"
+SLOT="0/40"
+IUSE="
+ X bzip2 doc elf kmem ipv6 lm-sensors mfd-rewrites minimal mysql
+ netlink pcap pci pcre perl python rpm selinux smux ssl tcpd ucd-compat valgrind zlib
+"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ rpm? ( bzip2 zlib )
+"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ virtual/libcrypt:=
+ bzip2? ( app-arch/bzip2 )
+ elf? ( dev-libs/elfutils )
+ lm-sensors? ( sys-apps/lm-sensors )
+ mysql? ( dev-db/mysql-connector-c:0= )
+ netlink? ( dev-libs/libnl:3 )
+ pcap? ( net-libs/libpcap )
+ pci? ( sys-apps/pciutils )
+ pcre? ( dev-libs/libpcre )
+ perl? ( dev-lang/perl:= )
+ python? (
+ $(python_gen_cond_dep '
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ ')
+ ${PYTHON_DEPS}
+ )
+ rpm? (
+ app-arch/rpm
+ dev-libs/popt
+ )
+ ssl? (
+ >=dev-libs/openssl-0.9.6d:0=
+ )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ zlib? ( >=sys-libs/zlib-1.1.4 )
+"
+BDEPEND="doc? ( app-text/doxygen )"
+DEPEND="
+ ${COMMON_DEPEND}
+ valgrind? ( dev-debug/valgrind )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ perl? (
+ X? ( dev-perl/Tk )
+ !minimal? (
+ virtual/perl-Carp
+ virtual/perl-Data-Dumper
+ virtual/perl-Getopt-Long
+ dev-perl/JSON
+ dev-perl/Mail-Sender
+ dev-perl/TermReadKey
+ virtual/perl-Term-ReadLine
+ )
+ )
+ selinux? ( sec-policy/selinux-snmp )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.8-pcap.patch
+ "${FILESDIR}"/${PN}-5.8.1-mysqlclient.patch
+ "${FILESDIR}"/${PN}-5.9-MakeMaker.patch
+ # https://github.com/net-snmp/net-snmp/pull/493
+ "${FILESDIR}"/${PN}-5.9.3-0001-Fix-LDFLAGS-vs-LIBS-ordering.patch
+ "${FILESDIR}"/${PN}-5.9.3-0002-Tidy-up-net-snmp-config-output.patch
+ "${FILESDIR}"/${PN}-5.9.3-0003-Prune-Libs.private-entries-in-netsnmp-.pc.in.patch
+ "${FILESDIR}"/${PN}-5.9.3-0004-Search-for-ltinfo-in-configure-if-needed.patch
+ "${FILESDIR}"/${PN}-5.9.4-c99.patch
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ [[ ${PV} == 9999 ]] && git-r3_src_unpack
+}
+
+src_prepare() {
+ # snmpconf generates config files with proper selinux context
+ use selinux && eapply "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch
+
+ mv "${WORKDIR}"/patches/0001-Fix-toolchain-quadruplet-detection-Gentoo-bug-432004.patch{,.disabled} || die
+ mv "${WORKDIR}"/patches/0002-Respect-DESTDIR-for-pythoninstall.patch{,.disabled} || die
+ mv "${WORKDIR}"/patches/0004-Don-t-report-CFLAGS-and-LDFLAGS-in-net-snmp-config.patch{,.disabled} || die
+ mv "${WORKDIR}"/patches/0005-Respect-LDFLAGS-properly.patch{,.disabled} || die
+ eapply "${WORKDIR}"/patches/*.patch
+
+ default
+
+ eautoconf
+ elibtoolize
+}
+
+src_configure() {
+ # keep this in the same line, configure.ac arguments are passed down to config.h
+ local mibs="host ucd-snmp/dlmod ucd-snmp/diskio ucd-snmp/extensible mibII/mta_sendmail etherlike-mib/dot3StatsTable"
+ use lm-sensors && mibs="${mibs} ucd-snmp/lmsensorsMib"
+ use smux && mibs="${mibs} smux"
+
+ # Assume /etc/mtab is not present with a recent baselayout/openrc (bug #565136)
+ use kernel_linux && export ac_cv_ETC_MNTTAB=/etc/mtab
+
+ export ac_cv_header_valgrind_{valgrind,memcheck}_h=$(usex valgrind)
+
+ econf \
+ $(use_enable !ssl internal-md5) \
+ $(use_enable ipv6) \
+ $(use_enable mfd-rewrites) \
+ $(use_enable perl embedded-perl) \
+ $(use_enable ucd-compat ucd-snmp-compatibility) \
+ $(use_with bzip2) \
+ $(use_with elf) \
+ $(use_with kmem kmem-usage) \
+ $(use_with mysql) \
+ $(use_with netlink nl) \
+ $(use_with pcap) \
+ $(use_with pci) \
+ $(use_with pcre) \
+ $(use_with perl perl-modules INSTALLDIRS=vendor) \
+ $(use_with python python-modules) \
+ $(use_with rpm) \
+ $(use_with ssl openssl) \
+ $(use_with tcpd libwrap) \
+ $(use_with zlib) \
+ --enable-shared \
+ --with-default-snmp-version="3" \
+ --with-ldflags="${LDFLAGS}" \
+ --with-logfile="/var/log/net-snmpd.log" \
+ --with-mib-modules="${mibs}" \
+ --with-persistent-directory="/var/lib/net-snmp" \
+ --with-sys-contact="root@unknown" \
+ --with-sys-location="Unknown"
+}
+
+src_compile() {
+ emake sedscript
+
+ local subdir
+ for subdir in snmplib agent/mibgroup agent apps .; do
+ emake OTHERLDFLAGS="${LDFLAGS}" -C ${subdir} all
+ done
+
+ use doc && emake docsdox
+}
+
+src_install() {
+ # bug #317965
+ emake -j1 DESTDIR="${D}" install
+
+ use python && python_optimize
+
+ if use perl ; then
+ perl_delete_localpod
+ if ! use X; then
+ rm "${D}"/usr/bin/tkmib || die
+ fi
+ else
+ rm -f \
+ "${D}"/usr/bin/fixproc \
+ "${D}"/usr/bin/ipf-mod.pl \
+ "${D}"/usr/bin/mib2c \
+ "${D}"/usr/bin/net-snmp-cert \
+ "${D}"/usr/bin/snmp-bridge-mib \
+ "${D}"/usr/bin/snmpcheck \
+ "${D}"/usr/bin/snmpconf \
+ "${D}"/usr/bin/tkmib \
+ "${D}"/usr/bin/traptoemail \
+ "${D}"/usr/share/snmp/mib2c.perl.conf \
+ "${D}"/usr/share/snmp/snmp_perl_trapd.pl \
+ || die
+ fi
+
+ dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO
+ newdoc EXAMPLE.conf.def EXAMPLE.conf
+
+ if use doc; then
+ docinto html
+ dodoc -r docs/html/*
+ fi
+
+ keepdir /var/lib/net-snmp
+
+ newinitd "${FILESDIR}"/snmpd.init.2 snmpd
+ newconfd "${FILESDIR}"/snmpd.conf snmpd
+
+ newinitd "${FILESDIR}"/snmptrapd.init.2 snmptrapd
+ newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd
+
+ systemd_dounit "${FILESDIR}"/snmpd.service
+ systemd_dounit "${FILESDIR}"/snmptrapd.service
+
+ insinto /etc/snmp
+ newins "${S}"/EXAMPLE.conf snmpd.conf.example
+
+ # Remove everything not required for an agent.
+ # Keep only the snmpd, snmptrapd, MIBs, headers and libraries.
+ if use minimal; then
+ rm -rf \
+ "${D}"/**/*.pl \
+ "${D}"/usr/bin/{encode_keychange,snmp{get,getnext,set,usm,walk,bulkwalk,table,trap,bulkget,translate,status,delta,test,df,vacm,netstat,inform,check,conf},fixproc,traptoemail} \
+ "${D}"/usr/share/snmp/*.conf \
+ "${D}"/usr/share/snmp/snmpconf-data \
+ || die
+ fi
+
+ find "${ED}" -name '*.la' -delete || die
+}