1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
| | ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages snmp)
#:use-module (gnu packages)
#:use-module (gnu packages compression)
#:use-module (gnu packages linux)
#:use-module (gnu packages perl)
#:use-module (gnu packages tls)
#:use-module (guix build-system gnu)
#:use-module (guix download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils))
(define-public net-snmp
(package
(name "net-snmp")
(version "5.8.pre1")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/net-snmp/"
"5.8-pre-releases/net-snmp-" version
".tar.gz"))
(sha256
(base32
"1f1rwq2cqz9ysapl96rsay240dbz8s6wsprms7skl2vacq94s2bd"))
(patches (search-patches "net-snmp-disable-network-tests.patch"))
(modules '((guix build utils)))
(snippet
'(begin
;; Drop bundled libraries.
(delete-file-recursively "snmplib/openssl")
#t))))
(build-system gnu-build-system)
(arguments
`(#:test-target "test"
;; XXX: With parallel build enabled, Perl modules may not get linked with
;; libnetsnmp. See e.g. <https://bugzilla.novell.com/show_bug.cgi?id=819497>.
#:parallel-build? #f
#:make-flags (let ((out (assoc-ref %outputs "out")))
(list (string-append "INSTALLSITEARCH=" out
"/lib/perl5/site_perl/"
,(package-version perl))
(string-append "INSTALLSITEMAN3DIR=" out
"/share/man/man3")
;; Make sure the Perl modules get a proper RUNPATH.
;(string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
))
#:phases (modify-phases %standard-phases
(add-before 'check 'patch-tests
(lambda _
(substitute* "testing/fulltests/support/simple_TESTCONF.sh"
(("NETSTAT=\"\"") (string-append "NETSTAT="
(which "netstat"))))
(substitute* "testing/fulltests/default/T065agentextend_sh_simple"
(("/bin/sh") (which "sh")))
(substitute* '("testing/fulltests/default/T061agentperl_simple"
"testing/fulltests/default/T065agentextend_simple"
"testing/fulltests/default/T115agentxperl_simple")
(("/usr/bin/env") (which "env")))
;; Note: to debug test failures, step into the failed build
;; directory, export OK_TO_SAVE_RESULT and run "make testfailed".
#t)))))
(native-inputs
`(("net-tools" ,net-tools-for-tests)))
(inputs
`(("bzip2" ,bzip2)
("libnl" ,libnl)
("linux-libre-headers" ,linux-libre-headers)
("openssl" ,openssl)
("perl" ,perl)
("zlib" ,zlib)))
(home-page "http://net-snmp.sourceforge.net/")
(synopsis "SNMP tools and libraries")
(description
"@dfn{SNMP} (Simple Network Management Protocol) is a widely used protocol
for monitoring and managing servers and network devices. This package includes
command-line utilities for retrieving information and sending commands, a
graphical @dfn{MIB} (Management Information Base) browser, a daemon for responding
to SNMP commands (@command{snmptrapd}), an extensible SNMP server (@command{snmpd}),
and libraries for writing other SNMP applications.")
;; Distributed under HPND and multiple variants of the 3-clause BSD license.
;; See COPYING for full information.
(license (list license:hpnd license:bsd-3))))
|