<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>222317</bug_id>
          
          <creation_ts>2008-05-15 22:03 0000</creation_ts>
          <short_desc>net-analyzer/nagios-plugins-1.4.11: compile fail with postgresql 8.3 and postgres use flag</short_desc>
          <delta_ts>2008-05-29 12:56:53 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Unspecified</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>sean@gutenpress.org</reporter>
          <assigned_to>dertobi123@gentoo.org</assigned_to>
          <cc>ktomczyk@power.com.pl</cc>

      

      
          <long_desc isprivate="0">
            <who>sean@gutenpress.org</who>
            <bug_when>2008-05-15 22:03:25 0000</bug_when>
            <thetext>If posgresql 8.3 is installed and the postgres use flag set, the check_pgsql plugin will not build.

Reproducible: Always

Steps to Reproduce:
1.install postgresql 8.3
2.USE=posgresql emerge nagios-plugins
3.

Actual Results:  
compile fails on check_pgsql

Expected Results:  
compile should complete without errors

This fixes the problem:

--- nagios-plugins-1.4.11.ebuild        2008-05-15 17:58:42.265449153 +0000
+++ nagios-plugins-1.4.11.ebuild.pgsql_patched  2008-05-15 17:58:24.155171300 +0000
@@ -56,6 +56,10 @@

        epatch &quot;${FILESDIR}&quot;/${PN}-1.4.10-contrib.patch

+       if use postgres; then
+               epatch &quot;${FILESDIR}&quot;/${PN}-1.4.11-check_pgsql.patch
+       fi
+
        AT_M4DIR=&quot;m4 gl/m4&quot; eautoreconf
 }

files/nagios-plugins-1.4.11-check_pgsql.patch:
--- plugins/check_pgsql.c
+++ plugins/check_pgsql.c
@@ -43,6 +43,7 @@
 #include &quot;utils.h&quot;

 #include &quot;netutils.h&quot;
+#include &quot;pg_config_manual.h&quot;
 #include &lt;libpq-fe.h&gt;

 #define DEFAULT_DB &quot;template1&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caleb@gentoo.org</who>
            <bug_when>2008-05-20 11:16:09 0000</bug_when>
            <thetext>I can confirm this bug, however, I can&apos;t confirm whether the patch applies again older version of pgsql.  We may have to modify the patch to do a version check for 8.3.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ktomczyk@power.com.pl</who>
            <bug_when>2008-05-21 10:04:58 0000</bug_when>
            <thetext>(In reply to comment #0)
&gt; If posgresql 8.3 is installed and the postgres use flag set, the check_pgsql
&gt; plugin will not build.
&gt; 
&gt; Reproducible: Always
&gt; 
&gt; Steps to Reproduce:
&gt; 1.install postgresql 8.3
&gt; 2.USE=posgresql emerge nagios-plugins
&gt; 
it is also reproducible with disabled postgres USE-flag, there is probably some error in ebuild
&gt; 
&gt; Actual Results:  
&gt; compile fails on check_pgsql
&gt; 
&gt; Expected Results:  
&gt; compile should complete without errors
&gt; 
&gt; This fixes the problem:
&gt; 
&gt; --- nagios-plugins-1.4.11.ebuild        2008-05-15 17:58:42.265449153 +0000
&gt; +++ nagios-plugins-1.4.11.ebuild.pgsql_patched  2008-05-15 17:58:24.155171300
&gt; +0000
&gt; @@ -56,6 +56,10 @@
&gt; 
&gt;         epatch &quot;${FILESDIR}&quot;/${PN}-1.4.10-contrib.patch
&gt; 
&gt; +       if use postgres; then
&gt; +               epatch &quot;${FILESDIR}&quot;/${PN}-1.4.11-check_pgsql.patch
&gt; +       fi
&gt; +
&gt;         AT_M4DIR=&quot;m4 gl/m4&quot; eautoreconf
&gt;  }
&gt; 
&gt; files/nagios-plugins-1.4.11-check_pgsql.patch:
&gt; --- plugins/check_pgsql.c
&gt; +++ plugins/check_pgsql.c
&gt; @@ -43,6 +43,7 @@
&gt;  #include &quot;utils.h&quot;
&gt; 
&gt;  #include &quot;netutils.h&quot;
&gt; +#include &quot;pg_config_manual.h&quot;
&gt;  #include &lt;libpq-fe.h&gt;
&gt; 
&gt;  #define DEFAULT_DB &quot;template1&quot;
&gt; 

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2008-05-21 18:06:14 0000</bug_when>
            <thetext>(In reply to comment #1)
&gt; I can confirm this bug, however, I can&apos;t confirm whether the patch applies
&gt; again older version of pgsql.  We may have to modify the patch to do a version
&gt; check for 8.3.
&gt; 

nagios-plugins only seems to have a problem building w/ 8.3. I checked again with 8.2 which still builds as expected. Only applying the patch for 8.3 is accomplished by an combined use and has_version check - but applying this patch won&apos;t allow me to build the check_pgsql plugin w/ 8.3.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2008-05-21 18:09:41 0000</bug_when>
            <thetext>(In reply to comment #2)
&gt; it is also reproducible with disabled postgres USE-flag, there is probably some
&gt; error in ebuild

indeed it is, USE=&quot;postgres&quot; should set --with-pgsql instead of --with-postgres, I just fixed this is one in CVS.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>sean@gutenpress.org</who>
            <bug_when>2008-05-28 19:44:27 0000</bug_when>
            <thetext>This bug goes away with nagios-plugins 1.4.12.

From http://www.nagiosplugins.org/node/89:

check_pgsql now successfully builds with postgres lib v8.3 (Bug #1878972)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2008-05-29 12:56:53 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; This bug goes away with nagios-plugins 1.4.12.
&gt; 
&gt; From http://www.nagiosplugins.org/node/89:
&gt; 
&gt; check_pgsql now successfully builds with postgres lib v8.3 (Bug #1878972)
&gt; 

Thanks Sean! I just bumped the package.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>