1 |
commit: 34abe6afc69aa103d10c6409048f706c710caf98 |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 24 14:22:30 2015 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 24 14:22:54 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34abe6af |
7 |
|
8 |
net-analyzer/net-snmp: Add USE=smux by eeL. |
9 |
|
10 |
Package-Manager: portage-2.2.25 |
11 |
|
12 |
net-analyzer/net-snmp/metadata.xml | 38 ++--- |
13 |
net-analyzer/net-snmp/net-snmp-5.7.3-r4.ebuild | 187 +++++++++++++++++++++++++ |
14 |
2 files changed, 200 insertions(+), 25 deletions(-) |
15 |
|
16 |
diff --git a/net-analyzer/net-snmp/metadata.xml b/net-analyzer/net-snmp/metadata.xml |
17 |
index 4691f46..b503064 100644 |
18 |
--- a/net-analyzer/net-snmp/metadata.xml |
19 |
+++ b/net-analyzer/net-snmp/metadata.xml |
20 |
@@ -1,29 +1,17 @@ |
21 |
<?xml version="1.0" encoding="UTF-8"?> |
22 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
23 |
<pkgmetadata> |
24 |
- <herd>netmon</herd> |
25 |
- <use> |
26 |
- <flag name="elf">Enable the use of elf utils to check uptime on some systems</flag> |
27 |
- <flag name="mfd-rewrites">Use MFD rewrites of mib modules where available</flag> |
28 |
- <flag name="rpm"> |
29 |
- Enable monitoring of <pkg>app-arch/rpm</pkg>. This flag requires |
30 |
- the bzip2 and zlib flags to be enabled as well. |
31 |
- </flag> |
32 |
- <flag name="ucd-compat"> |
33 |
- Build UCD compatibility library. Increases significantly the |
34 |
- install size. |
35 |
- </flag> |
36 |
- <flag name="pci"> |
37 |
- Use libpci (from <pkg>sys-apps/pciutils</pkg>) to look up |
38 |
- network interface description. This feature is only available on |
39 |
- Linux. |
40 |
- </flag> |
41 |
- <flag name="netlink"> |
42 |
- Use <pkg>dev-libs/libnl</pkg> to fetch TCP statistics instead of |
43 |
- using /proc/net/tcp (Linux only). |
44 |
- </flag> |
45 |
- </use> |
46 |
- <upstream> |
47 |
- <remote-id type="sourceforge">net-snmp</remote-id> |
48 |
- </upstream> |
49 |
+<herd>netmon</herd> |
50 |
+<use> |
51 |
+<flag name="elf">Enable the use of elf utils to check uptime on some systems</flag> |
52 |
+<flag name="mfd-rewrites">Use MFD rewrites of mib modules where available</flag> |
53 |
+<flag name="netlink">Use <pkg>dev-libs/libnl</pkg> to fetch TCP statistics instead of using /proc/net/tcp (Linux only).</flag> |
54 |
+<flag name="pci">Use libpci (from <pkg>sys-apps/pciutils</pkg>) to look up network interface description. This feature is only available on Linux.</flag> |
55 |
+<flag name="rpm">Enable monitoring of <pkg>app-arch/rpm</pkg>. This flag requires the bzip2 and zlib flags to be enabled as well.</flag> |
56 |
+<flag name="ucd-compat">Build UCD compatibility library. Increases significantly the install size.</flag> |
57 |
+<flag name='smux'>Enable support for the legacy smux protocol (superseded by agentx)</flag> |
58 |
+</use> |
59 |
+<upstream> |
60 |
+<remote-id type="sourceforge">net-snmp</remote-id> |
61 |
+</upstream> |
62 |
</pkgmetadata> |
63 |
|
64 |
diff --git a/net-analyzer/net-snmp/net-snmp-5.7.3-r4.ebuild b/net-analyzer/net-snmp/net-snmp-5.7.3-r4.ebuild |
65 |
new file mode 100644 |
66 |
index 0000000..84d5f1c |
67 |
--- /dev/null |
68 |
+++ b/net-analyzer/net-snmp/net-snmp-5.7.3-r4.ebuild |
69 |
@@ -0,0 +1,187 @@ |
70 |
+# Copyright 1999-2015 Gentoo Foundation |
71 |
+# Distributed under the terms of the GNU General Public License v2 |
72 |
+# $Id$ |
73 |
+ |
74 |
+EAPI=5 |
75 |
+PYTHON_COMPAT=( python2_7 ) |
76 |
+DISTUTILS_SINGLE_IMPL=yesplz |
77 |
+DISTUTILS_OPTIONAL=yesplz |
78 |
+WANT_AUTOMAKE=none |
79 |
+PATCHSET=2 |
80 |
+GENTOO_DEPEND_ON_PERL=no |
81 |
+ |
82 |
+inherit autotools distutils-r1 eutils perl-module systemd |
83 |
+ |
84 |
+DESCRIPTION="Software for generating and retrieving SNMP data" |
85 |
+HOMEPAGE="http://net-snmp.sourceforge.net/" |
86 |
+SRC_URI=" |
87 |
+ mirror://sourceforge/project/${PN}/${PN}/${PV}/${P}.tar.gz |
88 |
+ https://dev.gentoo.org/~jer/${PN}-5.7.3-patches-${PATCHSET}.tar.xz |
89 |
+" |
90 |
+ |
91 |
+S=${WORKDIR}/${P/_/.} |
92 |
+ |
93 |
+# GPL-2 for the init scripts |
94 |
+LICENSE="HPND BSD GPL-2" |
95 |
+SLOT="0" |
96 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
97 |
+IUSE="X bzip2 doc elf ipv6 libressl lm_sensors mfd-rewrites minimal mysql netlink pci perl python rpm selinux smux ssl tcpd ucd-compat zlib" |
98 |
+ |
99 |
+COMMON_DEPEND=" |
100 |
+ ssl? ( |
101 |
+ !libressl? ( >=dev-libs/openssl-0.9.6d:0 ) |
102 |
+ libressl? ( dev-libs/libressl ) |
103 |
+ ) |
104 |
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) |
105 |
+ rpm? ( |
106 |
+ app-arch/rpm |
107 |
+ dev-libs/popt |
108 |
+ ) |
109 |
+ bzip2? ( app-arch/bzip2 ) |
110 |
+ zlib? ( >=sys-libs/zlib-1.1.4 ) |
111 |
+ elf? ( dev-libs/elfutils ) |
112 |
+ python? ( |
113 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
114 |
+ ${PYTHON_DEPS} |
115 |
+ ) |
116 |
+ pci? ( sys-apps/pciutils ) |
117 |
+ lm_sensors? ( sys-apps/lm_sensors ) |
118 |
+ netlink? ( dev-libs/libnl:3 ) |
119 |
+ mysql? ( virtual/mysql ) |
120 |
+ perl? ( dev-lang/perl:= ) |
121 |
+" |
122 |
+DEPEND=" |
123 |
+ ${COMMON_DEPEND} |
124 |
+ doc? ( app-doc/doxygen ) |
125 |
+" |
126 |
+RDEPEND=" |
127 |
+ ${COMMON_DEPEND} |
128 |
+ perl? ( |
129 |
+ X? ( dev-perl/perl-tk ) |
130 |
+ !minimal? ( dev-perl/TermReadKey ) |
131 |
+ ) |
132 |
+ selinux? ( sec-policy/selinux-snmp ) |
133 |
+" |
134 |
+ |
135 |
+REQUIRED_USE=" |
136 |
+ python? ( ${PYTHON_REQUIRED_USE} ) |
137 |
+ rpm? ( bzip2 zlib ) |
138 |
+" |
139 |
+ |
140 |
+RESTRICT=test |
141 |
+ |
142 |
+pkg_setup() { |
143 |
+ use python && python-single-r1_pkg_setup |
144 |
+} |
145 |
+ |
146 |
+src_prepare() { |
147 |
+ # snmpconf generates config files with proper selinux context |
148 |
+ use selinux && epatch "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch |
149 |
+ |
150 |
+ epatch "${WORKDIR}"/patches/*.patch |
151 |
+ |
152 |
+ epatch_user |
153 |
+ |
154 |
+ eautoconf |
155 |
+} |
156 |
+ |
157 |
+src_configure() { |
158 |
+ # keep this in the same line, configure.ac arguments are passed down to config.h |
159 |
+ local mibs="host ucd-snmp/dlmod ucd-snmp/diskio ucd-snmp/extensible mibII/mta_sendmail etherlike-mib/dot3StatsTable" |
160 |
+ use lm_sensors && mibs="${mibs} ucd-snmp/lmsensorsMib" |
161 |
+ use smux && mibs="${mibs} smux" |
162 |
+ |
163 |
+ # Assume /etc/mtab is not present with a recent baselayout/openrc (bug #565136) |
164 |
+ use kernel_linux && export ac_cv_ETC_MNTTAB=/etc/mtab |
165 |
+ |
166 |
+ econf \ |
167 |
+ $(use_enable !ssl internal-md5) \ |
168 |
+ $(use_enable ipv6) \ |
169 |
+ $(use_enable mfd-rewrites) \ |
170 |
+ $(use_enable perl embedded-perl) \ |
171 |
+ $(use_enable ucd-compat ucd-snmp-compatibility) \ |
172 |
+ $(use_with bzip2) \ |
173 |
+ $(use_with elf) \ |
174 |
+ $(use_with mysql) \ |
175 |
+ $(use_with netlink nl) \ |
176 |
+ $(use_with pci) \ |
177 |
+ $(use_with perl perl-modules INSTALLDIRS=vendor) \ |
178 |
+ $(use_with python python-modules) \ |
179 |
+ $(use_with rpm) \ |
180 |
+ $(use_with ssl openssl) \ |
181 |
+ $(use_with tcpd libwrap) \ |
182 |
+ $(use_with zlib) \ |
183 |
+ --enable-shared --disable-static \ |
184 |
+ --with-default-snmp-version="3" \ |
185 |
+ --with-install-prefix="${D}" \ |
186 |
+ --with-ldflags="${LDFLAGS}" \ |
187 |
+ --with-logfile="/var/log/net-snmpd.log" \ |
188 |
+ --with-mib-modules="${mibs}" \ |
189 |
+ --with-persistent-directory="/var/lib/net-snmp" \ |
190 |
+ --with-sys-contact="root@Unknown" \ |
191 |
+ --with-sys-location="Unknown" |
192 |
+} |
193 |
+ |
194 |
+src_compile() { |
195 |
+ emake \ |
196 |
+ OTHERLDFLAGS="${LDFLAGS}" \ |
197 |
+ sedscript all |
198 |
+ |
199 |
+ use doc && emake docsdox |
200 |
+} |
201 |
+ |
202 |
+src_install () { |
203 |
+ # bug #317965 |
204 |
+ emake -j1 DESTDIR="${D}" install |
205 |
+ |
206 |
+ if use perl ; then |
207 |
+ perl_delete_localpod |
208 |
+ if ! use X; then |
209 |
+ rm "${D}"/usr/bin/tkmib || die |
210 |
+ fi |
211 |
+ else |
212 |
+ rm -f \ |
213 |
+ "${D}"/usr/bin/fixproc \ |
214 |
+ "${D}"/usr/bin/ipf-mod.pl \ |
215 |
+ "${D}"/usr/bin/mib2c \ |
216 |
+ "${D}"/usr/bin/net-snmp-cert \ |
217 |
+ "${D}"/usr/bin/snmp-bridge-mib \ |
218 |
+ "${D}"/usr/bin/snmpcheck \ |
219 |
+ "${D}"/usr/bin/snmpconf \ |
220 |
+ "${D}"/usr/bin/tkmib \ |
221 |
+ "${D}"/usr/bin/traptoemail \ |
222 |
+ "${D}"/usr/share/snmp/mib2c.perl.conf \ |
223 |
+ "${D}"/usr/share/snmp/snmp_perl_trapd.pl \ |
224 |
+ || die |
225 |
+ fi |
226 |
+ |
227 |
+ dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO |
228 |
+ newdoc EXAMPLE.conf.def EXAMPLE.conf |
229 |
+ |
230 |
+ use doc && dohtml docs/html/* |
231 |
+ |
232 |
+ keepdir /var/lib/net-snmp |
233 |
+ |
234 |
+ newinitd "${FILESDIR}"/snmpd.init.2 snmpd |
235 |
+ newconfd "${FILESDIR}"/snmpd.conf snmpd |
236 |
+ |
237 |
+ newinitd "${FILESDIR}"/snmptrapd.init.2 snmptrapd |
238 |
+ newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd |
239 |
+ |
240 |
+ systemd_dounit "${FILESDIR}"/snmpd.service |
241 |
+ systemd_dounit "${FILESDIR}"/snmptrapd.service |
242 |
+ |
243 |
+ insinto /etc/snmp |
244 |
+ newins "${S}"/EXAMPLE.conf snmpd.conf.example |
245 |
+ |
246 |
+ # Remove everything not required for an agent. |
247 |
+ # Keep only the snmpd, snmptrapd, MIBs, headers and libraries. |
248 |
+ if use minimal; then |
249 |
+ rm -rf \ |
250 |
+ "${D}"/**/*.pl \ |
251 |
+ "${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} \ |
252 |
+ "${D}"/usr/share/snmp/*.conf \ |
253 |
+ "${D}"/usr/share/snmp/snmpconf-data \ |
254 |
+ || die |
255 |
+ fi |
256 |
+} |