Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/net-snmp/
Date: Tue, 10 Mar 2020 08:23:01
Message-Id: 1583828545.e3c58e044179d07c99883d7802d27bc44d1f9c5c.jer@gentoo
1 commit: e3c58e044179d07c99883d7802d27bc44d1f9c5c
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 21 08:08:40 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 10 08:22:25 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3c58e04
7
8 net-analyzer/net-snmp: Version 5.8.1_pre2
9
10 Package-Manager: Portage-2.3.89, Repoman-2.3.20
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 net-analyzer/net-snmp/Manifest | 1 +
14 net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild | 209 +++++++++++++++++++++++
15 2 files changed, 210 insertions(+)
16
17 diff --git a/net-analyzer/net-snmp/Manifest b/net-analyzer/net-snmp/Manifest
18 index 196eb1052f7..1b1b59bac83 100644
19 --- a/net-analyzer/net-snmp/Manifest
20 +++ b/net-analyzer/net-snmp/Manifest
21 @@ -1,3 +1,4 @@
22 DIST net-snmp-5.7.3-patches-3.tar.xz 3176 BLAKE2B 1a71d6743afb841f664c6058e32c7c411af62b0f36acd3bb9251804893ed12f462a0c5bab828e309eeec7824def2dca8fa866350b90a62ec4f0df1141b51ecae SHA512 d8a91b9668320a1e19d062eb86dd4d16beb7c2d15ac7ebbb9d2a4bd298af39bbb0a2613504dbb0057cccdec731f08f2308c5a15395e1fbc29bb0611ed8aca636
23 DIST net-snmp-5.8.1.pre1.tar.gz 6630615 BLAKE2B 32ae7177fc08a773928da7f19cd06617feb1358c0dd21d39e08db460fa4267b6353f4afede1f5a500a628235a6a94d95700c84df6e85bda18b7a7a6e7bf3781f SHA512 e1ad421970abb67490a08fa735bbe9ff77a6fc5a19b8bf6942bef80f5b328f8038373cd5995970085177bcfe939dfa309019512b2abce0e8cf779e693f7d6dbd
24 +DIST net-snmp-5.8.1.pre2.tar.gz 6642893 BLAKE2B 4b2a1e87738c3bde49354f0cca84628f2953ee14f6b08ca53cf0bc5c320052cb4fe0f6eeb46551eaf2d45ba9c17f86ce06b64c00c1629b2d17bc351c0ccb37a8 SHA512 78cd9a29cc89ff7fa170ee767db3ca2077fc1d877f207c018887c2ea0148ffaf01eb013efc21b47f14c893a6ca48b3b439210ccd27dfc77f8c8e56bf9546f23e
25 DIST net-snmp-5.8.tar.gz 6591680 BLAKE2B ac1bff4152310da57818a00d752a08a7fc61d697b02479d9952ca12d024d3d68dc8bfa674571e93d6f3597605b2fe91513fb6839057a80f2c3dd8d0cce0077f2 SHA512 27895a583b23f3e14c48562bc32f3ba83513d81aa848e878be9a3650f0458d45950635c937ef627135f80b757b663e71fab9a3bde4fd91889153998ae3468fe7
26
27 diff --git a/net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild b/net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild
28 new file mode 100644
29 index 00000000000..d853e1f035c
30 --- /dev/null
31 +++ b/net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild
32 @@ -0,0 +1,209 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +PYTHON_COMPAT=( python2_7 )
38 +DISTUTILS_SINGLE_IMPL=yesplz
39 +DISTUTILS_OPTIONAL=yesplz
40 +WANT_AUTOMAKE=none
41 +PATCHSET=3
42 +GENTOO_DEPEND_ON_PERL=no
43 +
44 +inherit autotools distutils-r1 perl-module systemd
45 +
46 +DESCRIPTION="Software for generating and retrieving SNMP data"
47 +HOMEPAGE="http://www.net-snmp.org/"
48 +SRC_URI="
49 + mirror://sourceforge/project/${PN}/${PN}/${PV/_p*/}-pre-releases/${P/_pre/.pre}.tar.gz
50 + https://dev.gentoo.org/~jer/${PN}-5.7.3-patches-3.tar.xz
51 +"
52 +
53 +S=${WORKDIR}/${P/_/.}
54 +
55 +# GPL-2 for the init scripts
56 +LICENSE="HPND BSD GPL-2"
57 +SLOT="0/35"
58 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
59 +IUSE="
60 + X bzip2 doc elf kmem ipv6 libressl lm-sensors mfd-rewrites minimal mysql
61 + netlink pcap pci perl python rpm selinux smux ssl tcpd ucd-compat zlib
62 +"
63 +REQUIRED_USE="
64 + python? ( ${PYTHON_REQUIRED_USE} )
65 + rpm? ( bzip2 zlib )
66 +"
67 +
68 +COMMON_DEPEND="
69 + bzip2? ( app-arch/bzip2 )
70 + elf? ( dev-libs/elfutils )
71 + lm-sensors? ( sys-apps/lm-sensors )
72 + mysql? ( dev-db/mysql-connector-c:0= )
73 + netlink? ( dev-libs/libnl:3 )
74 + pcap? ( net-libs/libpcap )
75 + pci? ( sys-apps/pciutils )
76 + perl? ( dev-lang/perl:= )
77 + python? (
78 + $(python_gen_cond_dep '
79 + dev-python/setuptools[${PYTHON_MULTI_USEDEP}]
80 + ')
81 + ${PYTHON_DEPS}
82 + )
83 + rpm? (
84 + app-arch/rpm
85 + dev-libs/popt
86 + )
87 + ssl? (
88 + !libressl? ( >=dev-libs/openssl-0.9.6d:0= )
89 + libressl? ( dev-libs/libressl:= )
90 + )
91 + tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
92 + zlib? ( >=sys-libs/zlib-1.1.4 )
93 +"
94 +DEPEND="
95 + ${COMMON_DEPEND}
96 + doc? ( app-doc/doxygen )
97 +"
98 +RDEPEND="
99 + ${COMMON_DEPEND}
100 + perl? (
101 + X? ( dev-perl/Tk )
102 + !minimal? ( dev-perl/TermReadKey )
103 + )
104 + selinux? ( sec-policy/selinux-snmp )
105 +"
106 +S=${WORKDIR}/${P/_pre/.pre}
107 +RESTRICT=test
108 +PATCHES=(
109 + "${FILESDIR}"/${PN}-5.7.3-include-limits.patch
110 + "${FILESDIR}"/${PN}-5.8-do-not-conflate-LDFLAGS-and-LIBS.patch
111 + "${FILESDIR}"/${PN}-5.8-pcap.patch
112 + "${FILESDIR}"/${PN}-5.8-tinfo.patch
113 + "${FILESDIR}"/${PN}-5.8.1-pkg-config.patch
114 +)
115 +
116 +pkg_setup() {
117 + use python && python-single-r1_pkg_setup
118 +}
119 +
120 +src_prepare() {
121 + # snmpconf generates config files with proper selinux context
122 + use selinux && eapply "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch
123 +
124 + mv "${WORKDIR}"/patches/0002-Respect-DESTDIR-for-pythoninstall.patch{,.disabled} || die
125 + mv "${WORKDIR}"/patches/0004-Don-t-report-CFLAGS-and-LDFLAGS-in-net-snmp-config.patch{,.disabled} || die
126 + eapply "${WORKDIR}"/patches/*.patch
127 +
128 + default
129 +
130 + eautoconf
131 +}
132 +
133 +src_configure() {
134 + # keep this in the same line, configure.ac arguments are passed down to config.h
135 + local mibs="host ucd-snmp/dlmod ucd-snmp/diskio ucd-snmp/extensible mibII/mta_sendmail etherlike-mib/dot3StatsTable"
136 + use lm-sensors && mibs="${mibs} ucd-snmp/lmsensorsMib"
137 + use smux && mibs="${mibs} smux"
138 +
139 + # Assume /etc/mtab is not present with a recent baselayout/openrc (bug #565136)
140 + use kernel_linux && export ac_cv_ETC_MNTTAB=/etc/mtab
141 +
142 + econf \
143 + $(use_enable !ssl internal-md5) \
144 + $(use_enable ipv6) \
145 + $(use_enable mfd-rewrites) \
146 + $(use_enable perl embedded-perl) \
147 + $(use_enable ucd-compat ucd-snmp-compatibility) \
148 + $(use_with bzip2) \
149 + $(use_with elf) \
150 + $(use_with kmem kmem-usage) \
151 + $(use_with mysql) \
152 + $(use_with netlink nl) \
153 + $(use_with pcap) \
154 + $(use_with pci) \
155 + $(use_with perl perl-modules INSTALLDIRS=vendor) \
156 + $(use_with python python-modules) \
157 + $(use_with rpm) \
158 + $(use_with ssl openssl) \
159 + $(use_with tcpd libwrap) \
160 + $(use_with zlib) \
161 + --enable-shared --disable-static \
162 + --with-default-snmp-version="3" \
163 + --with-install-prefix="${D}" \
164 + --with-ldflags="${LDFLAGS}" \
165 + --with-logfile="/var/log/net-snmpd.log" \
166 + --with-mib-modules="${mibs}" \
167 + --with-persistent-directory="/var/lib/net-snmp" \
168 + --with-sys-contact="root@Unknown" \
169 + --with-sys-location="Unknown"
170 +}
171 +
172 +src_compile() {
173 + for target in snmplib agent sedscript all; do
174 + emake OTHERLDFLAGS="${LDFLAGS}" ${target}
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 +}