Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/net-snmp/
Date: Wed, 26 May 2021 08:51:19
Message-Id: 1622018770.1c74951db424278faeca233348ff6d618f13e537.sam@gentoo
1 commit: 1c74951db424278faeca233348ff6d618f13e537
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 26 08:42:37 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed May 26 08:46:10 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c74951d
7
8 net-analyzer/net-snmp: add 5.9.1
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 net-analyzer/net-snmp/Manifest | 1 +
13 net-analyzer/net-snmp/net-snmp-5.9.1.ebuild | 211 ++++++++++++++++++++++++++++
14 2 files changed, 212 insertions(+)
15
16 diff --git a/net-analyzer/net-snmp/Manifest b/net-analyzer/net-snmp/Manifest
17 index 1d806f07585..3636244dbab 100644
18 --- a/net-analyzer/net-snmp/Manifest
19 +++ b/net-analyzer/net-snmp/Manifest
20 @@ -1,2 +1,3 @@
21 DIST net-snmp-5.7.3-patches-3.tar.xz 3176 BLAKE2B 1a71d6743afb841f664c6058e32c7c411af62b0f36acd3bb9251804893ed12f462a0c5bab828e309eeec7824def2dca8fa866350b90a62ec4f0df1141b51ecae SHA512 d8a91b9668320a1e19d062eb86dd4d16beb7c2d15ac7ebbb9d2a4bd298af39bbb0a2613504dbb0057cccdec731f08f2308c5a15395e1fbc29bb0611ed8aca636
22 +DIST net-snmp-5.9.1.tar.gz 6781346 BLAKE2B 4242ca77372005f995dfd228bec51d35b6b0f8c0ab0e44ed40cdb3cc0578b64e97444ffcb074dceca30739deadb46e68f1c75e87d3f1768d81b5e084b0fc0f5f SHA512 ae158ab41961ee2064d85187337979e6ff6ba90f3136b8a960e9ae46ee1408d9d2f0c5c4dfc3a3302e6dbb357cddf1221489435288c4f52182a03e94a9e450c3
23 DIST net-snmp-5.9.tar.xz 4082580 BLAKE2B 9dfd5a7dfe4ca18b16c71c9f5cb70c540d16aa36a0b2dacd3ddc465934f96ac473f77490af78d202bf6dad4eddea5d75665a770df74132aafda39f5f3a87d835 SHA512 3f1e27caa8e5306d451b61b08c2daf007929a850661962fcd29b528a80332a980184303a7e87c96d8d2774181758889dc825cb08e3c3b353c5e7ca1ebcc09173
24
25 diff --git a/net-analyzer/net-snmp/net-snmp-5.9.1.ebuild b/net-analyzer/net-snmp/net-snmp-5.9.1.ebuild
26 new file mode 100644
27 index 00000000000..4f9ee76b72f
28 --- /dev/null
29 +++ b/net-analyzer/net-snmp/net-snmp-5.9.1.ebuild
30 @@ -0,0 +1,211 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +DISTUTILS_OPTIONAL=yes
37 +DISTUTILS_SINGLE_IMPL=yes
38 +GENTOO_DEPEND_ON_PERL=no
39 +PYTHON_COMPAT=( python3_{7,8,9} )
40 +WANT_AUTOMAKE=none
41 +
42 +inherit autotools distutils-r1 perl-module systemd
43 +
44 +DESCRIPTION="Software for generating and retrieving SNMP data"
45 +HOMEPAGE="http://www.net-snmp.org/"
46 +SRC_URI="
47 + https://dev.gentoo.org/~jer/${PN}-5.7.3-patches-3.tar.xz
48 + https://github.com/net-snmp/net-snmp/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
49 +"
50 +
51 +# GPL-2 for the init scripts
52 +LICENSE="HPND BSD GPL-2"
53 +SLOT="0/40"
54 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
55 +IUSE="
56 + X bzip2 doc elf kmem ipv6 lm-sensors mfd-rewrites minimal mysql
57 + netlink pcap pci perl python rpm selinux smux ssl tcpd ucd-compat zlib
58 +"
59 +REQUIRED_USE="
60 + python? ( ${PYTHON_REQUIRED_USE} )
61 + rpm? ( bzip2 zlib )
62 +"
63 +RESTRICT="test"
64 +
65 +COMMON_DEPEND="
66 + bzip2? ( app-arch/bzip2 )
67 + elf? ( dev-libs/elfutils )
68 + lm-sensors? ( sys-apps/lm-sensors )
69 + mysql? ( dev-db/mysql-connector-c:0= )
70 + netlink? ( dev-libs/libnl:3 )
71 + pcap? ( net-libs/libpcap )
72 + pci? ( sys-apps/pciutils )
73 + perl? ( dev-lang/perl:= )
74 + python? (
75 + $(python_gen_cond_dep '
76 + dev-python/setuptools[${PYTHON_USEDEP}]
77 + ')
78 + ${PYTHON_DEPS}
79 + )
80 + rpm? (
81 + app-arch/rpm
82 + dev-libs/popt
83 + )
84 + ssl? (
85 + >=dev-libs/openssl-0.9.6d:0=
86 + )
87 + tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
88 + zlib? ( >=sys-libs/zlib-1.1.4 )
89 +"
90 +BDEPEND="doc? ( app-doc/doxygen )"
91 +DEPEND="${COMMON_DEPEND}"
92 +RDEPEND="
93 + ${COMMON_DEPEND}
94 + perl? (
95 + X? ( dev-perl/Tk )
96 + !minimal? ( dev-perl/TermReadKey )
97 + )
98 + selinux? ( sec-policy/selinux-snmp )
99 +"
100 +
101 +PATCHES=(
102 + "${FILESDIR}"/${PN}-5.7.3-include-limits.patch
103 + "${FILESDIR}"/${PN}-5.8-do-not-conflate-LDFLAGS-and-LIBS.patch
104 + "${FILESDIR}"/${PN}-5.8-pcap.patch
105 + "${FILESDIR}"/${PN}-5.8.1-pkg-config.patch
106 + "${FILESDIR}"/${PN}-5.8.1-net-snmp-config-libdir.patch
107 + "${FILESDIR}"/${PN}-5.8.1-mysqlclient.patch
108 + "${FILESDIR}"/${PN}-5.9-MakeMaker.patch
109 + "${FILESDIR}"/${PN}-99999999-tinfo.patch
110 +)
111 +
112 +pkg_setup() {
113 + use python && python-single-r1_pkg_setup
114 +}
115 +
116 +src_prepare() {
117 + # snmpconf generates config files with proper selinux context
118 + use selinux && eapply "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch
119 +
120 + mv "${WORKDIR}"/patches/0002-Respect-DESTDIR-for-pythoninstall.patch{,.disabled} || die
121 + mv "${WORKDIR}"/patches/0004-Don-t-report-CFLAGS-and-LDFLAGS-in-net-snmp-config.patch{,.disabled} || die
122 + eapply "${WORKDIR}"/patches/*.patch
123 +
124 + default
125 +
126 + eautoconf
127 +}
128 +
129 +src_configure() {
130 + # keep this in the same line, configure.ac arguments are passed down to config.h
131 + local mibs="host ucd-snmp/dlmod ucd-snmp/diskio ucd-snmp/extensible mibII/mta_sendmail etherlike-mib/dot3StatsTable"
132 + use lm-sensors && mibs="${mibs} ucd-snmp/lmsensorsMib"
133 + use smux && mibs="${mibs} smux"
134 +
135 + # Assume /etc/mtab is not present with a recent baselayout/openrc (bug #565136)
136 + use kernel_linux && export ac_cv_ETC_MNTTAB=/etc/mtab
137 +
138 + econf \
139 + $(use_enable !ssl internal-md5) \
140 + $(use_enable ipv6) \
141 + $(use_enable mfd-rewrites) \
142 + $(use_enable perl embedded-perl) \
143 + $(use_enable ucd-compat ucd-snmp-compatibility) \
144 + $(use_with bzip2) \
145 + $(use_with elf) \
146 + $(use_with kmem kmem-usage) \
147 + $(use_with mysql) \
148 + $(use_with netlink nl) \
149 + $(use_with pcap) \
150 + $(use_with pci) \
151 + $(use_with perl perl-modules INSTALLDIRS=vendor) \
152 + $(use_with python python-modules) \
153 + $(use_with rpm) \
154 + $(use_with ssl openssl) \
155 + $(use_with tcpd libwrap) \
156 + $(use_with zlib) \
157 + --disable-static \
158 + --enable-shared \
159 + --with-default-snmp-version="3" \
160 + --with-install-prefix="${D}" \
161 + --with-ldflags="${LDFLAGS}" \
162 + --with-logfile="/var/log/net-snmpd.log" \
163 + --with-mib-modules="${mibs}" \
164 + --with-persistent-directory="/var/lib/net-snmp" \
165 + --with-sys-contact="root@unknown" \
166 + --with-sys-location="Unknown"
167 +}
168 +
169 +src_compile() {
170 + emake sedscript
171 +
172 + local subdir
173 + for subdir in snmplib agent/mibgroup agent apps .; do
174 + emake OTHERLDFLAGS="${LDFLAGS}" -C ${subdir} all
175 + done
176 +
177 + use doc && emake docsdox
178 +}
179 +
180 +src_install() {
181 + # bug #317965
182 + emake -j1 DESTDIR="${D}" install
183 +
184 + use python && python_optimize
185 +
186 + if use perl ; then
187 + perl_delete_localpod
188 + if ! use X; then
189 + rm "${D}"/usr/bin/tkmib || die
190 + fi
191 + else
192 + rm -f \
193 + "${D}"/usr/bin/fixproc \
194 + "${D}"/usr/bin/ipf-mod.pl \
195 + "${D}"/usr/bin/mib2c \
196 + "${D}"/usr/bin/net-snmp-cert \
197 + "${D}"/usr/bin/snmp-bridge-mib \
198 + "${D}"/usr/bin/snmpcheck \
199 + "${D}"/usr/bin/snmpconf \
200 + "${D}"/usr/bin/tkmib \
201 + "${D}"/usr/bin/traptoemail \
202 + "${D}"/usr/share/snmp/mib2c.perl.conf \
203 + "${D}"/usr/share/snmp/snmp_perl_trapd.pl \
204 + || die
205 + fi
206 +
207 + dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO
208 + newdoc EXAMPLE.conf.def EXAMPLE.conf
209 +
210 + if use doc; then
211 + docinto html
212 + dodoc -r docs/html/*
213 + fi
214 +
215 + keepdir /var/lib/net-snmp
216 +
217 + newinitd "${FILESDIR}"/snmpd.init.2 snmpd
218 + newconfd "${FILESDIR}"/snmpd.conf snmpd
219 +
220 + newinitd "${FILESDIR}"/snmptrapd.init.2 snmptrapd
221 + newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd
222 +
223 + systemd_dounit "${FILESDIR}"/snmpd.service
224 + systemd_dounit "${FILESDIR}"/snmptrapd.service
225 +
226 + insinto /etc/snmp
227 + newins "${S}"/EXAMPLE.conf snmpd.conf.example
228 +
229 + # Remove everything not required for an agent.
230 + # Keep only the snmpd, snmptrapd, MIBs, headers and libraries.
231 + if use minimal; then
232 + rm -rf \
233 + "${D}"/**/*.pl \
234 + "${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} \
235 + "${D}"/usr/share/snmp/*.conf \
236 + "${D}"/usr/share/snmp/snmpconf-data \
237 + || die
238 + fi
239 +
240 + find "${ED}" -name '*.la' -delete || die
241 +}