From owner-svn-src-all@freebsd.org Tue Jan 17 03:38:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E5F8CB3415; Tue, 17 Jan 2017 03:38:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04485125B; Tue, 17 Jan 2017 03:38:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0H3coSY017068; Tue, 17 Jan 2017 03:38:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H3coqg017066; Tue, 17 Jan 2017 03:38:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170338.v0H3coqg017066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 03:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312328 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 03:38:51 -0000 Author: ngie Date: Tue Jan 17 03:38:49 2017 New Revision: 312328 URL: https://svnweb.freebsd.org/changeset/base/312328 Log: Add a make target (smilint) for running smilint tool against BMIBS Running smilint against MIB definitions is useful in finding functional problems with MIB definitions/descriptions. This is inspired by the smilint targets defined in usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile Document all of the variables that are involved in running the smilint target, as well as all of the prerequisites to running it. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9099 Modified: head/share/mk/bsd.README head/share/mk/bsd.snmpmod.mk Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Tue Jan 17 01:59:42 2017 (r312327) +++ head/share/mk/bsd.README Tue Jan 17 03:38:49 2017 (r312328) @@ -418,7 +418,15 @@ tree. bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and bsd.files.mk for installing MIB description and definition files. -It has no additional targets. +It implements the following additional targets: + + smilint: + execute smilint on the MIBs defined by BMIBS. + + The net-mgmt/libsmi package must be installed before + executing this target. The net-mgmt/net-snmp package + should be installed as well to reduce false positives + from smilint. It sets/uses the following variables: @@ -444,8 +452,19 @@ EXTRAMIBSYMS Extra MIB definition files See ${MOD}_oid.h for more details. +LOCALBASE The package root where smilint and the net-snmp + definitions can be found + MOD The bsnmpd module name. +SMILINT smilint binary to use with the smilint make target. + +SMILINT_FLAGS flags to pass to smilint. + +SMIPATH A colon-separated directory path where MIBs definitions + can be found. See "SMIPATH" in smi_config for more + details. + XSYM MIB names to extract symbols for. See ${MOD}_oid.h for more details. Modified: head/share/mk/bsd.snmpmod.mk ============================================================================== --- head/share/mk/bsd.snmpmod.mk Tue Jan 17 01:59:42 2017 (r312327) +++ head/share/mk/bsd.snmpmod.mk Tue Jan 17 03:38:49 2017 (r312328) @@ -25,4 +25,18 @@ FILESGROUPS+= BMIBS BMIBSDIR?= ${SHAREDIR}/snmp/mibs .endif +.if !target(smilint) && !empty(BMIBS) +LOCALBASE?= /usr/local + +SMILINT?= ${LOCALBASE}/bin/smilint + +SMIPATH?= ${BMIBSDIR}:${LOCALBASE}/share/snmp/mibs + +SMILINT_FLAGS?= -c /dev/null -l6 -i group-membership + +smilint: ${BMIBS} + SMIPATH=${SMIPATH} ${SMILINT} ${SMILINT_FLAGS} ${.ALLSRC} +.endif +smilint: .PHONY + .include