On Thu, 2010-02-18 at 00:43 -0600, GOUTHAM BINNADI wrote:
> Hi All,
> 
> As part of the feature XX-6870 (Add SNMP traps as an alarm
> notification method), two new packages net-snmp-devel and
> net-snmp-perl have been introduced into the build. The newly added
> TrapNotifier functionality will use the API's provided by these
> packages.
> 
> All required changes have been made in the Express Development
> Environment (EDE) script to include the new rpms (net-snmp-devel and
> net-snmp-perl) that provide the SNMP API's.
> 
> The sipXsupervisor side changes for this feature have been committed
> in r18018. 
> 
> Your development environment needs to be updated to include the
> net-snmp-devel and net-snmp-perl rpms. This can be done by doing a yum
> install on these packages as shown below:
> 
> yum install net-snmp-devel 
> yum install net-snmp-perl

The right way to do something like this is:

      * Add the required rpm packages to the spec file for the component
        that has the dependency so that yum installs will find them.
      * Add the required rpms to those included on the ISO
        (unfortunately that is not yet automated base on the previous
        item, though it could be)
      * Add a test to one of the .m4 files in the top level config
        directory that knows how to test for the presence of that
        component.
      * Add an entry to any configure.ac file that needs the component
        to invoke that test.

I'm writing a wiki page on all this.. should appear in the next day or
so - in the mean time, the attached is a patch that does this for
net-snmp (although I think I didn't put the perl rpm into the spec file
- please fix that when you put in the patch).


diff --git a/config/general.m4 b/config/general.m4
index cde43ab..6fcdab7 100644
--- a/config/general.m4
+++ b/config/general.m4
@@ -34,6 +34,28 @@ AC_DEFUN([CHECK_CLOVER],
    fi
 ])
 
+# ================ NET SNMP ================
+AC_DEFUN([CHECK_NET_SNMP],
+[
+    AC_MSG_CHECKING([for net-snmp includes ])
+    include_path="$includedir $prefix/include /usr/include /usr/local/include"
+    include_check="net-snmp/net-snmp-config.h"
+
+    foundpath=""
+    for dir in $include_path ; do
+        if test -f "$dir/$include_check";
+        then
+            foundpath=$dir;
+            break;
+        fi;
+    done
+    if test x_$foundpath = x_; then
+       AC_MSG_ERROR('$include_check' not found)
+       AC_MSG_WARN([    searched $include_path])
+    else
+       AC_MSG_RESULT($foundpath/$include_check)
+    fi
+])
 
 # ============ O P E N F I R E  =======================
 AC_DEFUN([CHECK_OPENFIRE],
diff --git a/sipXsupervisor/configure.ac b/sipXsupervisor/configure.ac
index 0a0739f..f36566e 100644
--- a/sipXsupervisor/configure.ac
+++ b/sipXsupervisor/configure.ac
@@ -22,6 +22,7 @@ AC_PROG_CXX
 AX_COMPILER_VENDOR
 AC_PROG_CC
 CHECK_XARGS_REPLACE
+CHECK_NET_SNMP
 
 ENABLE_DOC
 AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
diff --git a/sipXsupervisor/sipxsupervisor.spec.in b/sipXsupervisor/sipxsupervisor.spec.in
index 4ab7bea..dbad67b 100644
--- a/sipXsupervisor/sipxsupervisor.spec.in
+++ b/sipXsupervisor/sipxsupervisor.spec.in
@@ -15,6 +15,8 @@ Source:   %name-%version.tar.gz
 Requires: chkconfig
 %endif
 
+BuildRequires: net-snmp-devel >= 5.4.2
+Requires: net-snmp-libs >= 5.4.2
 Requires: sipxcommserverlib >= %version
 
 # by requiring sipxpbx, that will be upgraded first so it won't object to this overriding files
@@ -43,6 +45,7 @@ for a remote management application.
 
 %package devel
 Requires: %name
+Requires: net-snmp-devel >= 5.4.2
 Group: Development/Libraries
 Vendor: SIPfoundry
 Summary: Internal documentation for %name
_______________________________________________
sipx-dev mailing list [email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev
sipXecs IP PBX -- http://www.sipfoundry.org/

Reply via email to