;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Marius Bakke ;;; ;;; 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 . (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. . #: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))))