Bug 232716 - net-mgmt/mk-livestatus always build with NAGIOS4 support
Summary: net-mgmt/mk-livestatus always build with NAGIOS4 support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Tobias Kortkamp
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2018-10-26 16:33 UTC by Leonid Vasiliev
Modified: 2019-04-15 08:39 UTC (History)
2 users (show)

See Also:
egypcio: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Vasiliev 2018-10-26 16:33:37 UTC
Hello,

mk-livestatus always build with NAGIOS4 support:

---Begin OPTIONS List---
===> The following configuration options are available for mk-livestatus-1.2.8p20:
     EXAMPLES=on: Build and/or install examples
====> Options available for the single NAGIOS: you have to select exactly one of them
     NAGIOS3=on: build for nagios-3.x
     NAGIOS4=off: build for nagios-4.x
===> Use 'make config' to modify these settings
---End OPTIONS List---

--MAINTAINER--
ports@FreeBSD.org
--End MAINTAINER--

--CONFIGURE_ARGS--
--without-nagios4 --prefix=/usr/local ${_LATE_CONFIGURE_ARGS}
--End CONFIGURE_ARGS--

...

gmake[1]: Entering directory '/wrkdirs/usr/ports/net-mgmt/mk-livestatus/work/mk-livestatus-1.2.8p20'
gmake  all-recursive
gmake[2]: Entering directory '/wrkdirs/usr/ports/net-mgmt/mk-livestatus/work/mk-livestatus-1.2.8p20'
Making all in src
gmake[3]: Entering directory '/wrkdirs/usr/ports/net-mgmt/mk-livestatus/work/mk-livestatus-1.2.8p20/src'
c++ -DHAVE_CONFIG_H -I. -I..   -O2 -pipe  -fstack-protector -fno-strict-aliasing  -DNAGIOS4 -std=c++11 -fPIC -O2 -pipe -fstack-protector -fno-strict-aliasing   -MT livestatus_so-AndingFilter.o -MD -MP -MF .deps/livestatus_so-AndingFilter.Tpo -c -o livestatus_so-AndingFilter.o `test -f 'AndingFilter.cc' || echo './'`AndingFilter.cc
In file included from AndingFilter.cc:28:
In file included from ./Query.h:37:
In file included from ./nagios.h:36:
In file included from ../nagios4/broker.h:26:
In file included from ../nagios4/nagios.h:33:
In file included from ../nagios4/config.h:214:

This patche solve problem:

Index: Makefile
===================================================================
--- Makefile    (revision 483039)
+++ Makefile    (working copy)
@@ -38,7 +38,7 @@
 NAGIOS3_DESC=  build for nagios-3.x
 NAGIOS4_DESC=  build for nagios-4.x
 
-NAGIOS4_CONFIGURE_WITH=nagios4
+NAGIOS4_CONFIGURE_ON=  --with-nagios4

Thanks!
Comment 1 Nathan 2018-11-16 02:21:18 UTC
(In reply to Leonid Vasiliev from comment #0)
-NAGIOS4_CONFIGURE_WITH=nagios4
+NAGIOS4_CONFIGURE_ON=  --with-nagios4

Should not make a difference, CONFIGURE_WITH will turn into CONFIGURE_ON --with-nagios4 essentially
Comment 2 Nathan 2018-11-16 02:23:05 UTC
(In reply to Nathan from comment #1)
Nevermind I may be partially wrong. Maybe we should remove OPTIONS period and use v4 by default
Comment 3 Leonid Vasiliev 2018-11-16 09:11:21 UTC
(In reply to Nathan from comment #2)

1. When selected NAGIOS3, macros `NAGIOS4_CONFIGURE_WITH=nagios4` make option --without-nagios4 for configure script from mk-livestatus. But in this case mk-livestatus build with -DNAGIOS4. Its a bug (I'm not sure, may be wrong automake script from package). We have been using this package for a long time, but the latest update has broken it.

$ mk-livestatus-1.2.8p20> ./configure --without-nagios4
$ mk-livestatus-1.2.8p20> grep NAGIOS Makefile
CPPFLAGS = -g -O2 -DNAGIOS4

$ mk-livestatus-1.2.8p20> ./configure --with-nagios4
$ mk-livestatus-1.2.8p20> grep CPPFLAGS Makefile
CPPFLAGS = -g -O2 -DNAGIOS4

$ mk-livestatus-1.2.8p20> ./configure
$ mk-livestatus-1.2.8p20> grep CPPFLAGS Makefile
CPPFLAGS = 


2. net-mgmt/icinga work only with mk-livestatus built with nagios3.

3. We love FreeBSD technology and use poudriere. But at the moment the NAGIOS3 option is not working.
Comment 4 Nathan 2018-11-16 12:37:45 UTC
Maybe it’s fixed in the newer version.  Plan to try to update it soon and then maybe it will work correctly
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-11-16 12:49:57 UTC
A commit references this bug:

Author: tobik
Date: Fri Nov 16 12:49:05 UTC 2018
New revision: 485075
URL: https://svnweb.freebsd.org/changeset/ports/485075

Log:
  net-mgmt/mk-livestatus: Unbreak Nagios 3.x support

  Fix the NAGIOS4 option: The --without-nagios4 configure arg seems
  to be broken in 1.2.8p20 and actually also enables Nagios 4.x
  support.  Switch to just passing --with-nagios4 if NAGIOS4=on for
  the time being.

  $ mk-livestatus-1.2.8p20> ./configure --without-nagios4
  $ mk-livestatus-1.2.8p20> grep NAGIOS Makefile
  CPPFLAGS = -g -O2 -DNAGIOS4

  $ mk-livestatus-1.2.8p20> ./configure --with-nagios4
  $ mk-livestatus-1.2.8p20> grep CPPFLAGS Makefile
  CPPFLAGS = -g -O2 -DNAGIOS4

  $ mk-livestatus-1.2.8p20> ./configure
  $ mk-livestatus-1.2.8p20> grep CPPFLAGS Makefile
  CPPFLAGS =

  This makes sure that mk-livestatus is built with Nagios 3.x support
  again by default.

  PR:		232716
  Submitted by:	Leonid Vasiliev <leo9641@yandex.ru>

Changes:
  head/net-mgmt/mk-livestatus/Makefile
Comment 6 Leonid Vasiliev 2019-04-09 08:06:36 UTC
Hello, this problem repeats again:

NAGIOS4_CONFIGURE_WITH= nagios4

always build with NAGIOS4 support...
Comment 7 Tobias Kortkamp freebsd_committer freebsd_triage 2019-04-09 08:15:08 UTC
(In reply to Leonid Vasiliev from comment #6)
> Hello, this problem repeats again:
> 
> NAGIOS4_CONFIGURE_WITH= nagios4
> 
> always build with NAGIOS4 support...

The new maintainer has undone my commit, which is a shame.  There is little point
in me fixing this again if it's undone soon after.  Assigning to maintainer
to hopefully reapply the change from ports r485075.
Comment 8 Vinícius Zavam freebsd_committer freebsd_triage 2019-04-12 14:49:53 UTC
(In reply to Tobias Kortkamp from comment #7)

hm, the option helpers were used to get its standards on the port's Makefile. shame that _WITH, _ON, and other helpers really do not work as we expect. back when I adopted the port, all QA passed.

it's really a shame that this happened. to revert that (back again), I would need to wait for an approval :\

... or I give you explicit permission to patch it before my mentors' approval.
Comment 9 commit-hook freebsd_committer freebsd_triage 2019-04-15 08:35:33 UTC
A commit references this bug:

Author: tobik
Date: Mon Apr 15 08:34:48 UTC 2019
New revision: 499002
URL: https://svnweb.freebsd.org/changeset/ports/499002

Log:
  net-mgmt/mk-livestatus: Restore fix from r485075

  mk-livestatus always builds with Nagios 4 support again and
  --without-nagios4 is still broken.

  PR:		232716
  Reported by:	Leonid Vasiliev <leo9641@yandex.ru>
  Approved by:	egypcio (maintainer)

Changes:
  head/net-mgmt/mk-livestatus/Makefile
Comment 10 commit-hook freebsd_committer freebsd_triage 2019-04-15 08:36:36 UTC
A commit references this bug:

Author: tobik
Date: Mon Apr 15 08:35:57 UTC 2019
New revision: 499003
URL: https://svnweb.freebsd.org/changeset/ports/499003

Log:
  MFH: r499002

  net-mgmt/mk-livestatus: Restore fix from r485075

  mk-livestatus always builds with Nagios 4 support again and
  --without-nagios4 is still broken.

  PR:		232716
  Reported by:	Leonid Vasiliev <leo9641@yandex.ru>
  Approved by:	egypcio (maintainer)

  Approved by:	ports-secteam blanket

Changes:
_U  branches/2019Q2/
  branches/2019Q2/net-mgmt/mk-livestatus/Makefile
Comment 11 Tobias Kortkamp freebsd_committer freebsd_triage 2019-04-15 08:39:21 UTC
(In reply to Vinícius Zavam from comment #8)
> (In reply to Tobias Kortkamp from comment #7)
> 
> hm, the option helpers were used to get its standards on the port's
> Makefile. shame that _WITH, _ON, and other helpers really do not work as we
> expect. back when I adopted the port, all QA passed.
> 
> it's really a shame that this happened. to revert that (back again), I would
> need to wait for an approval :\
> 
> ... or I give you explicit permission to patch it before my mentors'
> approval.

Committed. Thanks!

Since this is non-obvious I've left a comment in the Makefile now
which I probably should have done in the first place.