Bug 184118 - [PATCH] net-mgmt/nagios-plugins: enable check_{dns,dig} for FreeBSD 10
Summary: [PATCH] net-mgmt/nagios-plugins: enable check_{dns,dig} for FreeBSD 10
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Sivachenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-20 14:20 UTC by geoffroy desvernay
Modified: 2013-11-21 19:13 UTC (History)
1 user (show)

See Also:


Attachments
nagios-plugins-1.4.16_3,1.patch (1.62 KB, patch)
2013-11-20 14:20 UTC, geoffroy desvernay
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description geoffroy desvernay 2013-11-20 14:20:00 UTC
dig is missing from base in FreeBSD 10, add a DNS option to make nagios-plugins depend on 
dns/bind-tools if no dig is found

Port maintainer (demon@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99_11 (mode: change, diff: SVN)

Fix: Patch attached
Feature-safe: yes
How-To-Repeat: Upgrade to freebsd 10 and look how check_dns disappears silently...
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-11-20 14:20:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->demon

Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=184118 

Date: Wed, 20 Nov 2013 22:30:26 +0400
Comment 2 geoffroy desvernay 2013-11-20 23:11:04 UTC
Dmitry Sivachenko <trtrmitya@gmail.com> a écrit :
>
>I see no check âif no dig is foundâ in your patch.
>
>Probably we should check for dig binary existence and add dependency on
>bind-tools only if it is not present?

I though that the
 *_DEPENDS+=dig:DNS/bind-tools
syntax did test for a 'dig' binary before triggering dependency to bind-tools port.
I did not test on a <10 system ...
Comment 3 geoffroy desvernay 2013-11-21 08:16:44 UTC
On 21/11/2013 00:11, geoffroy desvernay wrote:
[â¦]
> 
> I though that the
>  *_DEPENDS+=dig:DNS/bind-tools
> syntax did test for a 'dig' binary before triggering dependency to bind-tools port.
> I did not test on a <10 system ...
> 

After reading bsd.port.mk, and carefully testing on a 9.2 system, it
appears that:
 - "make" in the port doesn't add bind-tools in the dependencies
 - "make build-depends" doesn't add bind-tools
 - a "poudriere bulk" build does build bind-tools, but doesn't add it to
nagios-plugins dependencies
 - "portmaster" does build and install bind-tools (because make
build-depens-list does list it ?)

I CC ports@ here because I don't understand the latter:
 - the discussed patch is here
http://www.freebsd.org/cgi/query-pr.cgi?pr=184118 and tries to add
dns/bind-tools to dependencies ONLY if there is no 'dig' binary in the
system. (via {RUN,BUILD}_DEPENDS+= dig:dns/bind-tools).
Why is portmaster installing it on a 9.2 system (with /usr/bin/dig from
base installed) ?

-- 
geoffroy desvernay
C.R.I - Administration systèmes et réseaux
Ecole Centrale de Marseille
Tel: (+33|0)4 91 05 45 24
Fax: (+33|0)4 91 05 45 98
dgeo@centrale-marseille.fr

Comment 4 Mathieu Arnold 2013-11-21 10:28:13 UTC
There's no need to add a patch, the configure script checks for the
existence of dig, and if not present, as it is in 10+ because bind was
removed, it disables the dns two checks.

-- 
Mathieu Arnold
Comment 5 dfilter service freebsd_committer freebsd_triage 2013-11-21 11:30:22 UTC
Author: demon
Date: Thu Nov 21 11:30:10 2013
New Revision: 334475
URL: http://svnweb.freebsd.org/changeset/ports/334475

Log:
  Add optional dependency on bind-tools to install dig(1) on FreeBSD-10 and above
  (it has been removed from base system).
  
  PR:		184118
  Submitted by:	Geoffroy Desvernay <dgeo@centrale-marseille.fr>

Modified:
  head/net-mgmt/nagios-plugins/Makefile
  head/net-mgmt/nagios-plugins/pkg-plist

Modified: head/net-mgmt/nagios-plugins/Makefile
==============================================================================
--- head/net-mgmt/nagios-plugins/Makefile	Thu Nov 21 11:01:31 2013	(r334474)
+++ head/net-mgmt/nagios-plugins/Makefile	Thu Nov 21 11:30:10 2013	(r334475)
@@ -18,8 +18,8 @@ USE_AUTOTOOLS=	libtool aclocal autoconf 
 ACLOCAL_ARGS=	-I m4 -I gl/m4
 AUTOMAKE_ARGS=	--add-missing
 
-OPTIONS_DEFINE=	QSTAT FPING NETSNMP RADIUS MYSQL PGSQL LDAP IPV6 JAIL NLS
-OPTIONS_DEFAULT=IPV6
+OPTIONS_DEFINE=	QSTAT FPING NETSNMP RADIUS MYSQL PGSQL LDAP IPV6 JAIL NLS DNS
+OPTIONS_DEFAULT=IPV6 DNS
 
 QSTAT_DESC=	Game server query support (check_game)
 FPING_DESC=	Support for non-flooding fast ping (check_fping)
@@ -28,6 +28,7 @@ RADIUS_DESC=	Radius support (check_radiu
 MYSQL_DESC=	MySQL support (check_mysql)
 PGSQL_DESC=	PostgreSQL support (check_pgsql)
 LDAP_DESC=	OpenLDAP support (check_ldap)
+DNS_DESC=	DNS support via dig (check_dns, check_dig)
 JAIL_DESC=	Compilation within jail(8) (see Makefile)
 
 GNU_CONFIGURE=	yes
@@ -70,6 +71,14 @@ PLIST_SUB+=	SUB_QSTAT=""
 PLIST_SUB+=	SUB_QSTAT="@comment "
 .endif
 
+.if ${PORT_OPTIONS:MDNS}
+BUILD_DEPENDS+=	dig:${PORTSDIR}/dns/bind-tools
+RUN_DEPENDS+=	dig:${PORTSDIR}/dns/bind-tools
+PLIST_SUB+=	SUB_DNS=""
+.else
+PLIST_SUB+=	SUB_DNS="@comment "
+.endif
+
 .if ${PORT_OPTIONS:MIPV6}
 CONFIGURE_ARGS+=	--with-ipv6
 .else

Modified: head/net-mgmt/nagios-plugins/pkg-plist
==============================================================================
--- head/net-mgmt/nagios-plugins/pkg-plist	Thu Nov 21 11:01:31 2013	(r334474)
+++ head/net-mgmt/nagios-plugins/pkg-plist	Thu Nov 21 11:30:10 2013	(r334475)
@@ -4,10 +4,10 @@ libexec/nagios/check_by_ssh
 libexec/nagios/check_clamd
 libexec/nagios/check_cluster
 libexec/nagios/check_dhcp
-libexec/nagios/check_dig
+%%SUB_DNS%%libexec/nagios/check_dig
 libexec/nagios/check_disk
 libexec/nagios/check_disk_smb
-libexec/nagios/check_dns
+%%SUB_DNS%%libexec/nagios/check_dns
 libexec/nagios/check_dummy
 libexec/nagios/check_file_age
 libexec/nagios/check_flexlm
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Dmitry Sivachenko freebsd_committer freebsd_triage 2013-11-21 11:30:37 UTC
State Changed
From-To: open->closed

Patch committed, thanks!